mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Do not clean whole pending conf dir when names are given at regen-conf
This commit is contained in:
parent
fcfb6de16e
commit
f1866c6113
1 changed files with 9 additions and 2 deletions
|
@ -300,8 +300,15 @@ def service_regen_conf(names=[], with_diff=False, force=False, dry_run=False,
|
||||||
return pending_conf
|
return pending_conf
|
||||||
|
|
||||||
# Clean pending conf directory
|
# Clean pending conf directory
|
||||||
shutil.rmtree(pending_conf_dir, ignore_errors=True)
|
if os.path.isdir(pending_conf_dir):
|
||||||
filesystem.mkdir(pending_conf_dir, 0755, True)
|
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
|
# Format common hooks arguments
|
||||||
common_args = [1 if force else 0, 1 if dry_run else 0]
|
common_args = [1 if force else 0, 1 if dry_run else 0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue