aboutsummaryrefslogtreecommitdiff
path: root/kolla/cmd
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-01-07 06:07:52 +0000
committerGerrit Code Review <review@openstack.org>2016-01-07 06:07:52 +0000
commitc1fca2721187bf17b21f1608e6d57b4663fd6ba5 (patch)
tree572ddd070b76df2b5bc33ca878b3283a8326e549 /kolla/cmd
parent6293c8362e917c9ae1b56de3053fbf6d988d2c73 (diff)
parentea5fa4e248c93c26b4c0d576035f5e66d1f671a1 (diff)
downloadkolla-c1fca2721187bf17b21f1608e6d57b4663fd6ba5.tar.gz
kolla-c1fca2721187bf17b21f1608e6d57b4663fd6ba5.zip
Merge "Fix broken local and global building"
Diffstat (limited to 'kolla/cmd')
-rwxr-xr-xkolla/cmd/build.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 20fc38554..96a7a5e5d 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -38,6 +38,15 @@ from requests.exceptions import ConnectionError
import six
from six.moves import range
+PROJECT_ROOT = os.path.abspath(os.path.join(
+ os.path.dirname(os.path.realpath(__file__)), '../..'))
+
+# NOTE(SamYaple): Update the search patch to prefer PROJECT_ROOT as the source
+# of packages to import if we are using local tools/build.py
+# instead of pip installed kolla-build tool
+if PROJECT_ROOT not in sys.path:
+ sys.path.insert(0, PROJECT_ROOT)
+
from kolla.common import config as common_config
from kolla import version
@@ -47,9 +56,6 @@ LOG.setLevel(logging.INFO)
signal.signal(signal.SIGINT, signal.SIG_DFL)
-PROJECT_ROOT = os.path.abspath(os.path.join(
- os.path.dirname(os.path.realpath(__file__)), '../..'))
-
class KollaDirNotFoundException(Exception):
pass
@@ -330,7 +336,10 @@ class KollaWorker(object):
for path in possible_paths:
image_path = os.path.join(path, 'docker')
- if os.path.exists(image_path):
+ # NOTE(SamYaple): We explicty check for the base folder to ensure
+ # this is the correct path
+ # TODO(SamYaple): Improve this to make this safer
+ if os.path.exists(os.path.join(image_path, 'base')):
LOG.info('Found the docker image folder at %s', image_path)
return image_path
else: