mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
do not collide with builtin name `list
`
it was really just a fancier formatted status anyway
This commit is contained in:
parent
8bc3504547
commit
a0770d5da7
@ -102,7 +102,7 @@ def update(user=None):
|
||||
ret = __salt__['cmd.run_all'](_ctl_cmd('update', None), runas=user)
|
||||
return _get_return(ret)
|
||||
|
||||
def list(name=None, user=None):
|
||||
def status(name=None, user=None):
|
||||
'''
|
||||
List programms and its state
|
||||
|
||||
@ -110,7 +110,7 @@ def list(name=None, user=None):
|
||||
salt '*' supervisord.list
|
||||
'''
|
||||
all_process = {}
|
||||
for line in status(name, user).splitlines():
|
||||
for line in status_raw(name, user).splitlines():
|
||||
if len(line.split()) > 2:
|
||||
process, state, reason = line.split(None, 2)
|
||||
else:
|
||||
@ -118,7 +118,7 @@ def list(name=None, user=None):
|
||||
all_process[process] = {'state': state, 'reason': reason}
|
||||
return all_process
|
||||
|
||||
def status(name=None, user=None):
|
||||
def status_raw(name=None, user=None):
|
||||
ret = __salt__['cmd.run_all'](_ctl_cmd('status', name), runas=user)
|
||||
return _get_return(ret)
|
||||
|
||||
|
@ -54,7 +54,7 @@ def running(name,
|
||||
'''
|
||||
ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
|
||||
|
||||
all_processes = __salt__['supervisord.list'](user=runas)
|
||||
all_processes = __salt__['supervisord.status'](user=runas)
|
||||
needs_update = name not in all_processes
|
||||
|
||||
if __opts__['test']:
|
||||
|
Loading…
Reference in New Issue
Block a user