Substitude class attribute 'parameters' dict to an easier to read individual class attributes.

class FloatingIPFixture(heat.HeatStackFixture):
[...]
parameters = {'floating_network': CONF.tobiko.neutron.floating_network,
                  'image': CONF.tobiko.nova.image,
                  'flavor': CONF.tobiko.nova.flavor}
-->

class FloatingIPFixture(heat.HeatStackFixture):
[...]
    floating_network = CONF.tobiko.neutron.floating_network
    image =  CONF.tobiko.nova.image,
    flavor = CONF.tobiko.nova.flavor

Change-Id: Ia3f3d6cb21de941426fedb936541d89d2923131d
This commit is contained in:
pkomarov 2019-04-08 00:49:34 +03:00 committed by Federico Ressi
parent 68e12ff86d
commit fab88225ab
3 changed files with 14 additions and 8 deletions

View File

@ -109,6 +109,14 @@ class HeatStackFixture(tobiko.SharedFixture):
if self._parameters: if self._parameters:
self.parameters.update(self._parameters) self.parameters.update(self._parameters)
# Add template's missing stack parameters
if 'parameters' in self.template.template:
for name in self.template.template['parameters']:
if name not in self.parameters:
value = getattr(self, name, None)
if value is not None:
self.parameters[name] = value
def setup_client(self): def setup_client(self):
client_fixture = self.client_fixture client_fixture = self.client_fixture
if client_fixture: if client_fixture:

View File

@ -34,9 +34,7 @@ def heat_template_file(template_file):
class InternalNetworkFixture(heat.HeatStackFixture): class InternalNetworkFixture(heat.HeatStackFixture):
template = heat_template_file('internal_network.yaml') template = heat_template_file('internal_network.yaml')
parameters = { floating_network = CONF.tobiko.neutron.floating_network
'floating_network': CONF.tobiko.neutron.floating_network,
}
class SecurityGroupsFixture(heat.HeatStackFixture): class SecurityGroupsFixture(heat.HeatStackFixture):

View File

@ -26,9 +26,9 @@ CONF = config.CONF
class FloatingIPFixture(heat.HeatStackFixture): class FloatingIPFixture(heat.HeatStackFixture):
template = base.heat_template_file('floating_ip.yaml') template = base.heat_template_file('floating_ip.yaml')
parameters = {'floating_network': CONF.tobiko.neutron.floating_network, floating_network = CONF.tobiko.neutron.floating_network
'image': CONF.tobiko.nova.image, image = CONF.tobiko.nova.image
'flavor': CONF.tobiko.nova.flavor} flavor = CONF.tobiko.nova.flavor
internal_network_fixture = base.InternalNetworkFixture internal_network_fixture = base.InternalNetworkFixture
internal_network = None internal_network = None
@ -43,11 +43,11 @@ class FloatingIPFixture(heat.HeatStackFixture):
class FloatingIPWithPortSecurityFixture(FloatingIPFixture): class FloatingIPWithPortSecurityFixture(FloatingIPFixture):
parameters = {'port_security_enabled': True} port_security_enabled = True
class FloatingIPWithSecurityGroupFixture(FloatingIPFixture): class FloatingIPWithSecurityGroupFixture(FloatingIPFixture):
parameters = {'port_security_enabled': True} port_security_enabled = True
security_groups_fixture = base.SecurityGroupsFixture security_groups_fixture = base.SecurityGroupsFixture
security_groups = None security_groups = None