SelfSubjectAccessReviews now work with the k8s module (#237)

* SelfSubjectAccessReviews now work with the k8s module
This commit is contained in:
Fabian von Feilitzsch
2020-09-28 12:20:01 -04:00
committed by GitHub
parent 5de49373b7
commit 0f3fef927e
3 changed files with 25 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ try:
from openshift.dynamic import DynamicClient
from openshift.dynamic.exceptions import (
ResourceNotFoundError, ResourceNotUniqueError, NotFoundError, DynamicApiError,
ConflictError, ForbiddenError)
ConflictError, ForbiddenError, MethodNotAllowedError)
HAS_K8S_MODULE_HELPER = True
k8s_import_exception = None
except ImportError as e:
@@ -610,7 +610,7 @@ class K8sAnsibleMixin(object):
if namespace:
params['namespace'] = namespace
existing = resource.get(**params)
except NotFoundError:
except (NotFoundError, MethodNotAllowedError):
# Remove traceback so that it doesn't show up in later failures
try:
sys.exc_clear()