summaryrefslogtreecommitdiffstats
path: root/debian/patches/meaningful-error-if-no-python3-markdown.patch
blob: da085f97fef4a624ace691775ab6035e53ee0054 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Fri, 2 Dec 2022 11:08:27 +0300
Updated: Mon, 08 Apr 2024 14:14:38 +0300
Subject: print meaningful error message if python3-markdown is not installed
Debian-Specific: yes
Forwarded: not-needed

diff --git a/python/samba/netcmd/domain/schemaupgrade.py b/python/samba/netcmd/domain/schemaupgrade.py
index 1d67ab58c15..858802635a2 100644
--- a/python/samba/netcmd/domain/schemaupgrade.py
+++ b/python/samba/netcmd/domain/schemaupgrade.py
@@ -229,6 +229,6 @@ class cmd_domain_schema_upgrade(Command):
             from samba.ms_schema_markdown import read_ms_markdown
         except ImportError as e:
-            self.outf.write("Exception in importing markdown: %s\n" % e)
-            raise CommandError('Failed to import module markdown')
+            self.outf.write("Exception in importing markdown: %s\n" % e)
+            raise CommandError('Failed to import module markdown, please install python3-markdown package')
         from samba.schema import Schema
 
diff --git a/python/samba/ms_forest_updates_markdown.py b/python/samba/ms_forest_updates_markdown.py
index 0a0d2111a72..a5ef6ec7279 100644
--- a/python/samba/ms_forest_updates_markdown.py
+++ b/python/samba/ms_forest_updates_markdown.py
@@ -24,7 +24,11 @@
 
 import re
 import os
-import markdown
+try:
+    import markdown
+except ImportError as e:
+    e.add_note('Please install python3-markdown package')
+    raise
 import xml.etree.ElementTree as ET
 from samba.common import get_string
 
diff --git a/python/samba/ms_schema_markdown.py b/python/samba/ms_schema_markdown.py
index 8a9ad78b870..9af9406081b 100644
--- a/python/samba/ms_schema_markdown.py
+++ b/python/samba/ms_schema_markdown.py
@@ -22,7 +22,11 @@
 
 import re
 import os
-import markdown
+try:
+    import markdown
+except ImportError as e:
+    e.add_note('Please install python3-markdown package')
+    raise
 import xml.etree.ElementTree as ET