From f25ab8fb11b6d61ac340ed55d11338111132d2cd Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Thu, 16 Dec 2021 12:21:44 +0100 Subject: [PATCH] Remove surplus function for getting lb client. In this patch we removing function which can be replaced by directly getting openstacksdk client from cached clients, instead of calling a function which would fetch it for us. Change-Id: I4e8aba09b40b1b6070632c9e4f9077159c756b96 --- kuryr_kubernetes/clients.py | 6 +----- kuryr_kubernetes/tests/unit/test_clients.py | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/kuryr_kubernetes/clients.py b/kuryr_kubernetes/clients.py index cb5207193..e72666126 100644 --- a/kuryr_kubernetes/clients.py +++ b/kuryr_kubernetes/clients.py @@ -42,12 +42,8 @@ def get_network_client(): return _clients[_OPENSTACKSDK].network -def get_openstacksdk(): - return _clients[_OPENSTACKSDK] - - def get_loadbalancer_client(): - return get_openstacksdk().load_balancer + return _clients[_OPENSTACKSDK].load_balancer def get_kubernetes_client() -> k8s_client.K8sClient: diff --git a/kuryr_kubernetes/tests/unit/test_clients.py b/kuryr_kubernetes/tests/unit/test_clients.py index 7fb8efa37..46f25a872 100644 --- a/kuryr_kubernetes/tests/unit/test_clients.py +++ b/kuryr_kubernetes/tests/unit/test_clients.py @@ -44,7 +44,6 @@ class TestK8sClient(test_base.TestCase): m_k8s.assert_called_with(k8s_api_root) self.assertIs(k8s_dummy, clients.get_kubernetes_client()) - self.assertIs(openstacksdk_mock, clients.get_openstacksdk()) self.assertIs(openstacksdk_mock.load_balancer, clients.get_loadbalancer_client()) self.assertIs(openstacksdk_mock.network,