Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Unified Diff: boto/vpc/internetgateway.py

Issue 8386013: Merging in latest boto. (Closed) Base URL: svn://svn.chromium.org/boto
Patch Set: Redoing vendor drop by deleting and then merging. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « boto/vpc/__init__.py ('k') | boto/vpc/routetable.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: boto/vpc/internetgateway.py
diff --git a/boto/vpc/subnet.py b/boto/vpc/internetgateway.py
similarity index 58%
copy from boto/vpc/subnet.py
copy to boto/vpc/internetgateway.py
index 135e1a28207e4ebf5a2263ca9f4321e9c68864cb..011fdee1af40cc223351868d5992d6cf63e7a7a9 100644
--- a/boto/vpc/subnet.py
+++ b/boto/vpc/internetgateway.py
@@ -14,41 +14,59 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# 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.
"""
-Represents a Subnet
+Represents an Internet Gateway
"""
from boto.ec2.ec2object import TaggedEC2Object
+from boto.resultset import ResultSet
-class Subnet(TaggedEC2Object):
-
+class InternetGateway(TaggedEC2Object):
def __init__(self, connection=None):
TaggedEC2Object.__init__(self, connection)
self.id = None
- self.state = None
- self.cidr_block = None
- self.available_ip_address_count = 0
- self.availability_zone = None
+ self.attachments = []
def __repr__(self):
- return 'Subnet:%s' % self.id
-
+ return 'InternetGateway:%s' % self.id
+
+ def startElement(self, name, attrs, connection):
+ result = super(InternetGateway, self).startElement(name, attrs, connection)
+
+ if result is not None:
+ # Parent found an interested element, just return it
+ return result
+
+ if name == 'attachmentSet':
+ self.attachments = ResultSet([('item', InternetGatewayAttachment)])
+ return self.attachments
+ else:
+ return None
+
def endElement(self, name, value, connection):
- if name == 'subnetId':
+ if name == 'internetGatewayId':
self.id = value
- elif name == 'state':
- self.state = value
- elif name == 'cidrBlock':
- self.cidr_block = value
- elif name == 'availableIpAddressCount':
- self.available_ip_address_count = int(value)
- elif name == 'availabilityZone':
- self.availability_zone = value
else:
setattr(self, name, value)
+class InternetGatewayAttachment(object):
+ def __init__(self, connection=None):
+ self.vpc_id = None
+ self.state = None
+
+ def __repr__(self):
+ return 'InternetGatewayAttachment:%s' % self.vpc_id
+
+ def startElement(self, name, attrs, connection):
+ return None
+
+ def endElement(self, name, value, connection):
+ if name == 'vpcId':
+ self.vpc_id = value
+ elif name == 'state':
+ self.state = value
« no previous file with comments | « boto/vpc/__init__.py ('k') | boto/vpc/routetable.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698