| Index: boto/emr/instance_group.py
|
| diff --git a/boto/emr/bootstrap_action.py b/boto/emr/instance_group.py
|
| similarity index 52%
|
| copy from boto/emr/bootstrap_action.py
|
| copy to boto/emr/instance_group.py
|
| index c1c90387f709ecf5244230bc8706e46bbe854268..be229510f6cc3d43bce8dd302fcfc9d80977e47c 100644
|
| --- a/boto/emr/bootstrap_action.py
|
| +++ b/boto/emr/instance_group.py
|
| @@ -1,4 +1,3 @@
|
| -# Copyright (c) 2010 Spotify AB
|
| #
|
| # Permission is hereby granted, free of charge, to any person obtaining a
|
| # copy of this software and associated documentation files (the
|
| @@ -19,25 +18,26 @@
|
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
| # IN THE SOFTWARE.
|
|
|
| -class BootstrapAction(object):
|
| - def __init__(self, name, path, bootstrap_action_args):
|
| - self.name = name
|
| - self.path = path
|
| -
|
| - if isinstance(bootstrap_action_args, basestring):
|
| - bootstrap_action_args = [bootstrap_action_args]
|
| -
|
| - self.bootstrap_action_args = bootstrap_action_args
|
|
|
| - def args(self):
|
| - args = []
|
| -
|
| - if self.bootstrap_action_args:
|
| - args.extend(self.bootstrap_action_args)
|
| -
|
| - return args
|
| +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 '%s.%s(name=%r, path=%r, bootstrap_action_args=%r)' % (
|
| - self.__class__.__module__, self.__class__.__name__,
|
| - self.name, self.path, self.bootstrap_action_args)
|
| + 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:
|
| + 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)
|
|
|