From 61bfb58898815a37657a29d6a30809ba1411d09b Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Tue, 10 May 2022 09:32:36 +0200 Subject: [PATCH] Fix the crd_lb_ip not being defined. During execution it may happen, that there will be UnboundLocalError exception thrown for crd_lb_ip variable, due to unmet condition for service ip not being set in the KuryrLoadbalancerCRD. Fixed by simply defining variable. Change-Id: Ie879ba0b9b85111ec1b906d66ec48127ce8dd1f9 --- kuryr_tempest_plugin/tests/scenario/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index c5026051..d84fb9fb 100644 --- a/kuryr_tempest_plugin/tests/scenario/base.py +++ b/kuryr_tempest_plugin/tests/scenario/base.py @@ -594,6 +594,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): while time.time() - start < CONF.kuryr_kubernetes.lb_build_timeout: time.sleep(5) service = api.read_namespaced_service(service_name, namespace) + crd_lb_ip = None if service.status.load_balancer.ingress: try: klb_crd = cls.get_kuryr_loadbalancer_crds(