Closed GoogleCodeExporter closed 9 years ago
Actually from looking at the code this is a design issue:
https://github.com/boto/boto/blob/master/boto/ec2/cloudwatch/__init__.py
It has explicit region definition in it:
RegionData = {
'us-east-1' : 'monitoring.us-east-1.amazonaws.com',
'us-west-1' : 'monitoring.us-west-1.amazonaws.com',
'eu-west-1' : 'monitoring.eu-west-1.amazonaws.com',
'ap-northeast-1' : 'monitoring.ap-northeast-1.amazonaws.com',
'ap-southeast-1' : 'monitoring.ap-southeast-1.amazonaws.com'}
Same is true for:
- autoscaling
- cloudwatch
- elb
Programmatic Solution withour needing to query EC2 for regions first:
<pseudo>
'%s' => 'FEATURE.%s.amazonaws.com' % (region.name,region.name)
</pseudo>
Original comment by elconas...@googlemail.com
on 9 Nov 2011 at 9:31
Dirty Fix:
-----
[root@CLOUDMGMT01 software]# diff -r -u boto-2.0 boto-2.0.FIXED/
diff -r -u boto-2.0/boto/ec2/autoscale/__init__.py
boto-2.0.FIXED/boto/ec2/autoscale/__init__.py
--- boto-2.0/boto/ec2/autoscale/__init__.py 2011-07-14 02:45:30.000000000
+0200
+++ boto-2.0.FIXED/boto/ec2/autoscale/__init__.py 2011-11-09
10:40:54.634484190 +0100
@@ -42,6 +42,7 @@
RegionData = {
'us-east-1' : 'autoscaling.us-east-1.amazonaws.com',
'us-west-1' : 'autoscaling.us-west-1.amazonaws.com',
+ 'us-west-2' : 'autoscaling.us-west-2.amazonaws.com',
'eu-west-1' : 'autoscaling.eu-west-1.amazonaws.com',
'ap-northeast-1' : 'autoscaling.ap-northeast-1.amazonaws.com',
'ap-southeast-1' : 'autoscaling.ap-southeast-1.amazonaws.com'}
diff -r -u boto-2.0/boto/ec2/cloudwatch/__init__.py
boto-2.0.FIXED/boto/ec2/cloudwatch/__init__.py
--- boto-2.0/boto/ec2/cloudwatch/__init__.py 2011-07-14 02:45:30.000000000
+0200
+++ boto-2.0.FIXED/boto/ec2/cloudwatch/__init__.py 2011-11-09
10:41:10.696496737 +0100
@@ -154,6 +154,7 @@
RegionData = {
'us-east-1' : 'monitoring.us-east-1.amazonaws.com',
'us-west-1' : 'monitoring.us-west-1.amazonaws.com',
+ 'us-west-2' : 'monitoring.us-west-2.amazonaws.com',
'eu-west-1' : 'monitoring.eu-west-1.amazonaws.com',
'ap-northeast-1' : 'monitoring.ap-northeast-1.amazonaws.com',
'ap-southeast-1' : 'monitoring.ap-southeast-1.amazonaws.com'}
diff -r -u boto-2.0/boto/ec2/elb/__init__.py
boto-2.0.FIXED/boto/ec2/elb/__init__.py
--- boto-2.0/boto/ec2/elb/__init__.py 2011-07-14 02:45:30.000000000 +0200
+++ boto-2.0.FIXED/boto/ec2/elb/__init__.py 2011-11-09 10:41:27.570485241
+0100
@@ -34,6 +34,7 @@
RegionData = {
'us-east-1' : 'elasticloadbalancing.us-east-1.amazonaws.com',
'us-west-1' : 'elasticloadbalancing.us-west-1.amazonaws.com',
+ 'us-west-2' : 'elasticloadbalancing.us-west-2.amazonaws.com',
'eu-west-1' : 'elasticloadbalancing.eu-west-1.amazonaws.com',
'ap-northeast-1' : 'elasticloadbalancing.ap-northeast-1.amazonaws.com',
'ap-southeast-1' : 'elasticloadbalancing.ap-southeast-1.amazonaws.com'}
diff -r -u boto-2.0/boto.egg-info/SOURCES.txt
boto-2.0.FIXED/boto.egg-info/SOURCES.txt
--- boto-2.0/boto.egg-info/SOURCES.txt 2011-07-14 03:03:35.000000000 +0200
+++ boto-2.0.FIXED/boto.egg-info/SOURCES.txt 2011-08-23 11:45:40.060015432
+0200
---
Original comment by elconas...@googlemail.com
on 9 Nov 2011 at 9:43
The explicit list of regions is important because people occasionally want to
query a service for a list of possible region endpoints. You can do this
programmatically with the EC2 service but no other service provides this so the
hard-coded lists are there to mimic the capability.
I will probably refactor this code in the near future and will try to come up
with a more flexible way of handling this.
The easy fix has been committed in
https://github.com/boto/boto/commit/f4f4b9ec528f3af20221b9a18abe7b7c1bdbbb72
Original comment by Mitch.Ga...@gmail.com
on 9 Nov 2011 at 1:17
Original issue reported on code.google.com by
elconas...@googlemail.com
on 9 Nov 2011 at 9:25