from plc_config import PLCConfiguration
import sys
+import resource
def main():
cfg = PLCConfiguration()
'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
'min_role_id': 10},
+ # Delegation
+ {'name': "delegations",
+ 'description': "Comma-seperated list of slices to give delegation authority to.",
+ 'min_role_id': 10},
+
]
+ # add in the platform supported rlimits to the default_attribute_types
+ for entry in resource.__dict__.keys():
+ if entry.find("RLIMIT_")==0:
+ rlim = entry[len("RLIMIT_"):]
+ rlim = rlim.lower()
+ for ty in ("min","soft","hard"):
+ attribute = {
+ 'name': "%s_%s'%(rlim,ty)",
+ 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
+ 'min_role_id': 40 #admin
+ }
+ default_attribute_types.append(attribute)
+
# Get list of existing attribute types
attribute_types = GetSliceAttributeTypes()
attribute_types = [attribute_type['name'] for attribute_type in attribute_types]
for ptype in protocol_types:
AddPCUProtocolType(id, ptype)
+ # Run local db-config snippets
+ try:
+ dir = "/etc/planetlab/db-config.d"
+ files = os.listdir(dir)
+ for file in files:
+ if (file.endswith(".bak") or file.endswith("~") or
+ file.endswith(".rpmsave") or file.endswith(".rpmnew") or
+ file.endswith(".orig")):
+ continue
+ execfile(os.path.join(dir, file))
+ except:
+ pass
+
if __name__ == '__main__':
main()