From c6712b35a2583a4b59ece2b83db3f602a6384b1a Mon Sep 17 00:00:00 2001 From: Stoned Elipot Date: Wed, 22 May 2013 18:15:21 +0200 Subject: [PATCH] Allow virtualenv_command argument of the pip module to be a pathname --- packaging/pip | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packaging/pip b/packaging/pip index cc165568480..c01d5f865c5 100644 --- a/packaging/pip +++ b/packaging/pip @@ -65,8 +65,9 @@ options: virtualenv_command: version_aded: "1.1" description: - - The command to create the virtual environment with. For example - C(pyvenv), C(virtualenv), C(virtualenv2). + - The command or a pathname to the command to create the virtual + environment with. For example C(pyvenv), C(virtualenv), + C(virtualenv2), C(~/bin/virtualenv), C(/usr/local/bin/virtualenv). required: false default: virtualenv use_mirrors: @@ -193,7 +194,9 @@ def main(): if env: env = os.path.expanduser(env) - virtualenv = module.get_bin_path(virtualenv_command, True) + virtualenv = os.path.expanduser(virtualenv_command) + if os.path.basename(virtualenv) == virtualenv: + virtualenv = module.get_bin_path(virtualenv_command, True) if not os.path.exists(os.path.join(env, 'bin', 'activate')): if module.check_mode: module.exit_json(changed=True)