From 08e8ae079790d4b3074476fe6a30e6a5371a2eaf Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Thu, 9 Dec 2021 12:40:38 +0100 Subject: [PATCH] Pass configured endpoint type to sahara client Change-Id: I8136409020a7251ae1015129236b0e3d2d20a51b Story: 2009735 Task: 44157 (cherry picked from commit 693624c9afbc3a02d24abb926baace7ea1ada6f3) --- sahara_dashboard/api/sahara.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sahara_dashboard/api/sahara.py b/sahara_dashboard/api/sahara.py index a96597ad..f233431f 100644 --- a/sahara_dashboard/api/sahara.py +++ b/sahara_dashboard/api/sahara.py @@ -95,6 +95,7 @@ def safe_call(func, *args, **kwargs): def client(request): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) cacert = getattr(settings, 'OPENSTACK_SSL_CACERT', None) + endpoint_type = getattr(settings, 'OPENSTACK_ENDPOINT_TYPE', 'publicURL') auth = identity.Token(auth_url=request.user.endpoint, token=request.user.token.id, project_id=request.user.project_id) @@ -106,7 +107,8 @@ def client(request): sess = session.Session(auth=auth, verify=verify) return api_client.Client(VERSIONS.get_active_version()["version"], service_type=SAHARA_SERVICE, - session=sess) + session=sess, + endpoint_type=endpoint_type) def prepare_acl_update_dict(is_public=None, is_protected=None):