diff --git a/heat/engine/rsrc_defn.py b/heat/engine/rsrc_defn.py index ec703dfedf..6a609ec342 100644 --- a/heat/engine/rsrc_defn.py +++ b/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 diff --git a/heat/scaling/lbutils.py b/heat/scaling/lbutils.py index 58006bb7e0..62bd34f78e 100644 --- a/heat/scaling/lbutils.py +++ b/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)() diff --git a/heat/tests/test_instance_group.py b/heat/tests/test_instance_group.py index 87109660fc..81099ad931 100644 --- a/heat/tests/test_instance_group.py +++ b/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']