Merge "Clean up local variable usage - Account setup"

This commit is contained in:
Jenkins 2014-08-23 08:25:35 +00:00 committed by Gerrit Code Review
commit dc85b3a772
4 changed files with 28 additions and 28 deletions

View File

@ -79,19 +79,19 @@ function is_ceilometer_enabled {
create_ceilometer_accounts() { create_ceilometer_accounts() {
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") local admin_role=$(openstack role list | awk "/ admin / { print \$2 }")
# Ceilometer # Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
CEILOMETER_USER=$(get_or_create_user "ceilometer" \ local ceilometer_user=$(get_or_create_user "ceilometer" \
"$SERVICE_PASSWORD" $SERVICE_TENANT) "$SERVICE_PASSWORD" $service_tenant)
get_or_add_user_role $ADMIN_ROLE $CEILOMETER_USER $SERVICE_TENANT get_or_add_user_role $admin_role $ceilometer_user $service_tenant
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then 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") "metering" "OpenStack Telemetry Service")
get_or_create_endpoint $CEILOMETER_SERVICE \ get_or_create_endpoint $ceilometer_service \
"$REGION_NAME" \ "$REGION_NAME" \
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \ "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \
"$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \ "$CEILOMETER_SERVICE_PROTOCOL://$CEILOMETER_SERVICE_HOST:$CEILOMETER_SERVICE_PORT/" \

View File

@ -169,23 +169,23 @@ function configure_glance {
function create_glance_accounts { function create_glance_accounts {
if is_service_enabled g-api; then 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) "$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 # required for swift access
if is_service_enabled s-proxy; then 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") "$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 fi
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then 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") "image" "Glance Image Service")
get_or_create_endpoint $GLANCE_SERVICE \ get_or_create_endpoint $glance_service \
"$REGION_NAME" \ "$REGION_NAME" \
"http://$GLANCE_HOSTPORT" \ "http://$GLANCE_HOSTPORT" \
"http://$GLANCE_HOSTPORT" \ "http://$GLANCE_HOSTPORT" \

View File

@ -57,18 +57,18 @@ TEMPEST_SERVICES+=,sahara
# service sahara admin # service sahara admin
function create_sahara_accounts { function create_sahara_accounts {
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }") local admin_role=$(openstack role list | awk "/ admin / { print \$2 }")
SAHARA_USER=$(get_or_create_user "sahara" \ local sahara_user=$(get_or_create_user "sahara" \
"$SERVICE_PASSWORD" $SERVICE_TENANT) "$SERVICE_PASSWORD" $service_tenant)
get_or_add_user_role $ADMIN_ROLE $SAHARA_USER $SERVICE_TENANT get_or_add_user_role $admin_role $sahara_user $service_tenant
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then 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") "data_processing" "Sahara Data Processing")
get_or_create_endpoint $SAHARA_SERVICE \ get_or_create_endpoint $sahara_service \
"$REGION_NAME" \ "$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" \
"$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" \

View File

@ -76,21 +76,20 @@ function setup_trove_logging {
# service trove admin # if enabled # service trove admin # if enabled
function create_trove_accounts { function create_trove_accounts {
# Trove local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
SERVICE_TENANT=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }") local service_role=$(openstack role list | awk "/ admin / { print \$2 }")
SERVICE_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
TROVE_USER=$(get_or_create_user "trove" \ local trove_user=$(get_or_create_user "trove" \
"$SERVICE_PASSWORD" $SERVICE_TENANT) "$SERVICE_PASSWORD" $service_tenant)
get_or_add_user_role $SERVICE_ROLE $TROVE_USER $SERVICE_TENANT get_or_add_user_role $service_role $trove_user $service_tenant
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
TROVE_SERVICE=$(get_or_create_service "trove" \ local trove_service=$(get_or_create_service "trove" \
"database" "Trove Service") "database" "Trove Service")
get_or_create_endpoint $TROVE_SERVICE \ get_or_create_endpoint $trove_service \
"$REGION_NAME" \ "$REGION_NAME" \
"http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \ "http://$SERVICE_HOST:8779/v1.0/\$(tenant_id)s" \
"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 # stop_trove() - Stop running processes
function stop_trove { function stop_trove {
# Kill the trove screen windows # Kill the trove screen windows
local serv
for serv in tr-api tr-tmgr tr-cond; do for serv in tr-api tr-tmgr tr-cond; do
screen_stop $serv screen_stop $serv
done done