mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Add helper function to return helpful import error msg (#47409)
This commit is contained in:
@@ -785,6 +785,12 @@ def jsonify(data, **kwargs):
|
||||
raise UnicodeError('Invalid unicode encoding encountered')
|
||||
|
||||
|
||||
def missing_required_lib(library):
|
||||
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)
|
||||
|
||||
|
||||
class AnsibleFallbackNotFound(Exception):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user