From: Marc Fiuczynski Date: Tue, 16 Jun 2009 20:09:34 +0000 (+0000) Subject: minor cleanup on how to ignore certain files X-Git-Tag: MyPLC-4.3-15~6 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=217c97d4117f8f8ea4b143041ad83161cb556f7e;p=myplc.git minor cleanup on how to ignore certain files --- diff --git a/db-config b/db-config index 2bf37f7..c9374de 100755 --- 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()