[enh] Do not clean whole pending conf dir when names are given at regen-conf

This commit is contained in:
Jérôme Lebleu 2016-05-01 13:41:54 +02:00
parent fcfb6de16e
commit f1866c6113

View file

@ -300,7 +300,14 @@ def service_regen_conf(names=[], with_diff=False, force=False, dry_run=False,
return pending_conf
# Clean pending conf directory
if os.path.isdir(pending_conf_dir):
if not names:
shutil.rmtree(pending_conf_dir, ignore_errors=True)
else:
for name in names:
shutil.rmtree(os.path.join(pending_conf_dir, name),
ignore_errors=True)
else:
filesystem.mkdir(pending_conf_dir, 0755, True)
# Format common hooks arguments