def compare_files(file1, file2, log):
"""Compare two files
Use Python's filecmp module to compare two files and log/print
results.
Args:
file1 (string): Path of first file to compare
file2 (string): Path of second file to compare
log (:obj:`Logger`): Log file object.
Returns:
boolean: True if they seem equal, False otherwise
"""
if filecmp.cmp(file1, file2):
msg = ("Two MAC Address Table Files Are Identical! '%s' & '%s'"
% (file1, file2))
log.error(msg)
print("Error: " + msg)
return True
else:
return False
validate_mac_table_files.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录