From 103b5954c78375b3f1c5dbc8db3257943f825c13 Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Tue, 2 Dec 2014 22:33:49 +0100 Subject: [PATCH] supervisorctl: Don't try to start a starting program Starting a "STARTING" program throws ERROR (already started), so don't do that. --- lib/ansible/modules/web_infrastructure/supervisorctl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/web_infrastructure/supervisorctl.py b/lib/ansible/modules/web_infrastructure/supervisorctl.py index 2d458169e76..f75992b9a6a 100644 --- a/lib/ansible/modules/web_infrastructure/supervisorctl.py +++ b/lib/ansible/modules/web_infrastructure/supervisorctl.py @@ -210,10 +210,10 @@ def main(): module.fail_json(msg=out, name=name, state=state) if state == 'started': - take_action_on_processes(processes, lambda s: s != 'RUNNING', 'start', 'started') + take_action_on_processes(processes, lambda s: s not in ('RUNNING', 'STARTING'), 'start', 'started') if state == 'stopped': - take_action_on_processes(processes, lambda s: s == 'RUNNING', 'stop', 'stopped') + take_action_on_processes(processes, lambda s: s in ('RUNNING', 'STARTING'), 'stop', 'stopped') # import module snippets from ansible.module_utils.basic import *