vavavr00m / boto

Automatically exported from code.google.com/p/boto
1 stars 0 forks source link

boto/ec2/cloudwatch/__init__.py put_metric_alarm #508

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cw = CloudWatchConnection(self.AWS_ACCESS_ID, self.AWS_SECRET_KEY)
2. alarm = MetricAlarm(name='my_group-HighLatency',
                       metric='Latency',
                       namespace='AWS/ELB', 
                       statistic='Average',
                       comparison='>=',
                       threshold=5.0,
                       period=60, 
                       evaluation_periods=5)
3. cw.create_alarm(alarm)

What is the expected output? What do you see instead?

  File "build/bdist.macosx-10.6-universal/egg/boto/ec2/cloudwatch/__init__.py", line 416, in put_metric_alarm
KeyError: 'GreaterThanOrEqualToThreshold'

What version of the product are you using? On what operating system?
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto
>>> boto.__path__
['/Library/Python/2.6/site-packages/boto-2.0b5-py2.6.egg/boto']

Please provide any additional information below.
line 416 of boto/ec2/cloudwatch/__init__.py
should read 
'ComparisonOperator'    :       alarm.comparison,
instead of 
'ComparisonOperator'    :       MetricAlarm._cmp_map[alarm.comparison],

The mapping is already done in MetricAlarm object

Again, I am not sure if developer uses Source Control as a saving means (i.e. 
EOD) if it is the case and no integration tests have been applied yet than 
please reject my comments

Thanks,

Original issue reported on code.google.com by set...@valiha.com on 4 Apr 2011 at 1:52

GoogleCodeExporter commented 9 years ago
Fixed in 
https://github.com/boto/boto/commit/a0d0f25a65e904131f572e90b9cd940c9c156f92

Original comment by Mitch.Ga...@gmail.com on 8 Apr 2011 at 3:40

GoogleCodeExporter commented 9 years ago

Original comment by Mitch.Ga...@gmail.com on 8 Apr 2011 at 3:40