From 00506c687c57e2e73db4a8a3ae556f9722ecc5f1 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 22 Feb 2018 15:16:05 -0700 Subject: [PATCH] Gracefully handle OS_TENANT_NAME If OS_TENANT_NAME is not defined but OS_PROJECT_NAME is defined, quietly set OS_TENANT_NAME=OS_PROJECT_NAME as to not just fail. Since quickstart relies on os_tenant_name all over the place but the newer clouds are Keystone v3 which does not require os_tenant_name, let's not have the reproducer just fail if we can gracefully continue. Change-Id: Ie508c7a9723f6eca3616c9b6b5b6795582a8c121 Related-Bug: #1750455 --- .../templates/reproducer-quickstart.sh.j2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 index 46429f556..9e8656ebb 100644 --- a/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 +++ b/roles/create-reproducer-script/templates/reproducer-quickstart.sh.j2 @@ -43,8 +43,13 @@ set -e # Check that tenant credentials have been sourced if [[ ! -v OS_TENANT_NAME ]]; then - echo "Tenant credentials are not sourced." - exit 1; + # TODO(aschultz): work around for LP#1750455 + if [[ -v OS_PROJECT_NAME ]]; then + export OS_TENANT_NAME=$OS_PROJECT_NAME + else + echo "Tenant credentials are not sourced." + exit 1; + fi fi # Input argument assignments