File: meaningful-error-if-no-samba-ad-provision.patch

package info (click to toggle)
samba 2%3A4.23.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188,088 kB
  • sloc: ansic: 2,007,520; python: 272,673; sh: 72,258; xml: 51,653; perl: 36,094; makefile: 6,353; yacc: 5,323; exp: 1,582; lex: 1,504; cpp: 1,224; awk: 589; java: 119; csh: 58; pascal: 54; sed: 45; asm: 30
file content (25 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (4)
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