From 3f1aca9849e38d4d3e07ad87b386ec184905154e Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Mon, 12 Oct 2015 14:28:22 +0000 Subject: [PATCH] Save/restore paused status in decorator to prevent functions like config-changed from overwriting it --- lib/swift_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/swift_utils.py b/lib/swift_utils.py index 15b871d..a9b63a7 100644 --- a/lib/swift_utils.py +++ b/lib/swift_utils.py @@ -1001,7 +1001,11 @@ def pause_aware_restart_on_change(restart_map): """Avoids restarting services if config changes when unit is paused.""" def wrapper(f): if is_paused(): - return f + # save/restore paused status in case called function changes it + status, message = status_get() + ret = f + status_set(status, message) + return ret else: return restart_on_change(restart_map)(f) return wrapper