Merge "Clean up local variable usage - Account setup"
This commit is contained in:
commit
dc85b3a772
@ -79,19 +79,19 @@ function is_ceilometer_enabled {
|
||||
|
||||
create_ceilometer_accounts() {
|
||||
|
||||
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
local admin_role=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
|
||||
# Ceilometer
|
||||
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
|
||||
CEILOMETER_USER=$(get_or_create_user "ceilometer" \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||
get_or_add_user_role $ADMIN_ROLE $CEILOMETER_USER $SERVICE_TENANT
|
||||
local ceilometer_user=$(get_or_create_user "ceilometer" \
|
||||
"$SERVICE_PASSWORD" $service_tenant)
|
||||
get_or_add_user_role $admin_role $ceilometer_user $service_tenant
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
CEILOMETER_SERVICE=$(get_or_create_service "ceilometer" \
|
||||
local ceilometer_service=$(get_or_create_service "ceilometer" \
|
||||
"metering" "OpenStack Telemetry Service")
|
||||
get_or_create_endpoint $CEILOMETER_SERVICE \
|
||||
get_or_create_endpoint $ceilometer_service \
|
||||
"$REGION_NAME" \
|
||||
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
|
||||
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
|
||||
|
12
lib/glance
12
lib/glance
@ -169,23 +169,23 @@ function configure_glance {
|
||||
function create_glance_accounts {
|
||||
if is_service_enabled g-api; then
|
||||
|
||||
GLANCE_USER=$(get_or_create_user "glance" \
|
||||
local glance_user=$(get_or_create_user "glance" \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME)
|
||||
get_or_add_user_role service $GLANCE_USER $SERVICE_TENANT_NAME
|
||||
get_or_add_user_role service $glance_user $SERVICE_TENANT_NAME
|
||||
|
||||
# required for swift access
|
||||
if is_service_enabled s-proxy; then
|
||||
|
||||
GLANCE_SWIFT_USER=$(get_or_create_user "glance-swift" \
|
||||
local glance_swift_user=$(get_or_create_user "glance-swift" \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME "glance-swift@example.com")
|
||||
get_or_add_user_role "ResellerAdmin" $GLANCE_SWIFT_USER $SERVICE_TENANT_NAME
|
||||
get_or_add_user_role "ResellerAdmin" $glance_swift_user $SERVICE_TENANT_NAME
|
||||
fi
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
|
||||
GLANCE_SERVICE=$(get_or_create_service "glance" \
|
||||
local glance_service=$(get_or_create_service "glance" \
|
||||
"image" "Glance Image Service")
|
||||
get_or_create_endpoint $GLANCE_SERVICE \
|
||||
get_or_create_endpoint $glance_service \
|
||||
"$REGION_NAME" \
|
||||
"http://$GLANCE_HOSTPORT" \
|
||||
"http://$GLANCE_HOSTPORT" \
|
||||
|
14
lib/sahara
14
lib/sahara
@ -57,18 +57,18 @@ TEMPEST_SERVICES+=,sahara
|
||||
# service sahara admin
|
||||
function create_sahara_accounts {
|
||||
|
||||
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
local admin_role=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
|
||||
SAHARA_USER=$(get_or_create_user "sahara" \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||
get_or_add_user_role $ADMIN_ROLE $SAHARA_USER $SERVICE_TENANT
|
||||
local sahara_user=$(get_or_create_user "sahara" \
|
||||
"$SERVICE_PASSWORD" $service_tenant)
|
||||
get_or_add_user_role $admin_role $sahara_user $service_tenant
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
|
||||
SAHARA_SERVICE=$(get_or_create_service "sahara" \
|
||||
local sahara_service=$(get_or_create_service "sahara" \
|
||||
"data_processing" "Sahara Data Processing")
|
||||
get_or_create_endpoint $SAHARA_SERVICE \
|
||||
get_or_create_endpoint $sahara_service \
|
||||
"$REGION_NAME" \
|
||||
"$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \
|
||||
"$SAHARA_SERVICE_PROTOCOL://$SAHARA_SERVICE_HOST:$SAHARA_SERVICE_PORT/v1.1/\$(tenant_id)s" \
|
||||
|
16
lib/trove
16
lib/trove
@ -76,21 +76,20 @@ function setup_trove_logging {
|
||||
# service trove admin # if enabled
|
||||
|
||||
function create_trove_accounts {
|
||||
# Trove
|
||||
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
SERVICE_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
|
||||
local service_role=$(openstack role list | awk "/ admin / { print \$2 }")
|
||||
|
||||
if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
|
||||
|
||||
TROVE_USER=$(get_or_create_user "trove" \
|
||||
"$SERVICE_PASSWORD" $SERVICE_TENANT)
|
||||
get_or_add_user_role $SERVICE_ROLE $TROVE_USER $SERVICE_TENANT
|
||||
local trove_user=$(get_or_create_user "trove" \
|
||||
"$SERVICE_PASSWORD" $service_tenant)
|
||||
get_or_add_user_role $service_role $trove_user $service_tenant
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
|
||||
TROVE_SERVICE=$(get_or_create_service "trove" \
|
||||
local trove_service=$(get_or_create_service "trove" \
|
||||
"database" "Trove Service")
|
||||
get_or_create_endpoint $TROVE_SERVICE \
|
||||
get_or_create_endpoint $trove_service \
|
||||
"$REGION_NAME" \
|
||||
"http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \
|
||||
"http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \
|
||||
@ -237,6 +236,7 @@ function start_trove {
|
||||
# stop_trove() - Stop running processes
|
||||
function stop_trove {
|
||||
# Kill the trove screen windows
|
||||
local serv
|
||||
for serv in tr-api tr-tmgr tr-cond; do
|
||||
screen_stop $serv
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user