aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-06 06:16:46 +0000
committerGerrit Code Review <review@openstack.org>2016-11-06 06:16:46 +0000
commit31c2a255fc3bcc9a51b77c3b1f75ed59b10f9fbf (patch)
treea4ec8cc6fc156abb5630c9e0220838af19e5c900
parent5fc716a44e43478be8eae7949b34d45acbed0c8b (diff)
parent5ddba7892df71d23fefbf7116e8cfec11a2f41da (diff)
downloadkolla-31c2a255fc3bcc9a51b77c3b1f75ed59b10f9fbf.tar.gz
kolla-31c2a255fc3bcc9a51b77c3b1f75ed59b10f9fbf.zip
Merge "Fix plugin parsing for base images"
-rw-r--r--kolla/image/build.py2
-rw-r--r--kolla/tests/etc/default.conf5
-rw-r--r--kolla/tests/test_build.py18
3 files changed, 24 insertions, 1 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py
index d5b7e07db..0e2b87244 100644
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -832,7 +832,7 @@ class KollaWorker(object):
image.name)
image.source = process_source_installation(image, image.name)
for plugin in [match.group(0) for match in
- (re.search('{}-plugin-.+'.format(image.name),
+ (re.search('^{}-plugin-.+'.format(image.name),
section) for section in
self.conf.list_all_sections()) if match]:
try:
diff --git a/kolla/tests/etc/default.conf b/kolla/tests/etc/default.conf
index 214ca8841..545953e34 100644
--- a/kolla/tests/etc/default.conf
+++ b/kolla/tests/etc/default.conf
@@ -6,6 +6,11 @@ reference = master
location = https://git.openstack.org/openstack/networking-arista
type = git
+[neutron-base-plugin-neutron-fwaas]
+reference = master
+location = https://git.openstack.org/openstack/neutron-fwaas
+type = git
+
[profiles]
default = image-base
all = image-base,image-child
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index b0a46a988..980413468 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -195,6 +195,24 @@ class KollaWorkerTest(base.TestCase):
else:
self.fail('Can not find the expected neutron arista plugin')
+ def test_build_image_list_plugin_parsing(self):
+ """Ensure regex used to parse plugins adds them to the correct image"""
+ self.conf.set_override('install_type', 'source')
+
+ kolla = build.KollaWorker(self.conf)
+ kolla.setup_working_dir()
+ kolla.find_dockerfiles()
+ kolla.create_dockerfiles()
+ kolla.build_image_list()
+ for image in kolla.images:
+ if image.name == 'base':
+ self.assertEqual(len(image.plugins), 0,
+ 'base image should not have any plugins '
+ 'registered')
+ break
+ else:
+ self.fail('Expected to find the base image in this test')
+
def _get_matched_images(self, images):
return [image for image in images
if image.status == build.STATUS_MATCHED]