Make it easier to have deployment-specific db-config additions.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 12 Nov 2008 22:15:05 +0000 (22:15 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 12 Nov 2008 22:15:05 +0000 (22:15 +0000)
db-config

index 6438e78..93e467a 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -1097,6 +1097,19 @@ message, please reply so that we may investigate the problem.
     #    if state not in default_boot_states:
     #        DeleteBootState(state)
 
+    # 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()