Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2190308

Summary: [OSP 16.2] upload-swift-artifacts not able to properly fetch Swift's internal endpoint url
Product: Red Hat OpenStack Reporter: Flavio Piccioni <fpiccion>
Component: openstack-tripleo-commonAssignee: Nobody <nobody>
Status: CLOSED ERRATA QA Contact: David Rosenfeld <drosenfe>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: jslagle, mburns, slinaber
Target Milestone: z6Keywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-common-11.7.1-2.20230711015219.6371211.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 19:18:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Flavio Piccioni 2023-04-27 21:26:55 UTC
Description of problem:

/usr/bin/upload-swift-artifacts fetches Swift's internal endpoint url by using following syntax:

# This works with newer openstackclient which displays the endpoints in list
SWIFT_INTERNAL_URL=$(openstack endpoint list | grep swift | grep internal | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|" || true)

if [ -z "$SWIFT_INTERNAL_URL" ]; then
    # fallback to old openstack client 'show' which displays all the URLs
    SWIFT_INTERNAL_URL=$(openstack endpoint show swift | grep internalurl | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|")
fi

This will lead to problems (with newer openstackclient which displays the endpoints in list) in case endpoints urls contain "internal" string, like in the example:

(undercloud) [stack@undercloud ~]$ openstack endpoint list | grep swift | grep internal
| 78e4f1f5225a413b92eaf1e589bda3e8 | regionOne | swift            | object-store              | True    | internal  | http://ip:8080/v1/AUTH_%(tenant_id)s                              |
| 87c0880f07b045f1a473e1a1051b30bf | regionOne | swift            | object-store              | True    | public    | https://public.undercloud.internal:13808/v1/AUTH_%(tenant_id)s |



Version-Release number of selected component (if applicable):
RHOSP 16.2
python3-tripleo-common-11.7.1-2.20230308005004.99d0f05.el8ost.noarch


Steps to Reproduce:
1. configure different swift's endpoints containing "internal" string 
2. invoke 'upload-swift-artifacts' (in this specific case customer is running 'upload-puppet module' to install a 3d party tool like TrilioVault)
3. verify the DeployArtifactURLs section in the created /home/stack/.tripleo/environments/puppet-modules-url.yaml

Actual results:
an invalid /home/stack/.tripleo/environments/puppet-modules-url.yaml will be created

Expected results:
/usr/bin/upload-swift-artifacts being able to properly get SWIFT_INTERNAL_URL

Additional info:

maybe this could be a possible workaround:
SWIFT_INTERNAL_URL=$(openstack endpoint list --interface internal --service swift -c URL -f value | sed -e "s|.*\(http.*\)://\([^/]*\)/.*|\1://\2|" || true)

Comment 9 errata-xmlrpc 2023-11-08 19:18:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.2.6 (Train) bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6307