diff --git a/lib/ceilometer b/lib/ceilometer index 4030aca9a1..340acb92ea 100644 --- a/lib/ceilometer +++ b/lib/ceilometer @@ -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/" \ diff --git a/lib/glance b/lib/glance index 78e5e8813c..1dea6cf29b 100644 --- a/lib/glance +++ b/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" \ diff --git a/lib/sahara b/lib/sahara index 70feacd45a..05ef4a8938 100644 --- a/lib/sahara +++ b/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" \ diff --git a/lib/trove b/lib/trove index 6877d0f505..db9af1dfc8 100644 --- a/lib/trove +++ b/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