1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixes #5601 Do not append extra args when checking for pip command options

This commit is contained in:
James Tanner 2014-01-14 14:22:37 -05:00
parent 2e1d92c2ec
commit fbba0bb3fc

View file

@ -147,9 +147,8 @@ EXAMPLES = '''
def _get_cmd_options(module, cmd): def _get_cmd_options(module, cmd):
thiscmd = cmd + " --help" thiscmd = cmd + " --help"
rc, stdout, stderr = module.run_command(thiscmd) rc, stdout, stderr = module.run_command(thiscmd)
#import epdb; epdb.serve()
if rc != 0: if rc != 0:
module.fail_json(msg="Could not get --help output from %s" % virtualenv) module.fail_json(msg="Could not get output from %s: %s" % (thiscmd, stdout + stderr))
words = stdout.strip().split() words = stdout.strip().split()
cmd_options = [ x for x in words if x.startswith('--') ] cmd_options = [ x for x in words if x.startswith('--') ]
@ -322,7 +321,7 @@ def main():
is_package = is_vcs or is_tar or is_local_path # just a shortcut for bool is_package = is_vcs or is_tar or is_local_path # just a shortcut for bool
if cmd_opts is None: if cmd_opts is None:
cmd_opts = _get_cmd_options(module, cmd) cmd_opts = _get_cmd_options(module, '%s %s' % (pip, state_map[state]))
if not is_package and state != 'absent' and use_mirrors and '--use-mirrors' in cmd_opts: if not is_package and state != 'absent' and use_mirrors and '--use-mirrors' in cmd_opts:
cmd += ' --use-mirrors' cmd += ' --use-mirrors'