mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #995 from mattupstate/devel
Use `get_bin_path` properly for supervisorctl module
This commit is contained in:
commit
c69c3d6e18
1 changed files with 4 additions and 6 deletions
|
@ -19,10 +19,11 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
def _is_present(name):
|
||||
rc, out, err = _run('%s status' % _find_supervisorctl())
|
||||
def _is_present(name, supervisorctl):
|
||||
rc, out, err = _run('%s status' % supervisorctl)
|
||||
return name in out
|
||||
|
||||
|
||||
def _is_running(name, supervisorctl):
|
||||
rc, out, err = _run('%s status %s' % (supervisorctl, name))
|
||||
return 'RUNNING' in out
|
||||
|
@ -49,10 +50,7 @@ def main():
|
|||
|
||||
SUPERVISORCTL = module.get_bin_path('supervisorctl', True)
|
||||
|
||||
if SUPERVISORCTL is None:
|
||||
module.fail_json(msg='supervisorctl is not installed')
|
||||
|
||||
present = _is_present(name)
|
||||
present = _is_present(name, SUPERVISORCTL)
|
||||
|
||||
if state == 'present':
|
||||
if not present:
|
||||
|
|
Loading…
Reference in a new issue