From: Steven Hardy Date: Mon, 19 Nov 2012 15:31:01 +0000 (+0000) Subject: Make CloudWatchAlarm names unique per-tenant X-Git-Tag: 2014.1~1194^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f96f15d2edb379d93c999f8d92f1d636ab87910e;p=openstack-build%2Fheat-build.git Make CloudWatchAlarm names unique per-tenant Use physical_resource_name to ensure CloudWatchAlarm resources are unique per tenant Ref bug 1078779 Change-Id: Id37393decd8d4f89e79af5c7e9eeb21f4e494699 Signed-off-by: Steven Hardy --- diff --git a/heat/engine/resources/cloud_watch.py b/heat/engine/resources/cloud_watch.py index bc02625a..f8a54e64 100644 --- a/heat/engine/resources/cloud_watch.py +++ b/heat/engine/resources/cloud_watch.py @@ -54,7 +54,8 @@ class CloudWatchAlarm(resource.Resource): strict_dependency = False def handle_create(self): - wr = watchrule.WatchRule(context=self.context, watch_name=self.name, + wr = watchrule.WatchRule(context=self.context, + watch_name=self.physical_resource_name(), rule=self.parsed_template('Properties'), stack_id=self.stack.id) wr.store() @@ -64,9 +65,10 @@ class CloudWatchAlarm(resource.Resource): def handle_delete(self): try: - db_api.watch_rule_delete(self.context, self.name) + db_api.watch_rule_delete(self.context, + self.physical_resource_name()) except exception.NotFound: pass def FnGetRefId(self): - return unicode(self.name) + return unicode(self.physical_resource_name())