Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if a1 and a2:
# Answers from both servers, compare rrsets
if a1 != a2:
header(args.ns1_name, ns1_port, args.ns2_name, ns2_port)
removed(a1, color=args.color_flag)
added(a2, color=args.color_flag)
# else:
# # Records both exist and match
# pass
elif a1 and not a2:
# Added to ns1 removed from ns2
header(args.ns1_name, ns1_port, args.ns2_name, ns2_port)
removed(a1, color=args.color_flag)
added(a1, color=args.color_flag)
elif a2 and not a1:
# Added to ns2 removed from ns1
header(args.ns1_name, ns1_port, args.ns2_name, ns2_port)
removed(a2, color=args.color_flag)
added(a2, color=args.color_flag)
else:
# Exists in zonefile but not on either server
sys.stderr.write("%s: Record \"%s\" exists in zonefile but not on either server.\n" %
(progname, query.question[0]))
sys.stderr.write("Export zonefile from %s and try again\n" %
args.ns1_name)
sys.exit(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment