Generate proper empty value for XML/JSON

This commit is contained in:
Taro Sato 2016-10-16 21:49:10 -07:00
commit b632df3aa4
3 changed files with 41 additions and 14 deletions

View file

@ -24,12 +24,19 @@ class FakeBootstrapAction(object):
class FakeInstanceGroup(object):
def __init__(self, instance_count, instance_role, instance_type, market, name,
id=None, bid_price=None):
def __init__(self, instance_count, instance_role, instance_type,
market='ON_DEMAND', name=None, id=None, bid_price=None):
self.id = id or random_instance_group_id()
self.bid_price = bid_price
self.market = market
if name is None:
if instance_role == 'MASTER':
name = 'master'
elif instance_role == 'CORE':
name = 'slave'
else:
name = 'Task instance group'
self.name = name
self.num_instances = instance_count
self.role = instance_role