Allow 'container image prepare' to support drivers

This updates the 'overcloud container image prepare' command
so that it sets the neutron_driver variable correctly. This
allows tripleo-common to detect if OVN or ODL drivers are in
used and prepares the resulting output files for container
images and parameters accordingly.

Previously you could only access this functionality if you
used the new ContainerImagePrepare workflow (requires Mistral).

Note: Bumps lower constraint for tripeo-common==9.5.0 to fix
the lower constaints job.

Change-Id: Icb5b20bfd98a704f3f33f739bc92f77550b52c26
Closes-bug: #1816663
(cherry picked from commit a2c4d07df6)
This commit is contained in:
Dan Prince 2019-02-19 15:20:41 -05:00 committed by Rabi Mishra
parent a48d496142
commit e89a0a689a
4 changed files with 12 additions and 6 deletions

View File

@ -146,7 +146,7 @@ testscenarios===0.4
testtools==2.2.0
tooz==1.58.0
traceback2==1.4.0
tripleo-common==9.1.0
tripleo-common==9.5.0
ujson==1.35
unittest2==1.1.0
vine==1.1.4

View File

@ -16,5 +16,5 @@ simplejson>=3.5.1 # MIT
six>=1.10.0 # MIT
osc-lib>=1.8.0 # Apache-2.0
websocket-client>=0.44.0 # LGPLv2+
tripleo-common>=9.1.0 # Apache-2.0
tripleo-common>=9.5.0 # Apache-2.0
cryptography>=2.1 # BSD/Apache-2.0

View File

@ -186,10 +186,13 @@ class TestContainerImagePrepare(TestPluginV1):
mock_get.side_effect = requests.exceptions.SSLError('ouch')
mock_bsf.return_value = set(['OS::TripleO::Services::AodhEvaluator'])
resource_registry = {'resource_registry': {
'OS::TripleO::Services::AodhEvaluator': aodh_file,
'OS::TripleO::Services::AodhApi': aodh_file
}}
resource_registry = {
'parameter_defaults': {
'NeutronMechanismDrivers': 'ovn'},
'resource_registry': {
'OS::TripleO::Services::AodhEvaluator': aodh_file,
'OS::TripleO::Services::AodhApi': aodh_file
}}
pmef.return_value = None, resource_registry
arglist = [
@ -255,6 +258,7 @@ class TestContainerImagePrepare(TestPluginV1):
'ceph_tag': 'mytag',
'ceph_image': 'mydaemon',
'tag': 'passed-ci',
'neutron_driver': 'ovn',
'ceph_namespace': 'myceph',
'name_prefix': 'os-'
},

View File

@ -415,6 +415,8 @@ class PrepareImageFiles(command.Command):
'name_suffix': parsed_args.suffix,
}
self.parse_set_values(mapping_args, parsed_args.set)
pd = env.get('parameter_defaults', {})
kolla_builder.set_neutron_driver(pd, mapping_args)
output_images_file = (parsed_args.output_images_file
or 'container_images.yaml')