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

Unified Diff: third_party/gsutil/boto/boto/ec2/zone.py

Issue 10199002: Upgrade gsutil to 3.4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 8 years, 8 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 | « third_party/gsutil/boto/boto/ec2/volumestatus.py ('k') | third_party/gsutil/boto/boto/ecs/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gsutil/boto/boto/ec2/zone.py
diff --git a/third_party/gsutil/20110627/boto/boto/ec2/zone.py b/third_party/gsutil/boto/boto/ec2/zone.py
similarity index 63%
rename from third_party/gsutil/20110627/boto/boto/ec2/zone.py
rename to third_party/gsutil/boto/boto/ec2/zone.py
index aec79b2c4060928368ab5d9900fbdaa573decaea..44068d4ddebcd2dff16764c61aa1da2f145745c5 100644
--- a/third_party/gsutil/20110627/boto/boto/ec2/zone.py
+++ b/third_party/gsutil/boto/boto/ec2/zone.py
@@ -24,21 +24,54 @@ Represents an EC2 Availability Zone
"""
from boto.ec2.ec2object import EC2Object
+class MessageSet(list):
+ """
+ A list object that contains messages associated with
+ an availability zone.
+ """
+
+ def startElement(self, name, attrs, connection):
+ return None
+
+ def endElement(self, name, value, connection):
+ if name == 'message':
+ self.append(value)
+ else:
+ setattr(self, name, value)
+
class Zone(EC2Object):
+ """
+ Represents an Availability Zone.
+
+ :ivar name: The name of the zone.
+ :ivar state: The current state of the zone.
+ :ivar region_name: The name of the region the zone is associated with.
+ :ivar messages: A list of messages related to the zone.
+ """
def __init__(self, connection=None):
EC2Object.__init__(self, connection)
self.name = None
self.state = None
+ self.region_name = None
+ self.messages = None
def __repr__(self):
return 'Zone:%s' % self.name
+ def startElement(self, name, attrs, connection):
+ if name == 'messageSet':
+ self.messages = MessageSet()
+ return self.messages
+ return None
+
def endElement(self, name, value, connection):
if name == 'zoneName':
self.name = value
elif name == 'zoneState':
self.state = value
+ elif name == 'regionName':
+ self.region_name = value
else:
setattr(self, name, value)
« no previous file with comments | « third_party/gsutil/boto/boto/ec2/volumestatus.py ('k') | third_party/gsutil/boto/boto/ecs/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698