Take into account missing files when checking
parent
2449711ede
commit
c995f07e67
|
@ -150,6 +150,7 @@ def _compare_and_log(original_file_path, persoconf_backup_path, logger):
|
||||||
% original_file_path )
|
% original_file_path )
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
if filecmp.cmp(resolved_ofp, resolved_pbp) :
|
if filecmp.cmp(resolved_ofp, resolved_pbp) :
|
||||||
logger.info( "No modification on %s"
|
logger.info( "No modification on %s"
|
||||||
% original_file_path )
|
% original_file_path )
|
||||||
|
@ -158,3 +159,15 @@ def _compare_and_log(original_file_path, persoconf_backup_path, logger):
|
||||||
logger.warning( "File %s was modified"
|
logger.warning( "File %s was modified"
|
||||||
% original_file_path )
|
% 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 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue