Isolate creating service users
The code for creating service users is almost exactly the same. Abstract
this into a function that can be reused and standardized.
Change-Id: I3a4edbff0a928da7ef9b0097a5a8d508fdfab7ff
diff --git a/lib/cinder b/lib/cinder
index 937689a..12ba51e 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -330,14 +330,10 @@
# Migrated from keystone_data.sh
function create_cinder_accounts {
- local service_tenant=$(openstack project list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
- local admin_role=$(openstack role list | awk "/ admin / { print \$2 }")
-
# Cinder
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
- local cinder_user=$(get_or_create_user "cinder" "$SERVICE_PASSWORD")
- get_or_add_user_role $admin_role $cinder_user $service_tenant
+ create_service_user "cinder" "admin"
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then