From 386f41de04d35926c4de70aa0aa6ba0b6ca1a356 Mon Sep 17 00:00:00 2001 From: David Vallee Delisle Date: Tue, 25 May 2021 15:36:46 -0400 Subject: [PATCH] [train-only] Inventory doesn't contain admin password This breaks the get_swift_client function that uses a password auth_type. We should instead use the token stored in the inventory. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1962225 Change-Id: Ib53632c30c8eb9f7ebc4dc59043cb51bcb8b81a0 --- tripleo_validations/utils.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tripleo_validations/utils.py b/tripleo_validations/utils.py index 182d353ad..c94bc7b9a 100644 --- a/tripleo_validations/utils.py +++ b/tripleo_validations/utils.py @@ -62,11 +62,15 @@ def get_auth_session(auth_variables): def get_swift_client(auth_variables): - return Connection(authurl=auth_variables.get('auth_url'), - user=auth_variables.get('username'), - key=auth_variables.get('password'), - auth_version='3', - tenant_name=auth_variables.get('project_name')) + password = auth_variables.get('password') + if password: + return Connection(authurl=auth_variables.get('auth_url'), + user=auth_variables.get('username'), + key=password, + auth_version='3', + tenant_name=auth_variables.get('project_name')) + return Connection(preauthurl=auth_variables.get('undercloud_swift_url'), + preauthtoken=auth_variables.get('os_auth_token')) def get_nova_client(auth_variables):