diff --git a/releasenotes/notes/default-kolla-conf-9b5aaab1931f00a0.yaml b/releasenotes/notes/default-kolla-conf-9b5aaab1931f00a0.yaml new file mode 100644 index 000000000..124808236 --- /dev/null +++ b/releasenotes/notes/default-kolla-conf-9b5aaab1931f00a0.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added a default kolla conf file for the container image building command + diff --git a/tripleoclient/tests/v1/overcloud_image/test_container_image.py b/tripleoclient/tests/v1/overcloud_image/test_container_image.py index 4d294ffdc..a165e8fdc 100644 --- a/tripleoclient/tests/v1/overcloud_image/test_container_image.py +++ b/tripleoclient/tests/v1/overcloud_image/test_container_image.py @@ -18,6 +18,7 @@ import mock import os import shutil import six +import sys import tempfile import yaml @@ -241,6 +242,10 @@ class TestContainerImageBuild(TestPluginV1): self.cmd = container_image.BuildImage(self.app, None) self.cmd.app.stdout = six.StringIO() self.temp_dir = self.useFixture(fixtures.TempDir()).join() + # Default conf file + self.default_kolla_conf = os.path.join( + sys.prefix, 'share', 'tripleo-common', 'container-images', + 'tripleo_kolla_config_overrides.conf') @mock.patch('sys.exit') @mock.patch('tripleo_common.image.kolla_builder.KollaImageBuilder', @@ -284,7 +289,7 @@ class TestContainerImageBuild(TestPluginV1): mock_builder.assert_called_once_with([ '/tmp/foo.yaml', '/tmp/bar.yaml']) mock_builder.return_value.build_images.assert_called_once_with([ - '/tmp/kolla.conf', + self.default_kolla_conf, '/tmp/kolla.conf', path ]) diff --git a/tripleoclient/v1/container_image.py b/tripleoclient/v1/container_image.py index fc9f27e19..5d1bb2745 100644 --- a/tripleoclient/v1/container_image.py +++ b/tripleoclient/v1/container_image.py @@ -82,6 +82,9 @@ class BuildImage(command.Command): images.append(dep) def get_parser(self, prog_name): + default_kolla_conf = os.path.join( + sys.prefix, 'share', 'tripleo-common', 'container-images', + 'tripleo_kolla_config_overrides.conf') parser = super(BuildImage, self).get_parser(prog_name) parser.add_argument( "--config-file", @@ -99,12 +102,13 @@ class BuildImage(command.Command): "--kolla-config-file", dest="kolla_config_files", metavar='', - default=[], + default=[default_kolla_conf], action="append", required=True, help=_("Path to a Kolla config file to use. Multiple config files " "can be specified, with values in later files taking " - "precedence."), + "precedence. By default, tripleo kolla conf file {conf} " + "is added.").format(conf=default_kolla_conf), ) parser.add_argument( '--list-images',