Merge pull request #621 from hostmaster/supervisorctl-not-existed-sv

supervisorctl module: Check if a service exists
This commit is contained in:
Toshio Kuratomi 2015-07-01 12:38:28 -07:00
commit 1458a6ec9a

View file

@ -194,9 +194,14 @@ def main():
if state == 'restarted':
rc, out, err = run_supervisorctl('update', check_rc=True)
processes = get_matched_processes()
if not processes:
module.fail_json(name=name, msg="ERROR (no such process)")
take_action_on_processes(processes, lambda s: True, 'restart', 'started')
processes = get_matched_processes()
if not processes:
module.fail_json(name=name, msg="ERROR (no such process)")
if state == 'absent':
if len(processes) == 0: