From be9a4157f050f0b54fd369181ee273029c0f81fc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 11 Feb 2009 19:04:33 +0100 Subject: Catch specific exceptions, rather than catching everything, which might hide other exceptions silently. --- source4/scripting/python/samba/provision.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index d77b487512..10daf1b2b9 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -454,7 +454,7 @@ def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info, credentials=credentials, lp=lp) # Wipes the database samdb.erase() - except: + except LdbError: os.unlink(samdb_path) samdb = SamDB(samdb_path, session_info=session_info, credentials=credentials, lp=lp) @@ -647,7 +647,7 @@ def setup_templatesdb(path, setup_path, session_info, credentials, lp): # Wipes the database try: templates_ldb.erase() - except: + except LdbError: os.unlink(path) templates_ldb.load_ldif_file_add(setup_path("provision_templates_init.ldif")) @@ -1222,7 +1222,7 @@ def provision_backend(setup_dir=None, message=None, schemadb_path = os.path.join(paths.ldapdir, "schema-tmp.ldb") try: os.unlink(schemadb_path) - except: + except OSError: pass schemadb = Ldb(schemadb_path, lp=lp) -- cgit