Add support for zesty cloud-init by setting product_name
Change-Id: Ida224fcd2840a63c452885081d488c6da425c4b7
This commit is contained in:
parent
701cc86209
commit
f8a34c5f63
|
@ -160,6 +160,7 @@ class LXDContainerConfig(object):
|
|||
|
||||
# Set the container to autostart when the host reboots
|
||||
config['boot.autostart'] = 'True'
|
||||
config['environment.product_name'] = 'OpenStack Nova'
|
||||
|
||||
# Determine if we require a nested container
|
||||
flavor = instance.flavor
|
||||
|
|
|
@ -87,7 +87,10 @@ class LXDTestContainerConfig(test.NoDBTestCase):
|
|||
config = {}
|
||||
container_config = self.config.config_instance_options(config,
|
||||
instance)
|
||||
self.assertEqual({'boot.autostart': 'True'}, container_config)
|
||||
self.assertEqual(
|
||||
{'boot.autostart': 'True',
|
||||
'environment.product_name': 'OpenStack Nova'},
|
||||
container_config)
|
||||
|
||||
def test_create_container_source(self):
|
||||
instance = stubs._fake_instance()
|
||||
|
@ -125,6 +128,7 @@ class LXDTestContainerConfig(test.NoDBTestCase):
|
|||
instance.flavor.extra_specs = {'lxd:nested_allowed': True}
|
||||
config = self.config.config_instance_options({}, instance)
|
||||
self.assertEqual({'security.nesting': 'True',
|
||||
'environment.product_name': 'OpenStack Nova',
|
||||
'boot.autostart': 'True'}, config)
|
||||
|
||||
def test_container_privileged_container(self):
|
||||
|
@ -132,6 +136,7 @@ class LXDTestContainerConfig(test.NoDBTestCase):
|
|||
instance.flavor.extra_specs = {'lxd:privileged_allowed': True}
|
||||
config = self.config.config_instance_options({}, instance)
|
||||
self.assertEqual({'security.privileged': 'True',
|
||||
'environment.product_name': 'OpenStack Nova',
|
||||
'boot.autostart': 'True'}, config)
|
||||
|
||||
@mock.patch.object(session.LXDAPISession, 'get_host_extensions',
|
||||
|
@ -141,6 +146,7 @@ class LXDTestContainerConfig(test.NoDBTestCase):
|
|||
instance.flavor.extra_specs = {'lxd:isolated': True}
|
||||
config = self.config.config_instance_options({}, instance)
|
||||
self.assertEqual({'security.idmap.isolated': 'True',
|
||||
'environment.product_name': 'OpenStack Nova',
|
||||
'boot.autostart': 'True'}, config)
|
||||
|
||||
@mock.patch.object(session.LXDAPISession, 'get_host_extensions',
|
||||
|
|
Loading…
Reference in New Issue