def compare_configs(cfg1,cfg2):
d = difflib.unified_diff(cfg1, cfg2)
diffstr = ""
for line in d:
if line.find('Current configuration') == -1:
if line.find('Last configuration change') == -1:
if line.find('length 0') == -1:
if line.find('login authentication tacplus') == -1:
if (line.find("+++")==-1) and (line.find("---")==-1):
if (line.find("-!")==-1) and (line.find('+!')==-1):
if line.startswith('+'):
diffstr = diffstr + "\n" + line
elif line.startswith('-'):
diffstr = diffstr + "\n" + line
return diffstr
评论列表
文章目录