From 892604fe23667c15f5c3505669c1e08b21c44ef4 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Thu, 25 Jun 2009 14:58:57 +0000 Subject: [PATCH] fix typo (os.path.exists rather than os.path.exits); fix error handling --- db-config | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) 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() -- 2.43.0