diff options
Diffstat (limited to 'debian/patches/meaningful-error-if-no-samba-ad-provision.patch')
-rw-r--r-- | debian/patches/meaningful-error-if-no-samba-ad-provision.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/patches/meaningful-error-if-no-samba-ad-provision.patch b/debian/patches/meaningful-error-if-no-samba-ad-provision.patch new file mode 100644 index 0000000..6f271f6 --- /dev/null +++ b/debian/patches/meaningful-error-if-no-samba-ad-provision.patch @@ -0,0 +1,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 + |