From: Michael Tokarev 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