boto/boto — Issue #617: Dimension names without specific values cause traceback
Author: garnaat
Created: 2012-03-05 22:54:15+00:00
State: open
Labels: Bug, CloudWatch

In [8]: c.list_metrics(dimensions={'InstanceId': None})
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/garnaat/projects/boto-dev/boto/bin/ in ()
----> 1 c.list_metrics(dimensions={'InstanceId': None})

/Users/garnaat/projects/boto-dev/boto/boto/ec2/cloudwatch/__init__.pyc in list_metrics(self, next_token, dimensions, metric_name, namespace)
263 params['NextToken'] = next_token
264 if dimensions:
--> 265 self.build_dimension_param(dimensions, params)
266 if metric_name:
267 params['MetricName'] = metric_name

/Users/garnaat/projects/boto-dev/boto/boto/ec2/cloudwatch/__init__.pyc in build_dimension_param(self, dimension, params)
117 if isinstance(dim_value, basestring):
118 dim_value = [dim_value]
--> 119 for j, value in enumerate(dim_value):
120 params['Dimensions.member.%d.Name.%d' % (i+1, j+1)] = dim_name
121 params['Dimensions.member.%d.Value.%d' % (i+1, j+1)] = value

TypeError: 'NoneType' object is not iterable