commit 353d7cb279d91fe48a73ccdfcddf99f87f511316 Author: Fabian Bermel Date: Mon Mar 9 14:42:34 2020 +0100 Checks for heat_user_domain explicitly The script should check for heat_user_domain explicitly instead of matching on "heat" Closes-Bug: #1839824 Change-Id: Iac83444487d2aa96a0f90086029f43922d1e7856 (cherry picked from commit 5e946cac490077011709c7587dc5e0b06927464f) diff --git a/docker/heat/heat-api/extend_start.sh b/docker/heat/heat-api/extend_start.sh index 8106cc5..ba5f145 100644 --- a/docker/heat/heat-api/extend_start.sh +++ b/docker/heat/heat-api/extend_start.sh @@ -4,13 +4,15 @@ # of the KOLLA_BOOTSTRAP variable being set, including empty. if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then heat-manage db_sync - CURRENT_HEAT_DOMAIN_NAME=$(openstack domain list | grep heat | awk '{print $4}') - if [[ "heat_user_domain" != "$CURRENT_HEAT_DOMAIN_NAME" ]]; then + EXISTING_DOMAINS=$(openstack domain list -f value -c Name) + + if ! echo "$EXISTING_DOMAINS" | grep '^heat_user_domain$' &>/dev/null; then openstack domain create heat_user_domain openstack user create --domain heat_user_domain heat_domain_admin --password ${HEAT_DOMAIN_ADMIN_PASSWORD} openstack role add --domain heat_user_domain --user-domain heat_user_domain --user heat_domain_admin admin fi + exit 0 fi