Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set the connection class in the RegionInfo constructor call, as well …

…as after the list of regions is created, so that regionInfo.get_connection() works properly.
  • Loading branch information...
commit 77e2b9edba00df1ff6e69ef0d4ae5b9866bc1ad7 1 parent 6760075
walsh159 authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 boto/ec2/connection.py
View
7 boto/ec2/connection.py
@@ -69,7 +69,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
B{Note:} The host argument is overridden by the host specified in the boto configuration file.
"""
if not region:
- region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint)
+ region = RegionInfo(self, self.DefaultRegionName, self.DefaultRegionEndpoint, EC2Connection)
self.region = region
AWSQueryConnection.__init__(self, aws_access_key_id,
aws_secret_access_key,
@@ -1430,7 +1430,10 @@ def get_all_regions(self):
:rtype: list
:return: A list of :class:`boto.ec2.regioninfo.RegionInfo`
"""
- return self.get_list('DescribeRegions', None, [('item', RegionInfo)])
+ regions = self.get_list('DescribeRegions', None, [('item', RegionInfo)])
+ for region in regions:
+ region.connection_cls = EC2Connection
+ return regions
#
# Reservation methods
Please sign in to comment.
Something went wrong with that request. Please try again.