mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
start getting modules to use shared import error code (#51787)
This commit is contained in:
@@ -727,10 +727,13 @@ def jsonify(data, **kwargs):
|
||||
raise UnicodeError('Invalid unicode encoding encountered')
|
||||
|
||||
|
||||
def missing_required_lib(library):
|
||||
def missing_required_lib(library, reason=None):
|
||||
hostname = platform.node()
|
||||
return "Failed to import the required Python library (%s) on %s's Python %s. Please read module documentation " \
|
||||
"and install in the appropriate location." % (library, hostname, sys.executable)
|
||||
msg = "Failed to import the required Python library (%s) on %s's Python %s." % (library, hostname, sys.executable)
|
||||
if reason:
|
||||
msg += " This is required %s." % reason
|
||||
|
||||
return msg + " Please read module documentation and install in the appropriate location"
|
||||
|
||||
|
||||
class AnsibleFallbackNotFound(Exception):
|
||||
|
||||
Reference in New Issue
Block a user