@@ -430,6 +430,7 @@ function configure_auth_token_middleware {
430430 iniset $conf_file $section auth_uri $KEYSTONE_SERVICE_URI
431431 iniset $conf_file $section cafile $SSL_BUNDLE_FILE
432432 iniset $conf_file $section signing_dir $signing_dir
433+ iniset $conf_file $section memcache_servers $SERVICE_HOST :11211
433434}
434435
435436# init_keystone() - Initialize databases, etc.
@@ -483,6 +484,9 @@ function install_keystonemiddleware {
483484 # When not installing from repo, keystonemiddleware is still needed...
484485 pip_install_gr keystonemiddleware
485486 fi
487+ # Install the memcache library so keystonemiddleware can cache tokens in a
488+ # shared location.
489+ pip_install_gr python-memcached
486490}
487491
488492# install_keystone() - Collect source and prepare
@@ -491,17 +495,7 @@ function install_keystone {
491495 if is_service_enabled ldap; then
492496 install_ldap
493497 fi
494- if [[ " $KEYSTONE_TOKEN_BACKEND " = " memcache" ]]; then
495- # Install memcached and the memcache Python library that keystone uses.
496- # Unfortunately the Python library goes by different names in the .deb
497- # and .rpm circles.
498- install_package memcached
499- if is_ubuntu; then
500- install_package python-memcache
501- else
502- install_package python-memcached
503- fi
504- fi
498+
505499 git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
506500 setup_develop $KEYSTONE_DIR
507501
@@ -550,6 +544,9 @@ function start_keystone {
550544 start_tls_proxy ' *' $KEYSTONE_SERVICE_PORT $KEYSTONE_SERVICE_HOST $KEYSTONE_SERVICE_PORT_INT &
551545 start_tls_proxy ' *' $KEYSTONE_AUTH_PORT $KEYSTONE_AUTH_HOST $KEYSTONE_AUTH_PORT_INT &
552546 fi
547+
548+ # (re)start memcached to make sure we have a clean memcache.
549+ restart_service memcached
553550}
554551
555552# stop_keystone() - Stop running processes
0 commit comments