From: Zane Bitter Date: Tue, 18 Jun 2013 08:41:40 +0000 (+0200) Subject: Return None for physical resource name during validation X-Git-Tag: 2014.1~475 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=40c4b44d02717b2aa8f420ca516ce662d2a1b978;p=openstack-build%2Fheat-build.git Return None for physical resource name during validation During template validation, the resources have not been stored in the database. Therefore any resources that return self.physical_resource_name() in either FnGetRef() or FnGetAtt() would cause assertions whenever either of those functions were called during validation. Instead, return None from physical_resource_name() in this phase, as we do for other data that is not available yet during validation. Fixes bug #1191931 Change-Id: I1a5b17557ae1ca2600fb930e74eb5248c82e0326 --- diff --git a/heat/engine/resource.py b/heat/engine/resource.py index ebad8adb..dd68939d 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -418,7 +418,8 @@ class Resource(object): self.state_set(self.UPDATE, self.COMPLETE) def physical_resource_name(self): - assert self.id is not None + if self.id is None: + return None return '%s-%s-%s' % (self.stack.name, self.name,