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

Unified Diff: third_party/gsutil/boto/boto/emr/instance_group.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/emr/emrobject.py ('k') | third_party/gsutil/boto/boto/emr/step.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gsutil/boto/boto/emr/instance_group.py
diff --git a/third_party/gsutil/20110627/boto/boto/gs/user.py b/third_party/gsutil/boto/boto/emr/instance_group.py
old mode 100755
new mode 100644
similarity index 52%
copy from third_party/gsutil/20110627/boto/boto/gs/user.py
copy to third_party/gsutil/boto/boto/emr/instance_group.py
index 62f2cf56d55412fbefee1ed7fda104d71d6e3de8..be229510f6cc3d43bce8dd302fcfc9d80977e47c
--- a/third_party/gsutil/20110627/boto/boto/gs/user.py
+++ b/third_party/gsutil/boto/boto/emr/instance_group.py
@@ -1,4 +1,3 @@
-# Copyright 2010 Google Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
@@ -20,35 +19,25 @@
# IN THE SOFTWARE.
-class User:
- def __init__(self, parent=None, id='', name=''):
- if parent:
- parent.owner = self
- self.type = None
- self.id = id
+class InstanceGroup(object):
+ def __init__(self, num_instances, role, type, market, name, bidprice=None):
+ self.num_instances = num_instances
+ self.role = role
+ self.type = type
+ self.market = market
self.name = name
+ if market == 'SPOT':
+ if not isinstance(bidprice, basestring):
+ raise ValueError('bidprice must be specified if market == SPOT')
+ self.bidprice = bidprice
def __repr__(self):
- return self.id
-
- def startElement(self, name, attrs, connection):
- return None
-
- def endElement(self, name, value, connection):
- if name == 'Name':
- self.name = value
- elif name == 'ID':
- self.id = value
- else:
- setattr(self, name, value)
-
- def to_xml(self, element_name='Owner'):
- if self.type:
- s = '<%s type="%s">' % (element_name, self.type)
+ if self.market == 'SPOT':
+ return '%s.%s(name=%r, num_instances=%r, role=%r, type=%r, market = %r, bidprice = %r)' % (
+ self.__class__.__module__, self.__class__.__name__,
+ self.name, self.num_instances, self.role, self.type, self.market,
+ self.bidprice)
else:
- s = '<%s>' % element_name
- s += '<ID>%s</ID>' % self.id
- if self.name:
- s += '<Name>%s</Name>' % self.name
- s += '</%s>' % element_name
- return s
+ return '%s.%s(name=%r, num_instances=%r, role=%r, type=%r, market = %r)' % (
+ self.__class__.__module__, self.__class__.__name__,
+ self.name, self.num_instances, self.role, self.type, self.market)
« no previous file with comments | « third_party/gsutil/boto/boto/emr/emrobject.py ('k') | third_party/gsutil/boto/boto/emr/step.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698