Following previous regenconf fixes, the regen-conf was now outputing a whole lot of 'forget-about-it' when e.g. running regen-conf for nginx because of files flagged as 'should-not-exists'... so this is a dirty workaround

This commit is contained in:
Alexandre Aubin 2020-06-17 17:37:54 +02:00
parent 84d325495b
commit b970cba6c4

View file

@ -236,6 +236,8 @@ def regen_conf(operation_logger, names=[], with_diff=False, force=False, dry_run
conf_files[f] = None conf_files[f] = None
# </> End discussion about stale file hashes # </> End discussion about stale file hashes
force_update_hashes_for_this_category = False
for system_path, pending_path in conf_files.items(): for system_path, pending_path in conf_files.items():
logger.debug("processing pending conf '%s' to system conf '%s'", logger.debug("processing pending conf '%s' to system conf '%s'",
pending_path, system_path) pending_path, system_path)
@ -284,7 +286,8 @@ def regen_conf(operation_logger, names=[], with_diff=False, force=False, dry_run
os.remove(pending_path) os.remove(pending_path)
conf_hashes[system_path] = None conf_hashes[system_path] = None
conf_status = 'forget-about-it' conf_status = 'forget-about-it'
regenerated = True force_update_hashes_for_this_category = True
continue
elif not saved_hash or force: elif not saved_hash or force:
if force: if force:
logger.debug("> system conf has been manually removed") logger.debug("> system conf has been manually removed")
@ -377,7 +380,7 @@ def regen_conf(operation_logger, names=[], with_diff=False, force=False, dry_run
else: else:
logger.success(m18n.n('regenconf_would_be_updated', category=category)) logger.success(m18n.n('regenconf_would_be_updated', category=category))
if succeed_regen and not dry_run: if (succeed_regen or force_update_hashes_for_this_category) and not dry_run:
_update_conf_hashes(category, conf_hashes) _update_conf_hashes(category, conf_hashes)
# Append the category results # Append the category results