DNS: make --all non-optional for cmdeploy dns

This commit is contained in:
missytake
2024-12-20 23:28:54 +01:00
parent a7b808ebaf
commit 5c78619750
2 changed files with 3 additions and 11 deletions

View File

@@ -106,12 +106,6 @@ def dns_cmd_options(parser):
default=None,
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):
@@ -137,7 +131,7 @@ def dns_cmd(args, out):
return 0
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

View File

@@ -40,7 +40,7 @@ def get_filled_zone_file(remote_data):
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
and return (exitcode, remote_data) tuple."""
@@ -56,12 +56,10 @@ def check_full_zone(sshexec, remote_data, out, zonefile, all) -> int:
out(line)
out("")
returncode = 1
if recommended_diff and (all or not required_diff):
if recommended_diff:
out("WARNING: these recommended DNS entries are not set:\n")
for line in recommended_diff:
out(line)
if all:
returncode = 1
if not (recommended_diff or required_diff):
out.green("Great! All your DNS entries are verified and correct.")