Commit 85803b0c by Michael DeHaan

Merge pull request #960 from mattupstate/devel

fix bug in supervisorctl module
parents f9e97531 a82928e7
......@@ -19,8 +19,6 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
SUPERVISORCTL = None
def _find_supervisorctl():
paths = ['/usr/local/bin', '/usr/bin']
......@@ -29,11 +27,9 @@ def _find_supervisorctl():
if os.path.exists(e):
return e
module.fail_json(msg='supervisorctl is not installed')
def _is_running(name):
rc, out, err = _run('%s status %s' % (SUPERVISORCTL, name))
rc, out, err = _run('%s status %s' % (_find_supervisorctl(), name))
return 'RUNNING' in out
......@@ -58,6 +54,9 @@ def main():
SUPERVISORCTL = _find_supervisorctl()
if SUPERVISORCTL is None:
module.fail_json(msg='supervisorctl is not installed')
running = _is_running(name)
if running and state == 'started':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment