mirror of
https://github.com/chatmail/relay.git
synced 2026-05-21 13:28:05 +00:00
DNS: make --all non-optional for cmdeploy dns
This commit is contained in:
@@ -106,12 +106,6 @@ def dns_cmd_options(parser):
|
|||||||
default=None,
|
default=None,
|
||||||
help="write out a zonefile",
|
help="write out a zonefile",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"--all",
|
|
||||||
dest="all",
|
|
||||||
action="store_true",
|
|
||||||
help="check both required and recommended DNS records"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def dns_cmd(args, out):
|
def dns_cmd(args, out):
|
||||||
@@ -137,7 +131,7 @@ def dns_cmd(args, out):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
retcode = dns.check_full_zone(
|
retcode = dns.check_full_zone(
|
||||||
sshexec, remote_data=remote_data, zonefile=zonefile, out=out, all=args.all
|
sshexec, remote_data=remote_data, zonefile=zonefile, out=out
|
||||||
)
|
)
|
||||||
return retcode
|
return retcode
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def get_filled_zone_file(remote_data):
|
|||||||
return zonefile
|
return zonefile
|
||||||
|
|
||||||
|
|
||||||
def check_full_zone(sshexec, remote_data, out, zonefile, all) -> int:
|
def check_full_zone(sshexec, remote_data, out, zonefile) -> int:
|
||||||
"""Check existing DNS records, optionally write them to zone file
|
"""Check existing DNS records, optionally write them to zone file
|
||||||
and return (exitcode, remote_data) tuple."""
|
and return (exitcode, remote_data) tuple."""
|
||||||
|
|
||||||
@@ -56,12 +56,10 @@ def check_full_zone(sshexec, remote_data, out, zonefile, all) -> int:
|
|||||||
out(line)
|
out(line)
|
||||||
out("")
|
out("")
|
||||||
returncode = 1
|
returncode = 1
|
||||||
if recommended_diff and (all or not required_diff):
|
if recommended_diff:
|
||||||
out("WARNING: these recommended DNS entries are not set:\n")
|
out("WARNING: these recommended DNS entries are not set:\n")
|
||||||
for line in recommended_diff:
|
for line in recommended_diff:
|
||||||
out(line)
|
out(line)
|
||||||
if all:
|
|
||||||
returncode = 1
|
|
||||||
|
|
||||||
if not (recommended_diff or required_diff):
|
if not (recommended_diff or required_diff):
|
||||||
out.green("Great! All your DNS entries are verified and correct.")
|
out.green("Great! All your DNS entries are verified and correct.")
|
||||||
|
|||||||
Reference in New Issue
Block a user