From 81e85845f0007057c3d7df1ef7d5ae830cb934b9 Mon Sep 17 00:00:00 2001 From: Jorge Saffe Date: Fri, 21 Jul 2023 11:53:05 -0400 Subject: [PATCH] Fix OS_AUTH_URL included in OpenStack RC file When the OpenStack RC file is exported from Horizon, the URL in the OS_AUTH_URL variable does not include the /v3 API version. When the system is configured in secure mode (HTTPS enabled), an error is generated during the login process when trying to use any of the StarlingX CLIs (platform, fm, sw-manager, etc). This issue can be resolved by appending the API version to the OS_AUTH_URL. Test Plan: PASS: Log-in Horizon, download openrc.sh file. Using a remote CLI: PASS: source downloaded openrc.sh file. PASS: Test Platform CLI (ej: system host-list) PASS: Test FM CLI (ej: fm alarm-list) PASS: Test sw-manager CLI (ej: sw-manager patch-strategy show) PASS: Enable secure-mode (HTTPS with Self-Signed Certificate) PASS: Log-in Horizon, download openrc.sh file. Using a remote CLI: PASS: source downloaded openrc.sh file. PASS: Test Platform CLI (ej: system host-list) PASS: Test FM CLI (ej: fm alarm-list) PASS: Test sw-manager CLI (ej: sw-manager patch-strategy show) Closes-Bug: 1998949 Change-Id: I5c678a6ad89f9d5e56356189962e8c09d3ffa6c5 Signed-off-by: Jorge Saffe --- .../starlingx_templates/starlingx-openrc.sh.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/starlingx_templates/starlingx-openrc.sh.template b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/starlingx_templates/starlingx-openrc.sh.template index cc4394e0..9bb0e7a2 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/starlingx_templates/starlingx-openrc.sh.template +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/starlingx_templates/starlingx-openrc.sh.template @@ -2,7 +2,7 @@ {% load align_auth_url %} # -# Copyright (c) 2020 Wind River Systems, Inc. +# Copyright (c) 2023 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -18,9 +18,9 @@ # Image API v1.1, Block Storage API v2, and Compute API v2.0. OS_AUTH_URL is # only for the Identity API served through keystone. {% if region == 'SystemController' %} -export OS_AUTH_URL={{ auth_url|align_auth_url }} +export OS_AUTH_URL={{ auth_url|align_auth_url }}/v{{ os_identity_api_version }} {% else %} -export OS_AUTH_URL={{ auth_url }} +export OS_AUTH_URL={{ auth_url }}/v{{ os_identity_api_version }} {% endif %} # With the addition of Keystone we have standardized on the term **project**