Browse Source

Fix paths to cdist executable

bugfix/in-script-import
Dennis Camera 2 years ago
parent
commit
0ee3fda94d
  1. 5
      cdist/integration.py
  2. 2
      cdist/test/__init__.py
  3. 4
      cdist/test/config/__init__.py

5
cdist/integration.py vendored

@ -54,13 +54,12 @@ _mydir = os.path.dirname(__file__)
def find_cdist_exec():
"""Search cdist executable starting from local lib directory.
Detect if ../scripts/cdist (from local lib direcotry) exists and
Detect if ../bin/cdist (from local lib directory) exists and
if it is executable. If not then try to find cdist exec path in
os.get_exec_path() entries. If no cdist path is found rasie
cdist.Error.
"""
cdist_path = os.path.abspath(os.path.join(_mydir, '..', 'scripts',
'cdist'))
cdist_path = os.path.abspath(os.path.join(_mydir, '..', 'bin', 'cdist'))
if os.access(cdist_path, os.X_OK):
return cdist_path
cdist_path = find_cdist_exec_in_path()

2
cdist/test/__init__.py vendored

@ -26,7 +26,7 @@ import tempfile
cdist_base_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../"))
cdist_exec_path = os.path.join(cdist_base_path, "scripts/cdist")
cdist_exec_path = os.path.join(cdist_base_path, "bin/cdist")
global_fixtures_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
"fixtures"))

4
cdist/test/config/__init__.py vendored

@ -202,7 +202,7 @@ class ConfigRunTestCase(test.CdistTestCase):
host_dir_name=self.hostdir,
# exec_path can not derivated from sys.argv in case of unittest
exec_path=os.path.abspath(os.path.join(
my_dir, '../../../scripts/cdist')),
my_dir, '../../../bin/cdist')),
initial_manifest=os.path.join(fixtures,
'manifest/dryrun_manifest'),
add_conf_dirs=[fixtures])
@ -219,7 +219,7 @@ class ConfigRunTestCase(test.CdistTestCase):
base_root_path=self.host_base_path,
host_dir_name=self.hostdir,
exec_path=os.path.abspath(os.path.join(
my_dir, '../../../scripts/cdist')),
my_dir, '../../../bin/cdist')),
initial_manifest=os.path.join(
fixtures, 'manifest/init-deps-resolver'),
add_conf_dirs=[fixtures])

Loading…
Cancel
Save