From f5e9ca889942455d8bfcbc49824dd475d547cd38 Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Mon, 15 Jul 2013 13:50:33 +0300 Subject: python-cinder: Use the identity to get credentials The credentials are defined in the identity bbclass and the recipe will set them in the configuration files. Signed-off-by: Mihai Prica --- .../python/python-cinder/api-paste.ini | 62 ---------------------- .../python/python-cinder_2013.1.1.bb | 15 ++++-- 2 files changed, 10 insertions(+), 67 deletions(-) delete mode 100644 meta-openstack/recipes-devtools/python/python-cinder/api-paste.ini (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-cinder/api-paste.ini b/meta-openstack/recipes-devtools/python/python-cinder/api-paste.ini deleted file mode 100644 index 69cf346..0000000 --- a/meta-openstack/recipes-devtools/python/python-cinder/api-paste.ini +++ /dev/null @@ -1,62 +0,0 @@ -############# -# OpenStack # -############# - -[composite:osapi_volume] -use = call:cinder.api:root_app_factory -/: apiversions -/v1: openstack_volume_api_v1 -/v2: openstack_volume_api_v2 - -[composite:openstack_volume_api_v1] -use = call:cinder.api.middleware.auth:pipeline_factory -noauth = faultwrap sizelimit noauth apiv1 -keystone = faultwrap sizelimit authtoken keystonecontext apiv1 -keystone_nolimit = faultwrap sizelimit authtoken keystonecontext apiv1 - -[composite:openstack_volume_api_v2] -use = call:cinder.api.middleware.auth:pipeline_factory -noauth = faultwrap sizelimit noauth apiv2 -keystone = faultwrap sizelimit authtoken keystonecontext apiv2 -keystone_nolimit = faultwrap sizelimit authtoken keystonecontext apiv2 - -[filter:faultwrap] -paste.filter_factory = cinder.api.middleware.fault:FaultWrapper.factory - -[filter:noauth] -paste.filter_factory = cinder.api.middleware.auth:NoAuthMiddleware.factory - -[filter:sizelimit] -paste.filter_factory = cinder.api.middleware.sizelimit:RequestBodySizeLimiter.factory - -[app:apiv1] -paste.app_factory = cinder.api.v1.router:APIRouter.factory - -[app:apiv2] -paste.app_factory = cinder.api.v2.router:APIRouter.factory - -[pipeline:apiversions] -pipeline = faultwrap osvolumeversionapp - -[app:osvolumeversionapp] -paste.app_factory = cinder.api.versions:Versions.factory - -########## -# Shared # -########## - -[filter:keystonecontext] -paste.filter_factory = cinder.api.middleware.auth:CinderKeystoneContext.factory - -[filter:authtoken] -paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory -service_protocol = http -service_host = 127.0.0.1 -service_port = 5000 -auth_host = 127.0.0.1 -auth_port = 35357 -auth_protocol = http -admin_tenant_name = service -admin_user = cinder -admin_password = password -signing_dir = /var/lib/cinder diff --git a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.1.bb b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.1.bb index 90d712c..e3d2b7e 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_2013.1.1.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_2013.1.1.bb @@ -9,7 +9,6 @@ SRCNAME = "cinder" SRC_URI = "https://launchpad.net/${SRCNAME}/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ file://cinder.conf \ - file://api-paste.ini \ file://cinder.init \ " @@ -18,17 +17,23 @@ SRC_URI[sha256sum] = "c4d7f508f404b555242abc638901a39b02d4345c2d101a0aaad52fec11 S = "${WORKDIR}/${SRCNAME}-${PV}" -inherit setuptools update-rc.d +inherit setuptools update-rc.d identity do_install_append() { - CINDER_CONF_DIR=${D}${sysconfdir}/cinder + TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} + CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME} - install -d ${CINDER_CONF_DIR} + sed -e "s:%SERVICE_TENANT_NAME%:${SERVICE_TENANT_NAME}:g" \ + ${TEMPLATE_CONF_DIR}/api-paste.ini > ${WORKDIR}/api-paste.ini + sed -e "s:%SERVICE_USER%:${SRCNAME}:g" -i ${WORKDIR}/api-paste.ini + sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ + -i ${WORKDIR}/api-paste.ini + install -d ${CINDER_CONF_DIR} install -m 600 ${WORKDIR}/cinder.conf ${CINDER_CONF_DIR}/ install -m 600 ${WORKDIR}/api-paste.ini ${CINDER_CONF_DIR}/ install -m 600 ${S}/etc/cinder/policy.json ${CINDER_CONF_DIR}/ - + if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then install -d ${D}${sysconfdir}/init.d sed 's:@suffix@:api:' < ${WORKDIR}/cinder.init >${WORKDIR}/cinder-api.init.sh -- cgit v1.2.3-54-g00ecf