Allow virtualenv_command argument of the pip module to be a pathname
This commit is contained in:
parent
3926f76644
commit
c6712b35a2
1 changed files with 6 additions and 3 deletions
|
@ -65,8 +65,9 @@ options:
|
||||||
virtualenv_command:
|
virtualenv_command:
|
||||||
version_aded: "1.1"
|
version_aded: "1.1"
|
||||||
description:
|
description:
|
||||||
- The command to create the virtual environment with. For example
|
- The command or a pathname to the command to create the virtual
|
||||||
C(pyvenv), C(virtualenv), C(virtualenv2).
|
environment with. For example C(pyvenv), C(virtualenv),
|
||||||
|
C(virtualenv2), C(~/bin/virtualenv), C(/usr/local/bin/virtualenv).
|
||||||
required: false
|
required: false
|
||||||
default: virtualenv
|
default: virtualenv
|
||||||
use_mirrors:
|
use_mirrors:
|
||||||
|
@ -193,6 +194,8 @@ def main():
|
||||||
|
|
||||||
if env:
|
if env:
|
||||||
env = os.path.expanduser(env)
|
env = os.path.expanduser(env)
|
||||||
|
virtualenv = os.path.expanduser(virtualenv_command)
|
||||||
|
if os.path.basename(virtualenv) == virtualenv:
|
||||||
virtualenv = module.get_bin_path(virtualenv_command, True)
|
virtualenv = module.get_bin_path(virtualenv_command, True)
|
||||||
if not os.path.exists(os.path.join(env, 'bin', 'activate')):
|
if not os.path.exists(os.path.join(env, 'bin', 'activate')):
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
|
|
Loading…
Reference in a new issue