diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-02-11 19:04:33 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-02-11 19:04:33 +0100 |
commit | be9a4157f050f0b54fd369181ee273029c0f81fc (patch) | |
tree | df69f5ba16be38c03e1ea090aae4c94ae6d3a386 /source4/scripting | |
parent | 9e71fef57b956fa62134e5b885fc4ff78a957e71 (diff) | |
download | samba-be9a4157f050f0b54fd369181ee273029c0f81fc.tar.gz samba-be9a4157f050f0b54fd369181ee273029c0f81fc.tar.bz2 samba-be9a4157f050f0b54fd369181ee273029c0f81fc.zip |
Catch specific exceptions, rather than catching everything, which might hide other exceptions silently.
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 6 |
1 files changed, 3 insertions, 3 deletions
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) |