Lookup meter definition fields correctly

Change-Id: I9db77b9bc196c06c409fcfe252c172230fee4274
Closes-Bug: #1536699
This commit is contained in:
Pradeep Kilambi
2016-01-25 10:11:43 -05:00
parent 86a50c58b1
commit 903a0a527c
2 changed files with 9 additions and 1 deletions

View File

@@ -184,7 +184,7 @@ class ProcessMeterNotifications(plugin_base.NotificationBase):
definitions = []
for meter_cfg in reversed(meters_cfg['metric']):
if (meter_cfg['volume'] != 1
if (meter_cfg.get('volume') != 1
or not cfg.CONF.notification.disable_non_metric_meters):
try:
md = MeterDefinition(meter_cfg, plugin_manager)

View File

@@ -0,0 +1,8 @@
---
fixes:
- >
[`bug 1536699 <https://bugs.launchpad.net/ceilometer/+bug/1536699>`_]
Patch to fix volume field lookup in meter definition file. In case
the field is missing in the definition, it raises a keyerror and
aborts. Instead we should skip the missing field meter and continue
with the rest of the definitions.