From e1f2c570ebebbad962ef3f3d231146b0740ae9bc Mon Sep 17 00:00:00 2001 From: Matt Ferrante Date: Thu, 29 Jan 2015 16:36:35 -0500 Subject: [PATCH] check keys is in dim2 before evaluating --- cloud/amazon/ec2_metric_alarm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/amazon/ec2_metric_alarm.py b/cloud/amazon/ec2_metric_alarm.py index 7a8d573ce74..7f0caac82cb 100644 --- a/cloud/amazon/ec2_metric_alarm.py +++ b/cloud/amazon/ec2_metric_alarm.py @@ -190,7 +190,7 @@ def create_metric_alarm(connection, module): for keys in dim1: if not isinstance(dim1[keys], list): dim1[keys] = [dim1[keys]] - if dim1[keys] != dim2[keys]: + if keys not in dim2 or dim1[keys] != dim2[keys]: changed=True setattr(alarm, 'dimensions', dim1)