mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-28 10:24:45 +00:00
F401: Remove unused imports
This commit is contained in:
@@ -173,7 +173,6 @@ import os
|
|||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import ansible.constants as C
|
|
||||||
from ansible.parsing.yaml.loader import AnsibleLoader
|
from ansible.parsing.yaml.loader import AnsibleLoader
|
||||||
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
from ansible.errors import AnsibleError, AnsibleFileNotFound
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
from ansible.module_utils.six.moves import shlex_quote
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ from ansible_collections.community.kubernetes.plugins.module_utils.common import
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from openshift.dynamic import DynamicClient
|
|
||||||
from openshift.dynamic.exceptions import NotFoundError
|
from openshift.dynamic.exceptions import NotFoundError
|
||||||
HAS_K8S_MODULE_HELPER = True
|
HAS_K8S_MODULE_HELPER = True
|
||||||
k8s_import_exception = None
|
k8s_import_exception = None
|
||||||
@@ -210,12 +209,6 @@ except ImportError as e:
|
|||||||
HAS_K8S_MODULE_HELPER = False
|
HAS_K8S_MODULE_HELPER = False
|
||||||
k8s_import_exception = e
|
k8s_import_exception = e
|
||||||
|
|
||||||
try:
|
|
||||||
import yaml
|
|
||||||
HAS_YAML = True
|
|
||||||
except ImportError:
|
|
||||||
HAS_YAML = False
|
|
||||||
|
|
||||||
|
|
||||||
class KubernetesLookup(K8sAnsibleMixin):
|
class KubernetesLookup(K8sAnsibleMixin):
|
||||||
|
|
||||||
@@ -226,11 +219,6 @@ class KubernetesLookup(K8sAnsibleMixin):
|
|||||||
"Requires the OpenShift Python client. Try `pip install openshift`. Detail: {0}".format(k8s_import_exception)
|
"Requires the OpenShift Python client. Try `pip install openshift`. Detail: {0}".format(k8s_import_exception)
|
||||||
)
|
)
|
||||||
|
|
||||||
if not HAS_YAML:
|
|
||||||
raise Exception(
|
|
||||||
"Requires PyYAML. Try `pip install PyYAML`"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.kind = None
|
self.kind = None
|
||||||
self.name = None
|
self.name = None
|
||||||
self.namespace = None
|
self.namespace = None
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ except ImportError:
|
|||||||
# Exceptions handled in common
|
# Exceptions handled in common
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
|
||||||
import kubernetes_validate
|
|
||||||
HAS_KUBERNETES_VALIDATE = True
|
|
||||||
except ImportError:
|
|
||||||
HAS_KUBERNETES_VALIDATE = False
|
|
||||||
|
|
||||||
K8S_CONFIG_HASH_IMP_ERR = None
|
K8S_CONFIG_HASH_IMP_ERR = None
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ import traceback
|
|||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from ansible_collections.community.kubernetes.plugins.module_utils.common import AUTH_ARG_SPEC, COMMON_ARG_SPEC
|
from ansible_collections.community.kubernetes.plugins.module_utils.common import AUTH_ARG_SPEC
|
||||||
from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule
|
from ansible_collections.community.kubernetes.plugins.module_utils.raw import KubernetesRawModule
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user