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:
@@ -50,16 +50,14 @@ def main():
|
||||
|
||||
name = module.params['name']
|
||||
env = module.params['virtualenv']
|
||||
easy_install = module.get_bin_path('easy_install', ['%s/bin' % env])
|
||||
if easy_install is None:
|
||||
module.fail_json(msg='easy_install is not installed')
|
||||
easy_install = module.get_bin_path('easy_install', True, ['%s/bin' % env])
|
||||
|
||||
rc = 0
|
||||
err = ''
|
||||
out = ''
|
||||
|
||||
if env:
|
||||
virtualenv = module.get_bin_path('virtualenv')
|
||||
virtualenv = module.get_bin_path('virtualenv', True)
|
||||
if virtualenv is None:
|
||||
module.fail_json(msg='virtualenv is not installed')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user