Merge "Add default kolla conf file for TripleO to build container images"
This commit is contained in:
commit
28b9c53882
releasenotes/notes
tripleoclient
@ -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 requests
|
||||||
import shutil
|
import shutil
|
||||||
import six
|
import six
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
@ -508,6 +509,10 @@ class TestContainerImageBuild(TestPluginV1):
|
|||||||
self.cmd = container_image.BuildImage(self.app, None)
|
self.cmd = container_image.BuildImage(self.app, None)
|
||||||
self.cmd.app.stdout = six.StringIO()
|
self.cmd.app.stdout = six.StringIO()
|
||||||
self.temp_dir = self.useFixture(fixtures.TempDir()).join()
|
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('sys.exit')
|
||||||
@mock.patch('tripleo_common.image.kolla_builder.KollaImageBuilder',
|
@mock.patch('tripleo_common.image.kolla_builder.KollaImageBuilder',
|
||||||
@ -551,7 +556,7 @@ class TestContainerImageBuild(TestPluginV1):
|
|||||||
mock_builder.assert_called_once_with([
|
mock_builder.assert_called_once_with([
|
||||||
'/tmp/foo.yaml', '/tmp/bar.yaml'])
|
'/tmp/foo.yaml', '/tmp/bar.yaml'])
|
||||||
mock_builder.return_value.build_images.assert_called_once_with([
|
mock_builder.return_value.build_images.assert_called_once_with([
|
||||||
'/tmp/kolla.conf',
|
self.default_kolla_conf, '/tmp/kolla.conf',
|
||||||
path
|
path
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -86,6 +86,9 @@ class BuildImage(command.Command):
|
|||||||
images.append(dep)
|
images.append(dep)
|
||||||
|
|
||||||
def get_parser(self, prog_name):
|
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 = super(BuildImage, self).get_parser(prog_name)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--config-file",
|
"--config-file",
|
||||||
@ -103,12 +106,13 @@ class BuildImage(command.Command):
|
|||||||
"--kolla-config-file",
|
"--kolla-config-file",
|
||||||
dest="kolla_config_files",
|
dest="kolla_config_files",
|
||||||
metavar='<config file>',
|
metavar='<config file>',
|
||||||
default=[],
|
default=[default_kolla_conf],
|
||||||
action="append",
|
action="append",
|
||||||
required=True,
|
required=True,
|
||||||
help=_("Path to a Kolla config file to use. Multiple config files "
|
help=_("Path to a Kolla config file to use. Multiple config files "
|
||||||
"can be specified, with values in later files taking "
|
"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(
|
parser.add_argument(
|
||||||
'--list-images',
|
'--list-images',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user