'net_i2_thresh_kbyte': 13757316,
# disk space limit
'disk_max': 5000000, # bytes
+ # capabilities
+ 'capabilities': '',
# NOTE: this table is further populated with resource names and
# default amounts via the start() function below. This probably
keys = rec.pop('keys')
rec.setdefault('keys', '\n'.join([key_struct['key'] for key_struct in keys]))
- # Handle nm controller here
- rec.setdefault('type', attr_dict.get('type', 'sliver.VServer'))
- if rec['instantiation'] == 'nm-controller':
- # type isn't returned by GetSlivers() for whatever reason. We're overloading
- # instantiation here, but i suppose its the ssame thing when you think about it. -FA
- rec['type'] = 'delegate'
+ # Handle nm controller here
+ rec.setdefault('type', attr_dict.get('type', 'sliver.VServer'))
+ if rec['instantiation'] == 'nm-controller':
+ # type isn't returned by GetSlivers() for whatever reason. We're overloading
+ # instantiation here, but i suppose its the ssame thing when you think about it. -FA
+ rec['type'] = 'delegate'
rec.setdefault('vref', attr_dict.get('vref', 'default'))
is_id = attr_dict.get('plc_initscript_id')
rec['rspec'] = rspec
for resname, default_amt in DEFAULT_ALLOCATION.iteritems():
try: amt = int(attr_dict[resname])
- except (KeyError, ValueError): amt = default_amt
+ except KeyError: amt = default_amt
+ except ValueError:
+ if type(default_amt) is type('str'):
+ amt = attr_dict[resname]
+ else:
+ amt = default_amt
rspec[resname] = amt
# disable sliver
database.db.deliver_record(rec)
if fullupdate: database.db.set_min_timestamp(data['timestamp'])
database.db.sync()
-
- # handle requested startup
- global start_requested
- if start_requested:
- start_requested = False
- cumulative_delay = 0
- for name in database.db.iterkeys():
- accounts.get(name).start(delay=cumulative_delay)
- cumulative_delay += 3
+ accounts.Startingup = False
def deliver_ticket(data): return GetSlivers(data, fullupdate=False)
accounts.register_class(sliver_vs.Sliver_VS)
accounts.register_class(delegate.Delegate)
- global start_requested
- start_requested = options.startup
+ accounts.Startingup = options.startup
database.start()
api.deliver_ticket = deliver_ticket
api.start()