You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defdo_diff(args):
''' Compare two configuration files. '''# Todo: Allow fallback to text comparisons for non-conf files.# Todo: Eventually support directory (or recursive?) diffs too.parse_args=dict(dup_stanza=args.duplicate_stanza, dup_key=args.duplicate_key,
keep_comments=args.comments, strict=True)
# Parse all config filestry:
cfg1=parse_conf(args.conf1, **parse_args)
cfg2=parse_conf(args.conf2, **parse_args)
exceptIOError, e:
sys.stderr.write("Unable to open conf file. {}\n".format(e.message))
returnEXIT_CODE_NO_SUCH_FILEexceptConfParserException, e:
sys.stderr.write("Unable to parse conf file. {}\n".format(e))
# We don't distinguish between bad conf files and safety checks here.returnEXIT_CODE_BAD_CONF_FILEdiffs=compare_cfgs(cfg1, cfg2)
rc=show_diff(args.output, diffs, headers=(args.conf1, args.conf2))
ifrc==EXIT_CODE_DIFF_EQUAL:
sys.stderr.write("Files are the same.\n")
elifrc==EXIT_CODE_DIFF_NO_COMMON:
sys.stderr.write("No common stanzas between files.\n")
returnrc
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: