diff --git a/heat/engine/resources/openstack/heat/autoscaling_group.py b/heat/engine/resources/openstack/heat/autoscaling_group.py index e288fe20f7..ed48bebf3f 100644 --- a/heat/engine/resources/openstack/heat/autoscaling_group.py +++ b/heat/engine/resources/openstack/heat/autoscaling_group.py @@ -23,7 +23,6 @@ from heat.engine import constraints from heat.engine.hot import template from heat.engine import output from heat.engine import properties -from heat.engine import resource from heat.engine.resources.aws.autoscaling import autoscaling_group as aws_asg from heat.engine import rsrc_defn from heat.engine import support @@ -208,9 +207,6 @@ class AutoScalingResourceGroup(aws_asg.AutoScalingGroup): self)._create_template(num_instances, num_replace, template_version=template_version) - def get_reference_id(self): - return resource.Resource.get_reference_id(self) - def _attribute_output_name(self, *attr_path): return ', '.join(six.text_type(a) for a in attr_path) diff --git a/heat/engine/resources/openstack/heat/instance_group.py b/heat/engine/resources/openstack/heat/instance_group.py index 103737d440..9ef901cb0c 100644 --- a/heat/engine/resources/openstack/heat/instance_group.py +++ b/heat/engine/resources/openstack/heat/instance_group.py @@ -422,9 +422,6 @@ class InstanceGroup(stack_resource.StackResource): lbs = [self.stack[name] for name in lb_names] lbutils.reconfigure_loadbalancers(lbs, id_list) - def get_reference_id(self): - return self.physical_resource_name_or_FnGetRefId() - def _group_data(self, refresh=False): """Return a cached GroupInspector object for the nested stack.""" if refresh or getattr(self, '_group_inspector', None) is None: diff --git a/heat/tests/openstack/heat/test_instance_group.py b/heat/tests/openstack/heat/test_instance_group.py index c13214c8e5..858c1488c3 100644 --- a/heat/tests/openstack/heat/test_instance_group.py +++ b/heat/tests/openstack/heat/test_instance_group.py @@ -18,7 +18,6 @@ import six from heat.common import exception from heat.common import grouputils -from heat.common import short_id from heat.common import template_format from heat.engine.clients.os import neutron from heat.engine import resource @@ -173,12 +172,9 @@ class TestInstanceGroup(common.HeatTestCase): def test_instance_group_refid_rsrc_name(self): self.instance_group.id = '123' - self.instance_group.uuid = '9bfb9456-3fe8-41f4-b318-9dba18eeef74' self.instance_group.action = 'CREATE' - expected = '%s-%s-%s' % (self.instance_group.stack.name, - self.instance_group.name, - short_id.get_id(self.instance_group.uuid)) + expected = self.instance_group.name self.assertEqual(expected, self.instance_group.FnGetRefId()) def test_instance_group_refid_rsrc_id(self): diff --git a/releasenotes/notes/fix-autoscalinggroup-reference-id-caf8b80c9288ad0f.yaml b/releasenotes/notes/fix-autoscalinggroup-reference-id-caf8b80c9288ad0f.yaml index 333c42ad6a..1021aa5283 100644 --- a/releasenotes/notes/fix-autoscalinggroup-reference-id-caf8b80c9288ad0f.yaml +++ b/releasenotes/notes/fix-autoscalinggroup-reference-id-caf8b80c9288ad0f.yaml @@ -1,9 +1,10 @@ --- fixes: - | - The behavior of ``get_resource`` on an ``OS::Heat::AutoScalingGroup`` + The behavior of ``get_resource`` on an ``OS::Heat::InstanceGroup`` resource has changed. Previously it returned the physical resource name (i.e. the name of the nested Heat stack which implemented the group). It will now return the UUID of the nested stack if available. This will also apply to any resource type that inherits from - ``OS::Heat::AutoScalingGroup``. + ``OS::Heat::AutoScalingGroup``, ``OS::Heat::InstanceGroup``, and + ``AWS::AutoScaling::AutoScalingGroup``.