print meaningful error message if samba-ad-provision is not installed
authorMichael Tokarev <mjt@tls.msk.ru>
Fri, 2 Dec 2022 07:54:31 +0000 (10:54 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 25 Oct 2024 09:30:52 +0000 (12:30 +0300)
Updated: Thu, 03 Aug 2023 17:06:24 +0300
Debian-Specific: yes
Forwarded: not-needed

Gbp-Pq: Name meaningful-error-if-no-samba-ad-provision.patch

python/samba/provision/common.py

index a6851b7e4c142f630b07a218acd4fd12dd6c9ae7..935918aa73f317cc51d9b529aa695a00c27e7773 100644 (file)
@@ -39,7 +39,10 @@ FILL_DRS = "DRS"
 
 def setup_path(file):
     """Return an absolute path to the provision template file specified by file"""
-    return os.path.join(setup_dir(), file)
+    path = os.path.join(setup_dir(), file)
+    if not os.path.exists(path):
+        raise Exception("File [%s] not found. Please install samba-ad-provision package" % path)
+    return path
 
 
 def setup_add_ldif(ldb, ldif_path, subst_vars=None, controls=None):