From 1bfde40b436c921f5aad01ecb71fb3fd6647af9a Mon Sep 17 00:00:00 2001 From: Fabricio Henrique Ramos Date: Thu, 26 May 2022 15:51:35 -0300 Subject: [PATCH] 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 Change-Id: I1c055e970996ff90a7a09d1b07ae718110a4fa8d --- sysinv/sysinv/sysinv/sysinv/common/kubernetes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/common/kubernetes.py b/sysinv/sysinv/sysinv/sysinv/common/kubernetes.py index ec2ceacd6b..c8b315b4dd 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/kubernetes.py +++ b/sysinv/sysinv/sysinv/sysinv/common/kubernetes.py @@ -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 "