X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=db-config;h=376019b1e2d6ebb0e8bc77862950d9d7c4e65830;hb=c098b8dca3cecb9725bf2ff63ffdc4ae7f090974;hp=1778cce6466a2500fc3f2fb6658d6a14d08f6628;hpb=4cf339be0ef08b54f7f36981ba1483e4637af2f2;p=myplc.git diff --git a/db-config b/db-config index 1778cce..376019b 100755 --- a/db-config +++ b/db-config @@ -12,6 +12,7 @@ from plc_config import PLCConfiguration import sys +import resource def main(): cfg = PLCConfiguration() @@ -240,7 +241,7 @@ def main(): 'category' : 'slice/rspec', 'min_role_id': 10}, - # Vsys + # Vsys {'tagname': "vsys", 'description': "Bind vsys script fd's to a slice's vsys directory.", 'category' : 'slice/rspec', @@ -254,6 +255,20 @@ def main(): ] + # 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 = { + 'tagname': "%s_%s"%(rlim,ty), + 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty), + 'category': 'slice/limit', + 'min_role_id': 40 #admin + } + default_attribute_types.append(attribute) + # Get list of existing tag types known_tag_types = [tag_type['tagname'] for tag_type in GetTagTypes()] @@ -671,11 +686,11 @@ def main(): if slice['slice_attribute_ids']: # Delete unknown attributes for slice_attribute in GetSliceAttributes(slice['slice_attribute_ids']): - if (slice_attribute['name'], slice_attribute['value']) \ + if (slice_attribute['tagname'], slice_attribute['value']) \ not in default_slice['attributes']: DeleteSliceAttribute(slice_attribute['slice_attribute_id']) else: - slice_attributes.append((slice_attribute['name'], slice_attribute['value'])) + slice_attributes.append((slice_attribute['tagname'], slice_attribute['value'])) for (name, value) in default_slice['attributes']: if (name, value) not in slice_attributes: