mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-08 05:52:37 +00:00
k8s: handle `fail_json` API from inventory plugin (#59)
Fixes: https://github.com/ansible-collections/kubernetes.core/issues/57
This commit is contained in:
@@ -117,8 +117,11 @@ connections:
|
||||
import json
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import K8sAnsibleMixin, HAS_K8S_MODULE_HELPER, k8s_import_exception
|
||||
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
|
||||
K8sAnsibleMixin, HAS_K8S_MODULE_HELPER, k8s_import_exception
|
||||
)
|
||||
from ansible_collections.community.kubernetes.plugins.module_utils.exceptions import K8sInventoryException
|
||||
|
||||
try:
|
||||
from openshift.dynamic.exceptions import DynamicApiError
|
||||
@@ -137,10 +140,6 @@ def format_dynamic_api_exc(exc):
|
||||
return '%s Reason: %s' % (exc.status, exc.reason)
|
||||
|
||||
|
||||
class K8sInventoryException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleMixin):
|
||||
NAME = 'community.kubernetes.k8s'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user