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

Unified Diff: third_party/gsutil/boto/boto/ec2/volume.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/tag.py ('k') | third_party/gsutil/boto/boto/ec2/volumestatus.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/volume.py
diff --git a/third_party/gsutil/20110627/boto/boto/ec2/volume.py b/third_party/gsutil/boto/boto/ec2/volume.py
similarity index 88%
rename from third_party/gsutil/20110627/boto/boto/ec2/volume.py
rename to third_party/gsutil/boto/boto/ec2/volume.py
index 45345fa252626ae3f1bcb907a783a65a4ea3266a..ab7fcfacdfb55b9ad453691a89d0dbf87fd4ec4b 100644
--- a/third_party/gsutil/20110627/boto/boto/ec2/volume.py
+++ b/third_party/gsutil/boto/boto/ec2/volume.py
@@ -84,7 +84,9 @@ class Volume(TaggedEC2Object):
raise a ValueError exception if no data is
returned from EC2.
"""
- rs = self.connection.get_all_volumes([self.id])
+ # Check the resultset since Eucalyptus ignores the volumeId param
+ unfiltered_rs = self.connection.get_all_volumes([self.id])
+ rs = [ x for x in unfiltered_rs if x.id == self.id ]
if len(rs) > 0:
self._update(rs[0])
elif validate:
@@ -110,7 +112,7 @@ class Volume(TaggedEC2Object):
:type device: str
:param device: The device on the instance through which the
- volume will be exposted (e.g. /dev/sdh)
+ volume will be exposed (e.g. /dev/sdh)
:rtype: bool
:return: True if successful
@@ -147,9 +149,9 @@ class Volume(TaggedEC2Object):
:type description: str
:param description: A description of the snapshot. Limited to 256 characters.
-
- :rtype: bool
- :return: True if successful
+
+ :rtype: :class:`boto.ec2.snapshot.Snapshot`
+ :return: The created Snapshot object
"""
return self.connection.create_snapshot(self.id, description)
@@ -225,3 +227,27 @@ class AttachmentSet(object):
else:
setattr(self, name, value)
+class VolumeAttribute:
+
+ def __init__(self, parent=None):
+ self.id = None
+ self._key_name = None
+ self.attrs = {}
+
+ def startElement(self, name, attrs, connection):
+ if name == 'autoEnableIO':
+ self._key_name = name
+ return None
+
+ def endElement(self, name, value, connection):
+ if name == 'value':
+ if value.lower() == 'true':
+ self.attrs[self._key_name] = True
+ else:
+ self.attrs[self._key_name] = False
+ elif name == 'volumeId':
+ self.id = value
+ else:
+ setattr(self, name, value)
+
+
« no previous file with comments | « third_party/gsutil/boto/boto/ec2/tag.py ('k') | third_party/gsutil/boto/boto/ec2/volumestatus.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698