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,
Union,
)
import traceback
try:
from kubernetes.dynamic.resource import ResourceField
from kubernetes.dynamic.exceptions import DynamicApiError
except ImportError:
HAS_K8S = False
K8S_IMPORT_ERROR = traceback.format_exc()
else:
HAS_K8S = True
K8S_IMPORT_ERROR = None
class ResourceField:
pass
class DynamicApiError(Exception):
pass
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable