Browse Source

Merge "Use ResourceDefinitionCore methods for lbutils"

changes/95/200995/4
Jenkins 7 years ago committed by Gerrit Code Review
parent
commit
5b628d7c50
  1. 2
      heat/engine/rsrc_defn.py
  2. 4
      heat/scaling/lbutils.py
  3. 13
      heat/tests/test_instance_group.py

2
heat/engine/rsrc_defn.py

@ -286,7 +286,7 @@ class ResourceDefinitionCore(object):
data = {
'classname': type(self).__name__,
'name': repr(self.name),
'type': repr(self.type),
'type': repr(self.resource_type),
'args': ', '.join(arg_repr(n) for n in args)
}
return '%(classname)s(%(name)s, %(type)s, %(args)s)' % data

4
heat/scaling/lbutils.py

@ -45,7 +45,7 @@ def reload_loadbalancers(group, load_balancers, exclude=None):
lb.name,
lb.type(),
properties=props,
metadata=lb.t.get('Metadata'),
deletion_policy=lb.t.get('DeletionPolicy'))
metadata=lb.t.metadata(),
deletion_policy=lb.t.deletion_policy())
scheduler.TaskRunner(lb.update, lb_defn)()

13
heat/tests/test_instance_group.py

@ -216,7 +216,10 @@ class LoadbalancerReloadTest(common.HeatTestCase):
'Listeners': [{'InstancePort': u'80',
'LoadBalancerPort': u'80',
'Protocol': 'HTTP'}],
'AvailabilityZones': ['nova']})
'AvailabilityZones': ['nova']},
metadata={},
deletion_policy='Delete'
)
group._lb_reload()
mock_members.assert_called_once_with(group, exclude=[])
@ -249,7 +252,9 @@ class LoadbalancerReloadTest(common.HeatTestCase):
'ElasticLoadBalancer',
'OS::Neutron::LoadBalancer',
{'protocol_port': 8080,
'members': ['aaaa', 'bbb']})
'members': ['aaaa', 'bbb']},
metadata={},
deletion_policy='Delete')
group._lb_reload()
mock_members.assert_called_once_with(group, exclude=[])
@ -302,7 +307,9 @@ class LoadbalancerReloadTest(common.HeatTestCase):
u'Listeners': [{u'InstancePort': u'80',
u'LoadBalancerPort': u'80',
u'Protocol': u'HTTP'}],
u'AvailabilityZones': ['abc', 'xyz']}}
u'AvailabilityZones': ['abc', 'xyz']},
u'DeletionPolicy': 'Delete',
u'Metadata': {}}
stack = utils.parse_stack(t, params=inline_templates.as_params)
lb = stack['ElasticLoadBalancer']

Loading…
Cancel
Save