From 28da7f63d3c37459d4366f6b38a6107e842657ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Tue, 14 Jun 2022 14:56:12 +0200 Subject: [PATCH] Use proper ApiException from kubernetes client Seems like folks developing Python kubernetes client had move the ApiException around. So the backward-compatible way of using it is kubernetes.client.rest.ApiException and trying to use it by kubernetes.client.excetpions.ApiException will not work in older library versions. As this client is supposed to still be compatible with stable/victoria and kubernetes==11.0.0, this commit changes the exception module to `rest` where needed. Change-Id: If056529d49a053970891f89d12007174f544a551 --- kuryr_tempest_plugin/tests/scenario/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index d84fb9fb..1296ac51 100644 --- a/kuryr_tempest_plugin/tests/scenario/base.py +++ b/kuryr_tempest_plugin/tests/scenario/base.py @@ -218,7 +218,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): name=pod_name, body=body, namespace=namespace) - except kubernetes.client.exceptions.ApiException as e: + except kubernetes.client.rest.ApiException as e: if e.status != 404: raise LOG.debug("Pod %s was not found.", pod_name) @@ -229,7 +229,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): pod_name, namespace) time.sleep(5) - except kubernetes.client.exceptions.ApiException as e: + except kubernetes.client.rest.ApiException as e: if e.status != 404: LOG.warning("An exception occured: %s", e) break