From: Steve Baker Date: Wed, 5 Jun 2013 21:41:44 +0000 (+1200) Subject: Use - instead of . for physical_resource_name delim. X-Git-Tag: 2014.1~517 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bc6915260e50dab4e879d953c1ef5c38a2d95e54;p=openstack-build%2Fheat-build.git Use - instead of . for physical_resource_name delim. Avoiding using . means that instance hostnames are unique within the stack (and within the tenant). This solves 2 real-world use cases: - tripleo issue, as described in bug: #1184713 - OpenShift template resorts to setting the hostname to ec2_instance_id This may have an impact on users who are scripting to assume . delimiting, however this will only affect newly created stacks after this change is deployed. Fixes bug: #1184713 Change-Id: I5a8eb358ea9c52162eb9263b9f9e6dcf750d787b --- diff --git a/heat/engine/resource.py b/heat/engine/resource.py index c48076b9..c6676c64 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -403,7 +403,7 @@ class Resource(object): self.state_set(self.UPDATE_COMPLETE) def physical_resource_name(self): - return '%s.%s' % (self.stack.name, self.name) + return '%s-%s' % (self.stack.name, self.name) def validate(self): logger.info('Validating %s' % str(self)) diff --git a/heat/tests/utils.py b/heat/tests/utils.py index eb253de8..1b6d95dd 100644 --- a/heat/tests/utils.py +++ b/heat/tests/utils.py @@ -80,4 +80,4 @@ class PhysName(object): return not self.__eq__(physical_name) def __repr__(self): - return '%s.%s' % (self.stack_name, self.resource_name) + return '%s-%s' % (self.stack_name, self.resource_name)