Provide versioned myplc so versioned Requires will work correctly.
[myplc.git] / db-config
index 6438e78..0457887 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -262,8 +262,8 @@ def main():
         ]
 
     # add in the platform supported rlimits to the default_attribute_types
-    for entry in resource.__dict__.keys():
-        if entry.find("RLIMIT_")==0:
+    for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
+        if entry.find("LIMIT_")==1:
             rlim = entry[len("RLIMIT_"):]
             rlim = rlim.lower()
             for ty in ("min","soft","hard"):
@@ -271,7 +271,7 @@ def main():
                     'tagname': "%s_%s"%(rlim,ty),
                     'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
                     'category': 'slice/limit',
-                    'min_role_id': 40 #admin
+                    'min_role_id': 10 #admin
                     }
                 default_attribute_types.append(attribute)
 
@@ -1097,6 +1097,21 @@ message, please reply so that we may investigate the problem.
     #    if state not in default_boot_states:
     #        DeleteBootState(state)
 
+    # Run local db-config snippets
+    files = []
+    dir = "/etc/planetlab/db-config.d"
+    try:
+        files = os.listdir(dir)
+    except:
+        pass
+
+    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))
+
 
 if __name__ == '__main__':
     main()