Skip to content

Commit

Permalink
fix utils path and is_windows imports for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch3LL committed Dec 23, 2019
1 parent 67e45ec commit be48a6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def transplant_configs(cls, transport='zeromq'):
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
Expand All @@ -756,7 +756,7 @@ def transplant_configs(cls, transport='zeromq'):
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/modules/test_pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _create_virtualenv(self, path):
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 = [
Expand Down
6 changes: 4 additions & 2 deletions tests/multimaster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
)
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

Expand Down Expand Up @@ -425,7 +427,7 @@ def transplant_configs(cls, transport='zeromq'):
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
Expand All @@ -437,7 +439,7 @@ def transplant_configs(cls, transport='zeromq'):
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
Expand Down

0 comments on commit be48a6c

Please sign in to comment.