Fix 2 issues in sysvinit module (#42786)

* Do not compare result to unset parameter in sysvinit module

* Fix misformed command in sysvinit module

* Small None-comparison style fix in sysvinit module
This commit is contained in:
uwila 2018-07-17 03:33:01 +02:00 committed by Brian Coca
parent ae96ba0d4f
commit f26272a492

View file

@ -258,7 +258,7 @@ def main():
elif location.get('chkconfig'):
(rc, out, err) = module.run_command("%s --level %s %s off" % (location['chkconfig'], ''.join(runlevels), name))
else:
if enabled != runlevel_status["enabled"]:
if enabled is not None and enabled != runlevel_status["enabled"]:
result['changed'] = True
result['status']['enabled']['changed'] = True
@ -299,7 +299,9 @@ def main():
def runme(doit):
cmd = "%s %s %s %s" % (script, doit, name, module.params['arguments'])
args = module.params['arguments']
cmd = "%s %s %s" % (script, doit, "" if args is None else args)
# how to run
if module.params['daemonize']:
(rc, out, err) = daemonize(cmd)