From: Marc Fiuczynski Date: Thu, 25 Jun 2009 14:58:57 +0000 (+0000) Subject: fix typo (os.path.exists rather than os.path.exits); fix error handling X-Git-Tag: MyPLC-4.3-16~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=892604fe23667c15f5c3505669c1e08b21c44ef4;p=myplc.git fix typo (os.path.exists rather than os.path.exits); fix error handling --- diff --git a/db-config b/db-config index c9374de..2908a10 100755 --- a/db-config +++ b/db-config @@ -1019,19 +1019,20 @@ message, please reply so that we may investigate the problem. # DeleteBootState(state) # Run local db-config snippets - files = [] dir = "/etc/planetlab/db-config.d" - try: - if os.path.exits(dir): + if os.path.exists(dir): + try: + files = [] files = os.listdir(dir) - except: - pass - - ignored = (".bak","~",".rpmsave",".rpmnew",".orig") - for file in files: - for ignore in ignored: - if file.endswith(ignore): continue - execfile(os.path.join(dir, file)) + except OSError, e: + raise Exception, "Error when opening %s (%s)" % \ + (os.path.join(dir, file), e) + + ignored = (".bak","~",".rpmsave",".rpmnew",".orig") + for file in files: + for ignore in ignored: + if file.endswith(ignore): continue + execfile(os.path.join(dir, file)) if __name__ == '__main__': main()