mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Bubble up import exception content for k8s module (#50657)
* Bubble up import exception content for k8s module Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us> * Track down other places import exception is reported * Add changelog fragment
This commit is contained in:
parent
35caebd036
commit
09bfe42a5c
4 changed files with 13 additions and 6 deletions
|
@ -111,7 +111,7 @@ connections:
|
|||
import json
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils.k8s.common import K8sAnsibleMixin, HAS_K8S_MODULE_HELPER
|
||||
from ansible.module_utils.k8s.common import K8sAnsibleMixin, HAS_K8S_MODULE_HELPER, k8s_import_exception
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
|
||||
|
||||
try:
|
||||
|
@ -151,7 +151,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleM
|
|||
|
||||
if not HAS_K8S_MODULE_HELPER:
|
||||
raise K8sInventoryException(
|
||||
"This module requires the OpenShift Python client. Try `pip install openshift`"
|
||||
"This module requires the OpenShift Python client. Try `pip install openshift`. Detail: {0}".format(k8s_import_exception)
|
||||
)
|
||||
|
||||
source_data = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue