diff --git a/sau/services.py b/sau/services.py index e8850c2..275dcd5 100644 --- a/sau/services.py +++ b/sau/services.py @@ -172,6 +172,7 @@ def restart_services(): return recommend_restart def _get_service_restart_policy(service): + log = logging.getLogger(sau.LOGNAME) conf = sau.config policy = conf.get('services', service, fallback=None) if policy and policy.lower() in ('restart', 'warn', 'ignore', 'silent-restart'): @@ -179,7 +180,7 @@ def _get_service_restart_policy(service): elif policy: log.warning('service policy {} for {} is invalid'.format(policy, service)) - default_policy = conf.get('services', 'default_service_policy', fallback='warn') + default_policy = conf.get('default', 'default_service_policy', fallback='warn') if default_policy.lower() in ('restart', 'warn', 'ignore', 'silent-restart'): return default_policy.lower() log.warning('default service policy {} is invalid'.format(default_policy))