Skip to content

Commit 57729d5

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Always cache tokens in a shared memcache"
2 parents c52836b + 5997ce3 commit 57729d5

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

files/debs/keystone

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
libkrb5-dev
22
libldap2-dev
33
libsasl2-dev
4+
memcached
45
python-mysqldb
56
sqlite3

files/rpms-suse/keystone

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cyrus-sasl-devel
2+
memcached
23
openldap2-devel
34
sqlite3

files/rpms/keystone

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
memcached
12
mod_ssl
23
MySQL-python
34
sqlite

lib/keystone

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)