| Index: third_party/boto/boto/ec2/__init__.py
|
| ===================================================================
|
| --- third_party/boto/boto/ec2/__init__.py (revision 33376)
|
| +++ third_party/boto/boto/ec2/__init__.py (working copy)
|
| @@ -24,21 +24,10 @@
|
| service from AWS.
|
| """
|
| from boto.ec2.connection import EC2Connection
|
| -from boto.regioninfo import RegionInfo
|
| +from boto.regioninfo import RegionInfo, get_regions, load_regions
|
|
|
|
|
| -RegionData = {
|
| - 'us-east-1': 'ec2.us-east-1.amazonaws.com',
|
| - 'us-gov-west-1': 'ec2.us-gov-west-1.amazonaws.com',
|
| - 'us-west-1': 'ec2.us-west-1.amazonaws.com',
|
| - 'us-west-2': 'ec2.us-west-2.amazonaws.com',
|
| - 'sa-east-1': 'ec2.sa-east-1.amazonaws.com',
|
| - 'eu-west-1': 'ec2.eu-west-1.amazonaws.com',
|
| - 'ap-northeast-1': 'ec2.ap-northeast-1.amazonaws.com',
|
| - 'ap-southeast-1': 'ec2.ap-southeast-1.amazonaws.com',
|
| - 'ap-southeast-2': 'ec2.ap-southeast-2.amazonaws.com',
|
| - 'cn-north-1': 'ec2.cn-north-1.amazonaws.com.cn',
|
| -}
|
| +RegionData = load_regions().get('ec2', {})
|
|
|
|
|
| def regions(**kw_params):
|
| @@ -51,13 +40,7 @@
|
| :rtype: list
|
| :return: A list of :class:`boto.ec2.regioninfo.RegionInfo`
|
| """
|
| - regions = []
|
| - for region_name in RegionData:
|
| - region = RegionInfo(name=region_name,
|
| - endpoint=RegionData[region_name],
|
| - connection_cls=EC2Connection)
|
| - regions.append(region)
|
| - return regions
|
| + return get_regions('ec2', connection_cls=EC2Connection)
|
|
|
|
|
| def connect_to_region(region_name, **kw_params):
|
|
|