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
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)