| Index: third_party/gsutil/boto/boto/sts/__init__.py
|
| diff --git a/third_party/gsutil/20110627/boto/boto/ec2/__init__.py b/third_party/gsutil/boto/boto/sts/__init__.py
|
| similarity index 67%
|
| rename from third_party/gsutil/20110627/boto/boto/ec2/__init__.py
|
| rename to third_party/gsutil/boto/boto/sts/__init__.py
|
| index 4b07d424955c3de5abc1d4138c91c2c6a9051c46..7ee10b42836777614a9b40d069433a26a6e760b1 100644
|
| --- a/third_party/gsutil/20110627/boto/boto/ec2/__init__.py
|
| +++ b/third_party/gsutil/boto/boto/sts/__init__.py
|
| @@ -1,4 +1,5 @@
|
| -# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/
|
| +# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/
|
| +# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
|
| #
|
| # Permission is hereby granted, free of charge, to any person obtaining a
|
| # copy of this software and associated documentation files (the
|
| @@ -18,52 +19,48 @@
|
| # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| # IN THE SOFTWARE.
|
| -#
|
| -"""
|
| -This module provides an interface to the Elastic Compute Cloud (EC2)
|
| -service from AWS.
|
| -"""
|
| -from boto.ec2.connection import EC2Connection
|
|
|
| -def regions(**kw_params):
|
| +from connection import STSConnection
|
| +from boto.regioninfo import RegionInfo
|
| +
|
| +def regions():
|
| """
|
| - Get all available regions for the EC2 service.
|
| - You may pass any of the arguments accepted by the EC2Connection
|
| - object's constructor as keyword arguments and they will be
|
| - passed along to the EC2Connection object.
|
| -
|
| + Get all available regions for the STS service.
|
| +
|
| :rtype: list
|
| - :return: A list of :class:`boto.ec2.regioninfo.RegionInfo`
|
| + :return: A list of :class:`boto.regioninfo.RegionInfo` instances
|
| """
|
| - c = EC2Connection(**kw_params)
|
| - return c.get_all_regions()
|
| + return [RegionInfo(name='us-east-1',
|
| + endpoint='sts.amazonaws.com',
|
| + connection_cls=STSConnection)
|
| + ]
|
|
|
| def connect_to_region(region_name, **kw_params):
|
| """
|
| Given a valid region name, return a
|
| - :class:`boto.ec2.connection.EC2Connection`.
|
| + :class:`boto.sts.connection.STSConnection`.
|
|
|
| :type: str
|
| :param region_name: The name of the region to connect to.
|
|
|
| - :rtype: :class:`boto.ec2.connection.EC2Connection` or ``None``
|
| + :rtype: :class:`boto.sts.connection.STSConnection` or ``None``
|
| :return: A connection to the given region, or None if an invalid region
|
| name is given
|
| """
|
| - for region in regions(**kw_params):
|
| + for region in regions():
|
| if region.name == region_name:
|
| return region.connect(**kw_params)
|
| return None
|
| -
|
| +
|
| def get_region(region_name, **kw_params):
|
| """
|
| - Find and return a :class:`boto.ec2.regioninfo.RegionInfo` object
|
| + Find and return a :class:`boto.regioninfo.RegionInfo` object
|
| given a region name.
|
|
|
| :type: str
|
| :param: The name of the region.
|
|
|
| - :rtype: :class:`boto.ec2.regioninfo.RegionInfo`
|
| + :rtype: :class:`boto.regioninfo.RegionInfo`
|
| :return: The RegionInfo object for the given region or None if
|
| an invalid region name is provided.
|
| """
|
| @@ -71,4 +68,3 @@ def get_region(region_name, **kw_params):
|
| if region.name == region_name:
|
| return region
|
| return None
|
| -
|
|
|