From a0770d5da7f9b38766c4b5fefa5d16f9c66dee2e Mon Sep 17 00:00:00 2001 From: Jakub Vysoky Date: Tue, 22 Jan 2013 13:43:52 +0100 Subject: [PATCH] do not collide with builtin name ``list`` it was really just a fancier formatted status anyway --- salt/modules/supervisord.py | 6 +++--- salt/states/supervisord.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/modules/supervisord.py b/salt/modules/supervisord.py index 032ea2b3df..475c528dd8 100644 --- a/salt/modules/supervisord.py +++ b/salt/modules/supervisord.py @@ -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) diff --git a/salt/states/supervisord.py b/salt/states/supervisord.py index b9c11ef3d2..9f7cb5b7f0 100644 --- a/salt/states/supervisord.py +++ b/salt/states/supervisord.py @@ -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']: