From 73d867a12c126a9f9c0abd84fa1570dee6a27ce6 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Thu, 13 Nov 2014 09:01:48 +0100 Subject: [PATCH] Use keystonemiddleware and manila.conf for config Switch to keystonemiddleware so a full keystoneclient installation is no longer required. Also move the configuration parameters for auth_token from api-paste.ini to manila.conf. api-paste.ini configuration can still be used and take priority over parameters from manila.conf. Finally adjust devstack lib and use manila.conf to configure auth_token. Related-Bug: #1240753 Change-Id: I4317ffca174a0f73dddc7030b367d49130040c77 --- contrib/devstack/lib/manila | 15 ++++++++------- etc/manila/api-paste.ini | 12 +----------- etc/oslo-config-generator/manila.conf | 1 + requirements.txt | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/contrib/devstack/lib/manila b/contrib/devstack/lib/manila index c7c35d21a1..32d33829eb 100644 --- a/contrib/devstack/lib/manila +++ b/contrib/devstack/lib/manila @@ -154,17 +154,18 @@ function configure_manila { sudo mv $TEMPFILE /etc/sudoers.d/manila-rootwrap cp $MANILA_DIR/etc/manila/api-paste.ini $MANILA_API_PASTE_INI - iniset $MANILA_API_PASTE_INI filter:authtoken auth_host $KEYSTONE_AUTH_HOST - iniset $MANILA_API_PASTE_INI filter:authtoken auth_port $KEYSTONE_AUTH_PORT - iniset $MANILA_API_PASTE_INI filter:authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL - iniset $MANILA_API_PASTE_INI filter:authtoken admin_tenant_name $SERVICE_TENANT_NAME - iniset $MANILA_API_PASTE_INI filter:authtoken admin_user manila - iniset $MANILA_API_PASTE_INI filter:authtoken admin_password $SERVICE_PASSWORD - iniset $MANILA_API_PASTE_INI filter:authtoken signing_dir $MANILA_AUTH_CACHE_DIR # Remove old conf file if exists rm -f $MANILA_CONF + iniset $MANILA_CONF keystone_authtoken auth_host $KEYSTONE_AUTH_HOST + iniset $MANILA_CONF keystone_authtoken auth_port $KEYSTONE_AUTH_PORT + iniset $MANILA_CONF keystone_authtoken auth_protocol $KEYSTONE_AUTH_PROTOCOL + iniset $MANILA_CONF keystone_authtoken admin_tenant_name $SERVICE_TENANT_NAME + iniset $MANILA_CONF keystone_authtoken admin_user manila + iniset $MANILA_CONF keystone_authtoken admin_password $SERVICE_PASSWORD + iniset $MANILA_CONF keystone_authtoken signing_dir $MANILA_AUTH_CACHE_DIR + iniset $MANILA_CONF DEFAULT auth_strategy keystone iniset $MANILA_CONF DEFAULT debug True iniset $MANILA_CONF DEFAULT verbose True diff --git a/etc/manila/api-paste.ini b/etc/manila/api-paste.ini index 22948b2a62..e3f19e3baa 100644 --- a/etc/manila/api-paste.ini +++ b/etc/manila/api-paste.ini @@ -39,14 +39,4 @@ paste.app_factory = manila.api.versions:Versions.factory paste.filter_factory = manila.api.middleware.auth:ManilaKeystoneContext.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_TENANT_NAME% -admin_user = %SERVICE_USER% -admin_password = %SERVICE_PASSWORD% -signing_dir = /var/lib/manila +paste.filter_factory = keystonemiddleware.auth_token:filter_factory diff --git a/etc/oslo-config-generator/manila.conf b/etc/oslo-config-generator/manila.conf index 858b75df07..5ce7fd6399 100644 --- a/etc/oslo-config-generator/manila.conf +++ b/etc/oslo-config-generator/manila.conf @@ -4,3 +4,4 @@ namespace = manila namespace = oslo.messaging namespace = oslo.db namespace = oslo.db.concurrency +namespace = keystonemiddleware.auth_token diff --git a/requirements.txt b/requirements.txt index 8fa7999ce4..e015654d5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,7 +27,7 @@ Paste PasteDeploy>=1.5.0 posix_ipc python-neutronclient>=2.3.6,<3 -python-keystoneclient>=0.11.1 +keystonemiddleware>=1.0.0 Routes>=1.12.3,!=2.0 six>=1.7.0 SQLAlchemy>=0.8.4,<=0.8.99,>=0.9.7,<=0.9.99