blob: f7bae51eeed83717d121b0d886cf88d86c185057 (
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
|
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Fri, 2 Dec 2022 10:54:31 +0300
Updated: Thu, 03 Aug 2023 17:06:24 +0300
Subject: print meaningful error message if samba-ad-provision is not installed
Debian-Specific: yes
Forwarded: not-needed
---
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 a6851b7e4c1..935918aa73f 100644
--- a/python/samba/provision/common.py
+++ b/python/samba/provision/common.py
@@ -40,5 +40,8 @@ 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
|