mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add option required=(True|False) to get_bin_path and update modules
Added required as optional argument to get_bin_path(). It defaults to false. Updated following modules to use required=True when calling get_bin_path(): apt_repository, easy_install, group, pip, supervisorctl, and user. Also removed _find_supervisorctl() from supervisorctl module and updated _is_running() to not need it.
This commit is contained in:
@@ -77,9 +77,7 @@ def main():
|
||||
env = module.params['virtualenv']
|
||||
|
||||
if env:
|
||||
virtualenv = module.get_bin_path('virtualenv')
|
||||
if virtualenv is None:
|
||||
module.fail_json(msg='virtualenv is not installed')
|
||||
virtualenv = module.get_bin_path('virtualenv', True)
|
||||
|
||||
rc_venv, out_venv, err_venv = _ensure_virtualenv(module, env, virtualenv)
|
||||
|
||||
@@ -87,9 +85,7 @@ def main():
|
||||
out += out_venv
|
||||
err += err_venv
|
||||
|
||||
pip = module.get_bin_path('pip', ['%s/bin' % env])
|
||||
if pip is None:
|
||||
module.fail_json(msg='pip is not installed')
|
||||
pip = module.get_bin_path('pip', True, ['%s/bin' % env])
|
||||
|
||||
state = module.params['state']
|
||||
name = module.params['name']
|
||||
|
||||
Reference in New Issue
Block a user