#!/bin/bash

# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# 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
        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 heat_domain_admin admin
        openstack role create heat_stack_owner
        openstack role create heat_stack_user
    fi
    exit 0
fi

#!/bin/bash

# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# 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
        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
        openstack role create heat_stack_owner
        openstack role create heat_stack_user
    fi
    exit 0
fi

Add --user-domain when adding heat role admin
Add --user-domain when adding heat role admin

The --user-domain parameter is required when adding the role for
Heat.  Without it, the command fails and the bootstrap
container exits early with the error message:

"No user with a name or ID of 'heat_domain_admin' exists."

Change-Id: I6f813edde3f437bca3ef521a43454146082bc5f5
Closes-bug: #1611768
Signed-off-by: Dave Walker (Daviey) <a88b7dcd1a9e3e17770bbaa6d7515b31a2d7e85d@daviey.com>
