mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Add helper function to return helpful import error msg (#47409)
This commit is contained in:
parent
f28b7c7ab1
commit
ddfd1dbfc6
3 changed files with 22 additions and 15 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue