From de040283099b5f84fdd9fe401a7f3304a3f4eab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 11 Apr 2016 18:56:48 +0200 Subject: [PATCH] [fix] Keep only pending conf in conf regen --- src/yunohost/service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 9c5f2e04f..96a5f05d8 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -333,6 +333,7 @@ def service_regen_conf(names=[], with_diff=False, force=False): if not system_hash: if to_remove: logger.debug("> system conf is already removed") + os.remove(pending_path) continue if not current_hash or force: if force: @@ -376,6 +377,7 @@ def service_regen_conf(names=[], with_diff=False, force=False): conf_status = 'updated' else: logger.debug("> system conf is already up-to-date") + os.remove(pending_path) continue else: logger.debug("> system conf has been manually modified") @@ -621,7 +623,7 @@ def _process_regen_conf(system_conf, new_conf=None, save=True): system_dir = os.path.dirname(system_conf) if not os.path.isdir(system_dir): filesystem.mkdir(system_dir, 0755, True) - shutil.copy2(new_conf, system_conf) + shutil.move(new_conf, system_conf) logger.info(m18n.n('service_conf_file_updated', conf=system_conf)) except: