From 8261b6fc6341893eef81e956efb236f0772d2ce4 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 15 Nov 2019 14:02:06 -0500 Subject: [PATCH] move cmd assignment - https://github.com/Security-Onion-Solutions/securityonion-saltstack/issues/112 --- salt/_modules/needs_restarting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/_modules/needs_restarting.py b/salt/_modules/needs_restarting.py index 51f80670a..49f82bbf2 100644 --- a/salt/_modules/needs_restarting.py +++ b/salt/_modules/needs_restarting.py @@ -4,7 +4,6 @@ import subprocess def check(): os = __grains__['os'] - cmd = 'needs-restarting -r > /dev/null 2>&1' if os == 'Ubuntu': if path.exists('/var/run/reboot-required'): @@ -13,6 +12,7 @@ def check(): retval = 'False' elif os == 'CentOS': + cmd = 'needs-restarting -r > /dev/null 2>&1' try: needs_restarting = subprocess.check_call(cmd.split(), shell=True) except subprocess.CalledProcessError: