don't need to check venv, raise cmdexecutionerrors in virtualenv mod

This commit is contained in:
Thomas S Hatch 2014-09-11 09:18:50 -06:00
parent c558748b5f
commit 04873c9da7

View File

@ -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):