debian: update python-kubernetes function calls

On Debian, a newer version of python-kubernetes is used, and it has
some function definitions changes, mainly, for some functions,
the argument 'body' is no longer a positional argument, these have
been updated to work on both OS's.

Test Plan:
CentOS/Debian
PASS: Controller unlocked/enabled/available
PASS: System application upload/apply/remove/delete

Closes-Bug: 1976010

Signed-off-by: Fabricio Henrique Ramos <fabriciohenrique.ramos@windriver.com>
Change-Id: I1c055e970996ff90a7a09d1b07ae718110a4fa8d
This commit is contained in:
Fabricio Henrique Ramos 2022-05-26 15:51:35 -03:00
parent bca406d163
commit 1bfde40b43
1 changed files with 7 additions and 7 deletions

View File

@ -511,7 +511,7 @@ class KubeOperator(object):
c = self._get_kubernetesclient_core()
try:
return c.delete_namespaced_secret(name, namespace, body)
return c.delete_namespaced_secret(name, namespace, body=body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
LOG.warn("Secret %s under Namespace %s "
@ -532,7 +532,7 @@ class KubeOperator(object):
c = self._get_kubernetesclient_core()
try:
c.delete_namespace(namespace, body)
c.delete_namespace(namespace, body=body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
LOG.warn("Namespace %s not found." % namespace)
@ -607,7 +607,7 @@ class KubeOperator(object):
c = self._get_kubernetesclient_core()
try:
c.delete_namespaced_config_map(name, namespace, body)
c.delete_namespaced_config_map(name, namespace, body=body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
LOG.warn("ConfigMap %s under Namespace %s "
@ -674,7 +674,7 @@ class KubeOperator(object):
try:
c.delete_namespaced_custom_object(group, version, namespace,
plural, name, body)
plural, name, body=body)
except ApiException as ex:
if ex.reason == "Not Found":
LOG.warn("Failed to delete custom object, Namespace %s: %s"
@ -874,7 +874,7 @@ class KubeOperator(object):
c = self._get_kubernetesclient_core()
try:
api_response = c.delete_namespaced_pod(name, namespace, body)
api_response = c.delete_namespaced_pod(name, namespace, body=body)
LOG.debug("%s" % api_response)
return True
except ApiException as e:
@ -958,7 +958,7 @@ class KubeOperator(object):
body.update(kwargs)
try:
c.delete_validating_webhook_configuration(name, body)
c.delete_validating_webhook_configuration(name, body=body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
LOG.warn("ValidatingWebhookConfiguration %s "
@ -995,7 +995,7 @@ class KubeOperator(object):
body.update(kwargs)
try:
c.delete_mutating_webhook_configuration(name, body)
c.delete_mutating_webhook_configuration(name, body=body)
except ApiException as e:
if e.status == httplib.NOT_FOUND:
LOG.warn("MutatingWebhookConfiguration %s "