Skip to content

Commit

Permalink
Set the connection class in the RegionInfo constructor call, as well …
Browse files Browse the repository at this point in the history
…as after the list of regions is created, so that regionInfo.get_connection() works properly.
  • Loading branch information
walsh159 committed Jul 7, 2010
1 parent 6760075 commit 77e2b9e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions boto/ec2/connection.py
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 77e2b9e

Please sign in to comment.