mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix utils path and is_windows imports for tests
This commit is contained in:
parent
67e45ecd23
commit
be48a6cb46
4 changed files with 8 additions and 6 deletions
|
@ -744,7 +744,7 @@ class TestDaemon(object):
|
|||
try:
|
||||
real_prefix = sys.real_prefix
|
||||
# The above attribute exists, this is a virtualenv
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.platform.is_windows():
|
||||
virtualenv_binary = os.path.join(real_prefix, 'Scripts', 'virtualenv.exe')
|
||||
else:
|
||||
# We need to remove the virtualenv from PATH or we'll get the virtualenv binary
|
||||
|
@ -756,7 +756,7 @@ class TestDaemon(object):
|
|||
if item.startswith(sys.base_prefix):
|
||||
path_items.remove(item)
|
||||
os.environ['PATH'] = os.pathsep.join(path_items)
|
||||
virtualenv_binary = salt.utils.which('virtualenv')
|
||||
virtualenv_binary = salt.utils.path.which('virtualenv')
|
||||
if path is not None:
|
||||
# Restore previous environ PATH
|
||||
os.environ['PATH'] = path
|
||||
|
|
|
@ -172,7 +172,7 @@ def get_python_executable():
|
|||
to create virtualenvs on windows.
|
||||
'''
|
||||
try:
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.platform.is_windows():
|
||||
python_binary = os.path.join(sys.real_prefix, os.path.basename(sys.executable))
|
||||
else:
|
||||
python_binary = os.path.join(sys.real_prefix, 'bin', os.path.basename(sys.executable))
|
||||
|
|
|
@ -57,7 +57,7 @@ class PipModuleTest(ModuleCase):
|
|||
virtualenv because it will fail otherwise
|
||||
'''
|
||||
try:
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.platform.is_windows():
|
||||
python = os.path.join(sys.real_prefix, os.path.basename(sys.executable))
|
||||
else:
|
||||
python_binary_names = [
|
||||
|
|
|
@ -39,6 +39,8 @@ from tests.integration import (
|
|||
)
|
||||
import salt.config
|
||||
import salt.log.setup as salt_log_setup
|
||||
import salt.utils.path
|
||||
import salt.utils.platform
|
||||
from salt.utils.immutabletypes import freeze
|
||||
from salt.utils.verify import verify_env
|
||||
|
||||
|
@ -425,7 +427,7 @@ class MultimasterTestDaemon(TestDaemon):
|
|||
try:
|
||||
real_prefix = sys.real_prefix
|
||||
# The above attribute exists, this is a virtualenv
|
||||
if salt.utils.is_windows():
|
||||
if salt.utils.platform.is_windows():
|
||||
virtualenv_binary = os.path.join(real_prefix, 'Scripts', 'virtualenv.exe')
|
||||
else:
|
||||
# We need to remove the virtualenv from PATH or we'll get the virtualenv binary
|
||||
|
@ -437,7 +439,7 @@ class MultimasterTestDaemon(TestDaemon):
|
|||
if item.startswith(sys.base_prefix):
|
||||
path_items.remove(item)
|
||||
os.environ['PATH'] = os.pathsep.join(path_items)
|
||||
virtualenv_binary = salt.utils.which('virtualenv')
|
||||
virtualenv_binary = salt.utils.path.which('virtualenv')
|
||||
if path is not None:
|
||||
# Restore previous environ PATH
|
||||
os.environ['PATH'] = path
|
||||
|
|
Loading…
Add table
Reference in a new issue