From f0bad0df6722d13463e039e0c3b66b9f925e81b0 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Wed, 7 Mar 2018 11:02:11 -0700 Subject: [PATCH] Make container_images_file required When doing a containerized undercloud deployment, it is required to pass in a file containing the containers to use. Previously there was a default value meaning if you didn't pass in the file it would start but fail during the deployment because the containers were not defined. This parameter is required until we come up with a solution to automatically generate this file during the deployment. Change-Id: I2a5694f3dd623672c2841ccfdcf1f6325509d806 Partial-Bug: #1754067 --- ...ntainer-images-file-required-ff11154429796729.yaml | 6 ++++++ tripleoclient/tests/v1/undercloud/test_undercloud.py | 11 +++++++++-- tripleoclient/v1/undercloud_config.py | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/container-images-file-required-ff11154429796729.yaml diff --git a/releasenotes/notes/container-images-file-required-ff11154429796729.yaml b/releasenotes/notes/container-images-file-required-ff11154429796729.yaml new file mode 100644 index 000000000..95e70f8df --- /dev/null +++ b/releasenotes/notes/container-images-file-required-ff11154429796729.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + When using containerized undercloud installation with `openstack undercloud + install --use-heat`, the container_images_file is a required configuration + parmeter. diff --git a/tripleoclient/tests/v1/undercloud/test_undercloud.py b/tripleoclient/tests/v1/undercloud/test_undercloud.py index 6debbd0d2..1a9115f9d 100644 --- a/tripleoclient/tests/v1/undercloud/test_undercloud.py +++ b/tripleoclient/tests/v1/undercloud/test_undercloud.py @@ -15,6 +15,9 @@ import mock +from oslo_config import cfg +from oslo_config import fixture as oslo_fixture + from tripleoclient.tests.v1.test_plugin import TestPluginV1 # Load the plugin init module for the plugin list and show commands @@ -32,6 +35,8 @@ class TestUndercloudInstall(TestPluginV1): def setUp(self): super(TestUndercloudInstall, self).setUp() + conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) + conf.config(container_images_file='/home/stack/foo.yaml') # Get the command object to test self.cmd = undercloud.InstallUndercloud(self.app, None) @@ -59,7 +64,7 @@ class TestUndercloudInstall(TestPluginV1): ['sudo', 'openstack', 'undercloud', 'deploy', '--local-ip=192.168.24.1', '--templates=/usr/share/openstack-tripleo-heat-templates/', - '--heat-native', '-e', + '--heat-native', '-e', '/home/stack/foo.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'services-docker/ironic.yaml', '-e', @@ -82,6 +87,8 @@ class TestUndercloudUpgrade(TestPluginV1): def setUp(self): super(TestUndercloudUpgrade, self).setUp() + conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) + conf.config(container_images_file='/home/stack/foo.yaml') # Get the command object to test self.cmd = undercloud.UpgradeUndercloud(self.app, None) @@ -121,7 +128,7 @@ class TestUndercloudUpgrade(TestPluginV1): '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'major-upgrade-composable-steps-docker.yaml', - '--heat-native', '-e', + '--heat-native', '-e', '/home/stack/foo.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' 'services-docker/ironic.yaml', '-e', diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index a201f9dc4..804057eb7 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -349,8 +349,9 @@ _opts = [ default='', help=('URL for the heat container image to use.') ), + # NOTE(aschultz): LP#1754067 - required until we can do this automatically cfg.StrOpt('container_images_file', - default='', + required=True, help=('Container yaml file with all available images in the' 'registry') ),