From 88692e9e4b041be1aa99802d5d1d379070f6dfb0 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 28 Nov 2013 10:50:15 +0000 Subject: [PATCH] Only check for the execution bits if a value was actually passed. --- salt/modules/virtualenv_mod.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py index e762e5370a..ebce46c689 100644 --- a/salt/modules/virtualenv_mod.py +++ b/salt/modules/virtualenv_mod.py @@ -161,11 +161,13 @@ def create(path, ) else: cmd.append('--distribute') - if not os.access(python, os.X_OK): - raise salt.exceptions.CommandExecutionError( - 'Requested python ({0}) does not appear executable.'.format(python) - ) + if python is not None and python.strip() != '': + if not os.access(python, os.X_OK): + raise salt.exceptions.CommandExecutionError( + 'Requested python ({0}) does not appear ' + 'executable.'.format(python) + ) cmd.append('--python={0}'.format(python)) if extra_search_dir is not None: if isinstance(extra_search_dir, basestring) and \