mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add windows support to _verify_virtualenv
function in salt.modules.virtualenv_mod
This commit is contained in:
parent
3a774bd92d
commit
4098a29c8e
1 changed files with 6 additions and 4 deletions
|
@ -501,11 +501,13 @@ def _verify_safe_py_code(*args):
|
|||
|
||||
|
||||
def _verify_virtualenv(venv_path):
|
||||
bin_path = os.path.join(venv_path, "bin/python")
|
||||
if salt.utils.platform.is_windows():
|
||||
bin_path = os.path.join(venv_path, "Scripts", "python.exe")
|
||||
else:
|
||||
bin_path = os.path.join(venv_path, "bin", "python")
|
||||
|
||||
if not os.path.exists(bin_path):
|
||||
raise CommandExecutionError(
|
||||
"Path '{}' does not appear to be a virtualenv: bin/python not found.".format(
|
||||
venv_path
|
||||
)
|
||||
f"Path '{venv_path}' does not appear to be a virtualenv: '{bin_path}' not found."
|
||||
)
|
||||
return bin_path
|
||||
|
|
Loading…
Add table
Reference in a new issue