]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:provision: Do not suppress errors produced setting up BIND database
authorJo Sutton <josutton@catalyst.net.nz>
Thu, 1 Aug 2024 03:47:13 +0000 (15:47 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Sun, 4 Aug 2024 00:32:39 +0000 (00:32 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/provision/sambadns.py

index 01398bbc346e842293206634db1b4796aba11502..952e875c862331b5c03eb8de25ca8f5f728e672e 100644 (file)
@@ -874,9 +874,9 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
         setup_add_ldif(dom_ldb,
                        setup_path("provision_basedn_options.ldif"), None)
 
-    except:
+    except Exception as err:
         logger.error(
-            "Failed to setup database for BIND, AD based DNS cannot be used")
+            f"Failed to setup database for BIND, AD based DNS cannot be used: {err}")
         raise
 
     # This line is critical to the security of the whole scheme.
@@ -914,9 +914,9 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
                 # lock file as well
                 os.link(os.path.join(private_dir, forestzone_file + "-lock"),
                         os.path.join(dns_dir, forestzone_file + "-lock"))
-    except OSError:
+    except OSError as err:
         logger.error(
-            "Failed to setup database for BIND, AD based DNS cannot be used")
+            f"Failed to setup database for BIND, AD based DNS cannot be used: {err}")
         raise
     del partfile[domainzonedn]
     if forestzone_file:
@@ -935,9 +935,9 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
             else:
                 tdb_copy(os.path.join(private_dir, pfile),
                          os.path.join(dns_dir, pfile))
-    except:
+    except Exception as err:
         logger.error(
-            "Failed to setup database for BIND, AD based DNS cannot be used")
+            f"Failed to setup database for BIND, AD based DNS cannot be used: {err}")
         raise
 
     # Give bind read/write permissions dns partitions