Merge pull request #12521 from allanparsons/supervisord

Supervisord
This commit is contained in:
Thomas S Hatch 2014-05-05 09:44:21 -06:00
commit 46d2a28867

View File

@ -82,6 +82,8 @@ def start(name='all', user=None, conf_file=None, bin_env=None):
salt '*' supervisord.start <service>
salt '*' supervisord.start <group>:
'''
if name.endswith(':*'):
name = name[:-1]
ret = __salt__['cmd.run_all'](
_ctl_cmd('start', name, conf_file, bin_env), runas=user
)
@ -108,6 +110,8 @@ def restart(name='all', user=None, conf_file=None, bin_env=None):
salt '*' supervisord.restart <service>
salt '*' supervisord.restart <group>:
'''
if name.endswith(':*'):
name = name[:-1]
ret = __salt__['cmd.run_all'](
_ctl_cmd('restart', name, conf_file, bin_env), runas=user
)
@ -134,6 +138,8 @@ def stop(name='all', user=None, conf_file=None, bin_env=None):
salt '*' supervisord.stop <service>
salt '*' supervisord.stop <group>:
'''
if name.endswith(':*'):
name = name[:-1]
ret = __salt__['cmd.run_all'](
_ctl_cmd('stop', name, conf_file, bin_env), runas=user
)
@ -160,6 +166,8 @@ def add(name, user=None, conf_file=None, bin_env=None):
'''
if name.endswith(':'):
name = name[:-1]
elif name.endswith(':*'):
name = name[:-2]
ret = __salt__['cmd.run_all'](
_ctl_cmd('add', name, conf_file, bin_env), runas=user
)
@ -186,6 +194,8 @@ def remove(name, user=None, conf_file=None, bin_env=None):
'''
if name.endswith(':'):
name = name[:-1]
elif name.endswith(':*'):
name = name[:-2]
ret = __salt__['cmd.run_all'](
_ctl_cmd('remove', name, conf_file, bin_env), runas=user
)