diff --git a/sau/services.py b/sau/services.py index ae22395..7c41631 100644 --- a/sau/services.py +++ b/sau/services.py @@ -122,9 +122,9 @@ def restart_services(): log.warning('Service "{}" has open deleted files and should be restarted'.format(service)) continue elif 'reboot' in policy: - _warn('Rebooting because {} has opened files'.format(service)) + _warn(policy, 'Rebooting because {} has opened files'.format(service)) recommend_restart = True - _warn('Restarting service {}'.format(service)) + _warn(policy, 'Restarting service {}'.format(service)) platform.restart_service(service) tested_parents = set() @@ -142,13 +142,13 @@ def restart_services(): service = _get_service_from_proc(parent) policy = _get_service_restart_policy(service) if not service: - _warn('could not re-check process {} - failed to identify service'.format(proc)) + _warn(policy, 'could not re-check process {} - failed to identify service'.format(proc)) recommend_restart = True continue log.debug('{} is in service {}'.format(proc, service)) if parent_name in services and not services[parent_name]: - _warn('{} (parent {}) does not belong to a service and could not be restarted'.format(proc, parent)) + _warn(policy, '{} (parent {}) does not belong to a service and could not be restarted'.format(proc, parent)) recommend_restart = True continue elif parent_name in services: @@ -156,7 +156,7 @@ def restart_services(): log.debug('service {} has policy {}'.format(service, policy)) if policy in ('ignore', 'warn'): continue - _warn('{} (parent {}) still has deleted files open'.format(proc, parent)) + _warn(policy, '{} (parent {}) still has deleted files open'.format(proc, parent)) recommend_restart = True return recommend_restart