mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
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:
parent
ae96ba0d4f
commit
f26272a492
1 changed files with 4 additions and 2 deletions
|
@ -258,7 +258,7 @@ def main():
|
||||||
elif location.get('chkconfig'):
|
elif location.get('chkconfig'):
|
||||||
(rc, out, err) = module.run_command("%s --level %s %s off" % (location['chkconfig'], ''.join(runlevels), name))
|
(rc, out, err) = module.run_command("%s --level %s %s off" % (location['chkconfig'], ''.join(runlevels), name))
|
||||||
else:
|
else:
|
||||||
if enabled != runlevel_status["enabled"]:
|
if enabled is not None and enabled != runlevel_status["enabled"]:
|
||||||
result['changed'] = True
|
result['changed'] = True
|
||||||
result['status']['enabled']['changed'] = True
|
result['status']['enabled']['changed'] = True
|
||||||
|
|
||||||
|
@ -299,7 +299,9 @@ def main():
|
||||||
|
|
||||||
def runme(doit):
|
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
|
# how to run
|
||||||
if module.params['daemonize']:
|
if module.params['daemonize']:
|
||||||
(rc, out, err) = daemonize(cmd)
|
(rc, out, err) = daemonize(cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue