Take into account missing files when checking
parent
2449711ede
commit
c995f07e67
|
@ -150,11 +150,24 @@ def _compare_and_log(original_file_path, persoconf_backup_path, logger):
|
||||||
% original_file_path )
|
% original_file_path )
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if filecmp.cmp(resolved_ofp, resolved_pbp) :
|
try:
|
||||||
logger.info( "No modification on %s"
|
if filecmp.cmp(resolved_ofp, resolved_pbp) :
|
||||||
% original_file_path )
|
logger.info( "No modification on %s"
|
||||||
|
% original_file_path )
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.warning( "File %s was modified"
|
||||||
|
% original_file_path )
|
||||||
|
|
||||||
|
except FileNotFoundError as err:
|
||||||
|
if err.filename == resolved_pbp:
|
||||||
|
logger.warning( "File %s was modified (no backup file)"
|
||||||
|
% original_file_path )
|
||||||
|
else:
|
||||||
|
logger.warning( "File %s was deleted!"
|
||||||
|
% original_file_path )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
logger.warning( "File %s was modified"
|
|
||||||
% original_file_path )
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue