From 9229210538411b6e87bca5dd09686ad9999a3b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 11 Apr 2016 20:42:21 +0200 Subject: [PATCH] [enh] Also show diff as needed with --list-pending in service_regen_conf --- src/yunohost/service.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 23336f9b..7795cd45 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -285,9 +285,18 @@ def service_regen_conf(names=[], with_diff=False, force=False, """ result = {} - # Just return pending conf + # Return the list of pending conf if list_pending: - return _get_pending_conf(names) + pending_conf = _get_pending_conf(names) + if with_diff: + for service, conf_files in pending_conf.items(): + for system_path, pending_path in conf_files.items(): + pending_conf[service][system_path] = { + 'pending_conf': pending_path, + 'diff': _get_files_diff( + system_path, pending_path, True), + } + return pending_conf # Clean pending conf directory shutil.rmtree(pending_conf_dir, ignore_errors=True)