mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 00:22:04 +02:00
Fixed save() to run checkpoint_update anytime files are added
This commit is contained in:
@@ -1065,7 +1065,7 @@ LogLevel warn \n\
|
|||||||
|
|
||||||
# If the augeas tree didn't change, no files were saved and a backup
|
# If the augeas tree didn't change, no files were saved and a backup
|
||||||
# should not be created
|
# should not be created
|
||||||
if save_paths:
|
if save_paths or self.new_files:
|
||||||
save_files = set()
|
save_files = set()
|
||||||
for p in save_paths:
|
for p in save_paths:
|
||||||
save_files.add(self.aug.get(p)[6:])
|
save_files.add(self.aug.get(p)[6:])
|
||||||
@@ -1192,6 +1192,7 @@ LogLevel warn \n\
|
|||||||
shutil.copy2(cp_dir + '/' + os.path.basename(fp) + '_' + str(idx), fp)
|
shutil.copy2(cp_dir + '/' + os.path.basename(fp) + '_' + str(idx), fp)
|
||||||
except:
|
except:
|
||||||
# This file is required in all checkpoints.
|
# This file is required in all checkpoints.
|
||||||
|
logger.error("Unable to recover files from %s" % cp_dir)
|
||||||
return 1
|
return 1
|
||||||
try:
|
try:
|
||||||
# Remove any newly added files if they exist
|
# Remove any newly added files if they exist
|
||||||
@@ -1251,6 +1252,11 @@ LogLevel warn \n\
|
|||||||
print "Trustify has not saved any backups of your apache configuration"
|
print "Trustify has not saved any backups of your apache configuration"
|
||||||
# Make sure there isn't anything unexpected in the backup folder
|
# Make sure there isn't anything unexpected in the backup folder
|
||||||
# There should only be timestamped (float) directories
|
# There should only be timestamped (float) directories
|
||||||
|
try:
|
||||||
|
float(bu) for bu in backups
|
||||||
|
except:
|
||||||
|
assert(False, "Invalid files in %s" % BACKUP_DIR)
|
||||||
|
|
||||||
assert(all(bu.isdigit() for bu in backups))
|
assert(all(bu.isdigit() for bu in backups))
|
||||||
|
|
||||||
for bu in backups:
|
for bu in backups:
|
||||||
@@ -1265,7 +1271,7 @@ LogLevel warn \n\
|
|||||||
print " %s" % fp
|
print " %s" % fp
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(cp_dir + "/NEW_FILES") as f:
|
with open(BACKUP_DIR + "/NEW_FILES") as f:
|
||||||
print "New Configuration Files:"
|
print "New Configuration Files:"
|
||||||
filepaths = f.read().splitlines()
|
filepaths = f.read().splitlines()
|
||||||
for fp in filepaths:
|
for fp in filepaths:
|
||||||
|
|||||||
Reference in New Issue
Block a user