mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Allow to list pending conf only in service_regen_conf
This commit is contained in:
parent
de04028309
commit
a06a753fb6
2 changed files with 11 additions and 1 deletions
|
@ -979,6 +979,10 @@ service:
|
||||||
Override all manual modifications in configuration
|
Override all manual modifications in configuration
|
||||||
files
|
files
|
||||||
action: store_true
|
action: store_true
|
||||||
|
-p:
|
||||||
|
full: --list-pending
|
||||||
|
help: List pending configuration files and exit
|
||||||
|
action: store_true
|
||||||
|
|
||||||
### service_safecopy()
|
### service_safecopy()
|
||||||
safecopy:
|
safecopy:
|
||||||
|
|
|
@ -271,7 +271,8 @@ def service_log(name, number=50):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def service_regen_conf(names=[], with_diff=False, force=False):
|
def service_regen_conf(names=[], with_diff=False, force=False,
|
||||||
|
list_pending=False):
|
||||||
"""
|
"""
|
||||||
Regenerate the configuration file(s) for a service
|
Regenerate the configuration file(s) for a service
|
||||||
|
|
||||||
|
@ -279,10 +280,15 @@ def service_regen_conf(names=[], with_diff=False, force=False):
|
||||||
names -- Services name to regenerate configuration of
|
names -- Services name to regenerate configuration of
|
||||||
with_diff -- Show differences in case of configuration changes
|
with_diff -- Show differences in case of configuration changes
|
||||||
force -- Override all manual modifications in configuration files
|
force -- Override all manual modifications in configuration files
|
||||||
|
list_pending -- List pending configuration files and exit
|
||||||
|
|
||||||
"""
|
"""
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
|
# Just return pending conf
|
||||||
|
if list_pending:
|
||||||
|
return _get_pending_conf(names)
|
||||||
|
|
||||||
# Clean pending conf directory
|
# Clean pending conf directory
|
||||||
shutil.rmtree(pending_conf_dir, ignore_errors=True)
|
shutil.rmtree(pending_conf_dir, ignore_errors=True)
|
||||||
filesystem.mkdir(pending_conf_dir, 0755, True)
|
filesystem.mkdir(pending_conf_dir, 0755, True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue