From a06a753fb6f70e9f20a36060a99780524eb7cad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 11 Apr 2016 19:03:48 +0200 Subject: [PATCH] [enh] Allow to list pending conf only in service_regen_conf --- data/actionsmap/yunohost.yml | 4 ++++ src/yunohost/service.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index faeae2367..eb3597078 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -979,6 +979,10 @@ service: Override all manual modifications in configuration files action: store_true + -p: + full: --list-pending + help: List pending configuration files and exit + action: store_true ### service_safecopy() safecopy: diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 96a5f05d8..23336f9b6 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -271,7 +271,8 @@ def service_log(name, number=50): 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 @@ -279,10 +280,15 @@ def service_regen_conf(names=[], with_diff=False, force=False): names -- Services name to regenerate configuration of with_diff -- Show differences in case of configuration changes force -- Override all manual modifications in configuration files + list_pending -- List pending configuration files and exit """ result = {} + # Just return pending conf + if list_pending: + return _get_pending_conf(names) + # Clean pending conf directory shutil.rmtree(pending_conf_dir, ignore_errors=True) filesystem.mkdir(pending_conf_dir, 0755, True)