From e77e5b2f6141f738adf625cfa564e60a57634ba2 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 13 Apr 2016 20:22:31 +0000 Subject: [PATCH] * Fixed endpoint creation that was buggy: it was using keystone admin auth token which we removed for Mitaka (Closes: #820844). Rewritten-From: 176328de76075e70f92c97e09bee5e1e85a42f28 --- xenial/debian/changelog | 9 ++++- xenial/debian/cinder-api.postinst.in | 59 +++++++++++++++------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/xenial/debian/changelog b/xenial/debian/changelog index c30a5a858..e4baccb8d 100644 --- a/xenial/debian/changelog +++ b/xenial/debian/changelog @@ -1,8 +1,13 @@ -cinder (2:8.0.0-2) UNRELEASED; urgency=medium +cinder (2:8.0.0-2) unstable; urgency=medium + [ Ondřej Nový ] * Standards-Version is 3.9.8 now (no change) - -- Ondřej Nový Sat, 09 Apr 2016 19:22:09 +0200 + [ Thomas Goirand ] + * Fixed endpoint creation that was buggy: it was using keystone admin auth + token which we removed for Mitaka (Closes: #820844). + + -- Thomas Goirand Wed, 13 Apr 2016 20:21:03 +0000 cinder (2:8.0.0-1) unstable; urgency=medium diff --git a/xenial/debian/cinder-api.postinst.in b/xenial/debian/cinder-api.postinst.in index 7cea903d6..ebb262fd1 100644 --- a/xenial/debian/cinder-api.postinst.in +++ b/xenial/debian/cinder-api.postinst.in @@ -14,33 +14,43 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then # Setup the v1 endpoint db_get ${PKG_NAME}/keystone-ip KEYSTONE_ENDPOINT_IP=`echo ${RET} | egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'` - db_get ${PKG_NAME}/keystone-auth-token - AUTH_TOKEN=${RET} db_get ${PKG_NAME}/endpoint-ip PKG_ENDPOINT_IP=`echo ${RET} | egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'` db_get ${PKG_NAME}/region-name REGION_NAME=${RET} + db_get ${PKG_NAME}/keystone-project-name + KEYSTONE_PROJECT_NAME=${RET} + db_get ${PKG_NAME}/keystone-admin-name + KEYSTONE_ADMIN_NAME=${RET} + db_get ${PKG_NAME}/keystone-admin-password + KEYSTONE_ADMIN_PASSWORD=${RET} + + if [ -n "${KEYSTONE_ENDPOINT_IP}" ] && [ -n "${PKG_ENDPOINT_IP}" ] && [ -n "${REGION_NAME}" ] && [ -n "${KEYSTONE_PROJECT_NAME}" ] && [ -n "${KEYSTONE_ADMIN_NAME}" ] && [ -n "${KEYSTONE_ADMIN_PASSWORD}" ] ; then + export OS_PROJECT_DOMAIN_ID=default + export OS_USER_DOMAIN_ID=default + export OS_TENANT_NAME=${KEYSTONE_PROJECT_NAME} + export OS_PROJECT_NAME=${KEYSTONE_PROJECT_NAME} + export OS_USERNAME=${KEYSTONE_ADMIN_NAME} + export OS_PASSWORD=${KEYSTONE_ADMIN_PASSWORD} + export OS_AUTH_URL=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ + export OS_IDENTITY_API_VERSION=3 + export OS_AUTH_VERSION=3 + export OS_PROJECT_DOMAIN_ID=default + export OS_USER_DOMAIN_ID=default + export OS_NO_CACHE=1 - if [ -n "${KEYSTONE_ENDPOINT_IP}" ] && [ -n "${PKG_ENDPOINT_IP}" ] && [ -n "${REGION_NAME}" ] && [ -n "${AUTH_TOKEN}" ] ; then SERVICE_NAME=cinder SERVICE_TYPE=volume SERVICE_DESC="OpenStack Block Storage" SERVICE_PORT=8776 SERVICE_URL=/v1/'%(tenant_id)s' echo "Registering service and endpoints for ${SERVICE_NAME} with type ${SERVICE_TYPE} at http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}" - NUM_LINES=$(openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l) + NUM_LINES=$(openstack service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l) if [ "${NUM_LINES}" = "0" ] ; then - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service create \ - --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack service create --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} fi SERVICE_NAME=cinderv2 @@ -49,19 +59,12 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then SERVICE_PORT=8776 SERVICE_URL=/v2/'%(tenant_id)s' echo "Registering service and endpoints for ${SERVICE_NAME} with type ${SERVICE_TYPE} at http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL}" - NUM_LINES=$(openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l) + NUM_LINES=$(openstack service list --format=csv | q -d , -H 'SELECT ID FROM - WHERE `Type`="'${SERVICE_TYPE}'"' | wc -l) if [ "${NUM_LINES}" = "0" ] ; then - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 service create \ - --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} - - openstack --os-token ${AUTH_TOKEN} --os-url=http://${KEYSTONE_ENDPOINT_IP}:35357/v3/ --os-domain-name default --os-identity-api-version=3 endpoint create \ - --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack service create --name=${SERVICE_NAME} --description="${SERVICE_DESC}" ${SERVICE_TYPE} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} public http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} internal http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} + openstack endpoint create --region "${REGION_NAME}" ${SERVICE_NAME} admin http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} fi # pkgos_register_endpoint_postinst cinder cinder volume "Cinder Volume Service" 8776 /v1/'%(tenant_id)s' # pkgos_register_endpoint_postinst cinder cinderv2 volumev2 "Cinder Volume Service" 8776 /v2/'%(tenant_id)s' @@ -72,7 +75,7 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then else echo "Will not register "${SERVICE_NAME}" endpoint this time (no user request for it)." fi - db_unregister ${PKG_NAME}/keystone-auth-token + db_unregister ${PKG_NAME}/keystone-admin-password db_stop fi -- 2.45.2