From: Steven Hardy Date: Wed, 6 Mar 2013 14:55:12 +0000 (+0000) Subject: heat engine : watchrule quietly discard unused metric data X-Git-Tag: 2014.1~805 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d8ea7394c29a4000996159b905ceee522a5adcb9;p=openstack-build%2Fheat-build.git heat engine : watchrule quietly discard unused metric data Some cfn-push-stats options try to send multiple metrics to a watch, which won't work with our simplified CW implementation which expects exactly one Metric associated with each watch (since that's all you can define via the template) So quietly discard any metric data we aren't interested in. ref bug 1133510 Change-Id: I5159611b96c501ff2d8e6e605cbd3d4ae5f77e48 --- diff --git a/heat/engine/watchrule.py b/heat/engine/watchrule.py index fe267b37..c55df70e 100644 --- a/heat/engine/watchrule.py +++ b/heat/engine/watchrule.py @@ -247,10 +247,14 @@ class WatchRule(object): def create_watch_data(self, data): if not self.rule['MetricName'] in data: - logger.warn('new data has incorrect metric:%s' % - (self.rule['MetricName'])) - raise ValueError('MetricName %s missing' % - self.rule['MetricName']) + # Our simplified cloudwatch implementation only expects a single + # Metric associated with each alarm, but some cfn-push-stats + # options, e.g --haproxy try to push multiple metrics when we + # actually only care about one (the one we're alarming on) + # so just ignore any data which doesn't contain MetricName + logger.debug('Ignoring metric data (only accept %s) : %s' % + (self.rule['MetricName'], data)) + return watch_data = { 'data': data,