Merge "Users in service group should not have email addresses"

This commit is contained in:
Jenkins 2014-07-23 14:06:50 +00:00 committed by Gerrit Code Review
commit 1ecd43da54
13 changed files with 19 additions and 14 deletions

View File

@ -723,8 +723,13 @@ function policy_add {
}
# Gets or creates user
# Usage: get_or_create_user <username> <password> <project> <email>
# Usage: get_or_create_user <username> <password> <project> [<email>]
function get_or_create_user {
if [[ ! -z "$4" ]]; then
local EMAIL="--email=$4"
else
local EMAIL=""
fi
# Gets user id
USER_ID=$(
# Gets user id
@ -734,7 +739,7 @@ function get_or_create_user {
$1 \
--password "$2" \
--project $3 \
--email $4 \
$EMAIL \
-f value -c id
)
echo $USER_ID

View File

@ -85,7 +85,7 @@ create_ceilometer_accounts() {
# Ceilometer
if [[ "$ENABLED_SERVICES" =~ "ceilometer-api" ]]; then
CEILOMETER_USER=$(get_or_create_user "ceilometer" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "ceilometer@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $CEILOMETER_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -323,7 +323,7 @@ function create_cinder_accounts {
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
CINDER_USER=$(get_or_create_user "cinder" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "cinder@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $CINDER_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -166,7 +166,7 @@ function create_glance_accounts {
if is_service_enabled g-api; then
GLANCE_USER=$(get_or_create_user "glance" \
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME "glance@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT_NAME)
get_or_add_user_role service $GLANCE_USER $SERVICE_TENANT_NAME
# required for swift access

View File

@ -217,7 +217,7 @@ function create_heat_accounts {
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
HEAT_USER=$(get_or_create_user "heat" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "heat@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $HEAT_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -221,7 +221,7 @@ function create_ironic_accounts {
# Get ironic user if exists
IRONIC_USER=$(get_or_create_user "ironic" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "ironic@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $IRONIC_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -330,7 +330,7 @@ function create_keystone_accounts {
# admin
ADMIN_TENANT=$(get_or_create_project "admin")
ADMIN_USER=$(get_or_create_user "admin" \
"$ADMIN_PASSWORD" "$ADMIN_TENANT" "admin@example.com")
"$ADMIN_PASSWORD" "$ADMIN_TENANT")
ADMIN_ROLE=$(get_or_create_role "admin")
get_or_add_user_role $ADMIN_ROLE $ADMIN_USER $ADMIN_TENANT

View File

@ -179,7 +179,7 @@ function create_marconi_accounts {
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
MARCONI_USER=$(get_or_create_user "marconi" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "marconi@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $MARCONI_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -362,7 +362,7 @@ function create_neutron_accounts {
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
NEUTRON_USER=$(get_or_create_user "neutron" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "neutron@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $NEUTRON_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -335,7 +335,7 @@ create_nova_accounts() {
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
NOVA_USER=$(get_or_create_user "nova" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "nova@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $NOVA_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -61,7 +61,7 @@ function create_sahara_accounts {
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
SAHARA_USER=$(get_or_create_user "sahara" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "sahara@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $SAHARA_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -550,7 +550,7 @@ function create_swift_accounts {
ADMIN_ROLE=$(openstack role list | awk "/ admin / { print \$2 }")
SWIFT_USER=$(get_or_create_user "swift" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "swift@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $ADMIN_ROLE $SWIFT_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then

View File

@ -83,7 +83,7 @@ function create_trove_accounts {
if [[ "$ENABLED_SERVICES" =~ "trove" ]]; then
TROVE_USER=$(get_or_create_user "trove" \
"$SERVICE_PASSWORD" $SERVICE_TENANT "trove@example.com")
"$SERVICE_PASSWORD" $SERVICE_TENANT)
get_or_add_user_role $SERVICE_ROLE $TROVE_USER $SERVICE_TENANT
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then