~ubuntu-branches/ubuntu/trusty/python-boto/trusty

« back to all changes in this revision

Viewing changes to boto/emr/instance_group.py

  • Committer: Package Import Robot
  • Author(s): Eric Evans
  • Date: 2012-04-15 20:21:21 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120415202121-3fpf6q355s0xqpyu
Tags: 2.3.0-1
* New upstream release (Closes: #664478)
* Update debian/watch for Boto's move to Github.  Thanks Scott
  Moser. (Closes: #650480)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
class InstanceGroup(object):
23
 
        def __init__(self, num_instances, role, type, market, name):
24
 
                self.num_instances = num_instances
25
 
                self.role = role
26
 
                self.type = type
27
 
                self.market = market
28
 
                self.name = name
29
 
        
30
 
        def __repr__(self):
31
 
                return '%s.%s(name=%r, num_instances=%r, role=%r, type=%r, market = %r)' % (
32
 
            self.__class__.__module__, self.__class__.__name__,
33
 
            self.name, self.num_instances, self.role, self.type, self.market)
 
23
    def __init__(self, num_instances, role, type, market, name, bidprice=None):
 
24
        self.num_instances = num_instances
 
25
        self.role = role
 
26
        self.type = type
 
27
        self.market = market
 
28
        self.name = name
 
29
        if market == 'SPOT':
 
30
            if not isinstance(bidprice, basestring):
 
31
                raise ValueError('bidprice must be specified if market == SPOT')
 
32
            self.bidprice = bidprice
 
33
 
 
34
    def __repr__(self):
 
35
        if self.market == 'SPOT':
 
36
            return '%s.%s(name=%r, num_instances=%r, role=%r, type=%r, market = %r, bidprice = %r)' % (
 
37
                self.__class__.__module__, self.__class__.__name__,
 
38
                self.name, self.num_instances, self.role, self.type, self.market,
 
39
                self.bidprice)
 
40
        else:
 
41
            return '%s.%s(name=%r, num_instances=%r, role=%r, type=%r, market = %r)' % (
 
42
                self.__class__.__module__, self.__class__.__name__,
 
43
                self.name, self.num_instances, self.role, self.type, self.market)