mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
status function was called twice
This commit is contained in:
parent
83667961bb
commit
7817b69a1f
1 changed files with 3 additions and 2 deletions
|
@ -86,7 +86,8 @@ def main():
|
|||
module.run_command('%s %s %s' % (MONIT, command, name), check_rc=True)
|
||||
return status()
|
||||
|
||||
present = status() != ''
|
||||
process_status = status()
|
||||
present = process_status != ''
|
||||
|
||||
if not present and not state == 'present':
|
||||
module.fail_json(msg='%s process not presently configured with monit' % name, name=name, state=state)
|
||||
|
@ -102,7 +103,7 @@ def main():
|
|||
module.exit_json(changed=True, name=name, state=state)
|
||||
module.exit_json(changed=False, name=name, state=state)
|
||||
|
||||
running = 'running' in status()
|
||||
running = 'running' in process_status
|
||||
|
||||
if running and state in ['started', 'monitored']:
|
||||
module.exit_json(changed=False, name=name, state=state)
|
||||
|
|
Loading…
Reference in a new issue