Skip to content

Commit

Permalink
handling if 'ansible.errors' could not be imported
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jul 25, 2023
1 parent 05225ca commit 1ea4e5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/module_utils/base/handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from ansible.errors import AnsibleModuleError
try:
from ansible.errors import AnsibleModuleError

except ModuleNotFoundError:
class AnsibleModuleError(Exception):
pass

MODULE_EXCEPTIONS = (ModuleNotFoundError, ImportError)

Expand Down

0 comments on commit 1ea4e5f

Please sign in to comment.