minor cleanup on how to ignore certain files
authorMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 16 Jun 2009 20:09:34 +0000 (20:09 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 16 Jun 2009 20:09:34 +0000 (20:09 +0000)
db-config

index 2bf37f7..c9374de 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -1022,18 +1022,17 @@ message, please reply so that we may investigate the problem.
     files = []
     dir = "/etc/planetlab/db-config.d"
     try:
-        files = os.listdir(dir)
+        if os.path.exits(dir):
+            files = os.listdir(dir)
     except:
         pass
 
+    ignored = (".bak","~",".rpmsave",".rpmnew",".orig")
     for file in files:
-        if (file.endswith(".bak") or file.endswith("~") or
-            file.endswith(".rpmsave") or file.endswith(".rpmnew") or
-            file.endswith(".orig")):
-            continue
+        for ignore in ignored:
+            if file.endswith(ignore): continue
         execfile(os.path.join(dir, file))
 
-
 if __name__ == '__main__':
     main()