Commit 5af60b32 authored by Vincent Pelletier's avatar Vincent Pelletier

caucase.test: Drop dependency on deprecated distutils module.

parent 4966706d
......@@ -31,9 +31,6 @@ except ImportError: # pragma: no cover
# BBB: py2.7
from Cookie import SimpleCookie
import datetime
# pylint: disable=no-name-in-module, import-error
from distutils.spawn import find_executable
# pylint: enable=no-name-in-module, import-error
import errno
import functools
import glob
......@@ -3839,12 +3836,19 @@ if getattr(CaucaseTest, 'assertItemsEqual', None) is None: # pragma: no cover
CaucaseTest.assertItemsEqual = CaucaseTest.assertCountEqual
# pylint: enable=no-member
_caucase_sh_path = find_executable(
'caucase.sh',
path=os.path.join(
os.path.dirname(__file__), os.path.pardir, 'shell',
) + os.path.pathsep + os.getenv('PATH', ''),
)
def _findCaucaseSh():
file_directory = os.path.dirname(__file__)
caucase_sh = 'caucase.sh'
for path in [
file_directory,
os.path.join(file_directory, os.path.pardir, 'shell'),
] + os.getenv('PATH', '').split(os.path.pathsep): # pragma: no cover
result = os.path.join(path, caucase_sh)
if os.path.isfile(result):
return result
return None # pragma: no cover
_caucase_sh_path = _findCaucaseSh()
def _runCaucaseSh(*args):
command = (_caucase_sh_path, ) + args
environ = os.environ.copy()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment