inventory: Provide dummy classes to satisfy Ansible sanity

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2023-07-17 14:24:27 +02:00
parent 68f5cc8e33
commit 9bc8d20ea6

View File

@@ -166,17 +166,18 @@ from typing import (
Tuple, Tuple,
Union, Union,
) )
import traceback
try: try:
from kubernetes.dynamic.resource import ResourceField from kubernetes.dynamic.resource import ResourceField
from kubernetes.dynamic.exceptions import DynamicApiError from kubernetes.dynamic.exceptions import DynamicApiError
except ImportError: except ImportError:
HAS_K8S = False
K8S_IMPORT_ERROR = traceback.format_exc() class ResourceField:
else: pass
HAS_K8S = True
K8S_IMPORT_ERROR = None class DynamicApiError(Exception):
pass
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable