summaryrefslogtreecommitdiffstats
path: root/debian/patches/meaningful-error-if-no-samba-ad-provision.patch
blob: 6f271f63b79d2ab2131e3672f0c716d7193bcfcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 9610c15759fd6b27615615160f2c5019a32a7154 Mon Sep 17 00:00:00 2001
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Fri, 2 Dec 2022 10:54:31 +0300
Subject: print meaningful error message if samba-ad-provision is not installed

---
 python/samba/provision/common.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/samba/provision/common.py b/python/samba/provision/common.py
index 2f95492d33a..0561624baf8 100644
--- a/python/samba/provision/common.py
+++ b/python/samba/provision/common.py
@@ -39,7 +39,10 @@ FILL_DRS = "DRS"
 
 def setup_path(file):
     """Return an absolute path to the provision tempate 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=["relax:0"]):
-- 
2.30.2