- # 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
+ # set the vserver reference. If none, set to default.
+ rec.setdefault('vref', attr_dict.get('vref', 'default'))
+
+ # set initscripts. first check if exists, if not, leave empty.
+ is_name = attr_dict.get('initscript')
+ if is_name is not None and is_name in initscripts:
+ rec['initscript'] = initscripts[is_name]
+ else:
+ rec['initscript'] = ''
+
+ # set delegations, if none, set empty
+ rec.setdefault('delegations', attr_dict.get("delegations", []))
+
+ # extract the implied rspec
+ rspec = {}
+ rec['rspec'] = rspec
+ for resname, default_amt in DEFAULT_ALLOCATION.iteritems():
+ try:
+ t = type(default_amt)
+ amt = t.__new__(t, attr_dict[resname])
+ except (KeyError, ValueError): amt = default_amt
+ rspec[resname] = amt
+
+ # add in sysctl attributes into the rspec
+ for key in attr_dict.keys():
+ if key.find("sysctl.") == 0:
+ rspec[key] = attr_dict[key]
+
+ database.db.deliver_record(rec)
+ if fullupdate: database.db.set_min_timestamp(data['timestamp'])
+ # slivers are created here.
+ database.db.sync()
+ accounts.Startingup = False