From 477fc18bd0febb2d53c0c5053ccff76ae1589d25 Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Fri, 15 Jan 2016 15:48:28 +0000 Subject: Fix image plugin functionality for oslo.config The new oslo.config style parsing for kolla-build.conf stopped plugins from working. This patch fixes it and adds a unit test. Co-Authored-By: Jeffrey Zhang Closes-Bug: 1534556 Change-Id: I135797c733ae0cae040a009c364073769b19e4eb --- kolla/tests/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kolla/tests/base.py') diff --git a/kolla/tests/base.py b/kolla/tests/base.py index e08adc39b..0ac1467cc 100644 --- a/kolla/tests/base.py +++ b/kolla/tests/base.py @@ -11,6 +11,9 @@ # limitations under the License. import os + +import fixtures +import mock from oslo_config import cfg from oslotest import base as oslotest_base @@ -30,6 +33,11 @@ class TestCase(oslotest_base.BaseTestCase): default_config_files = self.get_default_config_files() common_config.parse(self.conf, [], default_config_files=default_config_files) + # NOTE(jeffrey4l): mock the _get_image_dir method to return a fake + # docker images dir + self.useFixture(fixtures.MockPatch( + 'kolla.cmd.build.KollaWorker._get_images_dir', + mock.Mock(return_value=os.path.join(TESTS_ROOT, 'docker')))) def get_default_config_files(self): if self.config_file: -- cgit v1.2.3