From da7851a2e13e9b410313d9bb3752049d7688be53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 7 Mar 2024 18:40:58 +0100 Subject: [PATCH] Patchet OpenStack client to ignore incorrectly listed endpoint for compute on a cloud provider --- .../src/uds/services/OpenStack/openstack/openstack_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/uds/services/OpenStack/openstack/openstack_client.py b/server/src/uds/services/OpenStack/openstack/openstack_client.py index c5da4083c..b15800827 100644 --- a/server/src/uds/services/OpenStack/openstack/openstack_client.py +++ b/server/src/uds/services/OpenStack/openstack/openstack_client.py @@ -199,7 +199,7 @@ class Client: # pylint: disable=too-many-public-methods def _getEndpointFor( - self, *type_: str + self, *type_: str, ) -> str: # If no region is indicatad, first endpoint is returned def inner_get(for_type: str) -> str: if not self._catalog: @@ -207,7 +207,8 @@ class Client: # pylint: disable=too-many-public-methods for i in filter(lambda v: v['type'] == for_type, self._catalog): for j in filter(lambda v: v['interface'] == self._access, i['endpoints']): if not self._region or j['region'] == self._region: - return j['url'] + if 'myhuaweicloud.eu/V1.0' not in j['url']: + return j['url'] raise Exception('No endpoint url found') for t in type_: try: