responsible for handling delegation accounts.
"""
-# $Id: sm.py,v 1.25 2007/07/20 19:35:29 faiyaza Exp $
+# $Id: sm.py,v 1.28 2007/07/27 18:02:36 dhozac Exp $
try: from bwlimit import bwmin, bwmax
except ImportError: bwmin, bwmax = 8, 1000*1000*1000
'disk_max': 5000000, # bytes
# capabilities
'capabilities': '',
+ # IP addresses
+ 'ip_addresses': '0.0.0.0',
# NOTE: this table is further populated with resource names and
# default amounts via the start() function below. This probably
in, use the GetSlivers() heartbeat as a cue to scan for expired
slivers."""
+ logger.verbose("Entering sm:GetSlivers with fullupdate=%r"%fullupdate)
+ for key in data.keys():
+ logger.verbose('GetSlivers key : ' + key)
+
node_id = None
try:
f = open('/etc/planetlab/node_id')
### Emulab-specific hack ends here
+ logger.verbose ('dealing with initscripts')
initscripts_by_id = {}
for is_rec in data['initscripts']:
initscripts_by_id[str(is_rec['initscript_id'])] = is_rec['script']
for sliver in data['slivers']:
+ logger.verbose("sm:GetSlivers in slivers loop")
rec = sliver.copy()
rec.setdefault('timestamp', data['timestamp'])
rspec = {}
rec['rspec'] = rspec
for resname, default_amt in DEFAULT_ALLOCATION.iteritems():
- try: amt = int(attr_dict[resname])
- except KeyError: amt = default_amt
- except ValueError:
- if type(default_amt) is type('str'):
- amt = attr_dict[resname]
- else:
- amt = default_amt
+ try:
+ t = type(default_amt)
+ amt = t.__new__(t, attr_dict[resname])
+ except (KeyError, ValueError): amt = default_amt
rspec[resname] = amt
database.db.deliver_record(rec)