Merge "Add default kolla conf file for TripleO to build container images"
This commit is contained in:
commit
28b9c53882
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Added a default kolla conf file for the container image building command
|
||||
|
@ -19,6 +19,7 @@ import os
|
||||
import requests
|
||||
import shutil
|
||||
import six
|
||||
import sys
|
||||
import tempfile
|
||||
import yaml
|
||||
|
||||
@ -508,6 +509,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',
|
||||
@ -551,7 +556,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
|
||||
])
|
||||
|
||||
|
@ -86,6 +86,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",
|
||||
@ -103,12 +106,13 @@ class BuildImage(command.Command):
|
||||
"--kolla-config-file",
|
||||
dest="kolla_config_files",
|
||||
metavar='<config file>',
|
||||
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',
|
||||
|
Loading…
Reference in New Issue
Block a user