From 04873c9da79a72df4f350906b3c7d855b9b12c28 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Thu, 11 Sep 2014 09:18:50 -0600 Subject: [PATCH] don't need to check venv, raise cmdexecutionerrors in virtualenv mod --- salt/modules/virtualenv_mod.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py index afd4064f62..2065243941 100644 --- a/salt/modules/virtualenv_mod.py +++ b/salt/modules/virtualenv_mod.py @@ -342,12 +342,10 @@ def get_resource_path(venv, package_or_requirement, resource_name): salt '*' virtualenv.get_resource_path /path/to/my/venv my_package my/resource.xml ''' - if not salt.utils.verify.safe_py_code(venv): - return '' if not salt.utils.verify.safe_py_code(package_or_requirement): - return '' + raise salt.exceptions.CommandExecutionError if not salt.utils.verify.safe_py_code(resource_name): - return '' + raise salt.exceptions.CommandExecutionError bin_path = os.path.join(venv, 'bin/python') if not os.path.exists(bin_path): @@ -366,12 +364,10 @@ def get_resource_content(venv, package_or_requirement, resource_name): salt '*' virtualenv.get_resource_content /path/to/my/venv my_package my/resource.xml ''' - if not salt.utils.verify.safe_py_code(venv): - return '' if not salt.utils.verify.safe_py_code(package_or_requirement): - return '' + raise salt.exceptions.CommandExecutionError if not salt.utils.verify.safe_py_code(resource_name): - return '' + raise salt.exceptions.CommandExecutionError bin_path = os.path.join(venv, 'bin/python') if not os.path.exists(bin_path):