Install dependency python-memcache when token driver memcache.

Token driver backends.memcache requires python-memcache which not
installed by default. As result keystone crash with exception.

Patch install python-memcache when it's need.

Change-Id: I752a97ad9b3135a7336265760f0cd3304e0277b4
This commit is contained in:
Semyon Deviatkin 2014-07-06 13:36:20 +00:00
parent 4a64086038
commit 1cdd7a2197
3 changed files with 21 additions and 8 deletions

View File

@ -366,6 +366,13 @@ class keystone(
'DEFAULT/admin_endpoint': ensure => absent; 'DEFAULT/admin_endpoint': ensure => absent;
} }
} }
# requirements for memcache token driver
if ($token_driver =~ /memcache/ ) {
package { 'python-memcache':
ensure => present,
name => $::keystone::params::python_memcache_package_name,
}
}
# token driver config # token driver config
keystone_config { keystone_config {

View File

@ -6,9 +6,10 @@ class keystone::params {
case $::osfamily { case $::osfamily {
'Debian': { 'Debian': {
$package_name = 'keystone' $package_name = 'keystone'
$service_name = 'keystone' $service_name = 'keystone'
$keystone_wsgi_script_path = '/usr/lib/cgi-bin/keystone' $keystone_wsgi_script_path = '/usr/lib/cgi-bin/keystone'
$python_memcache_package_name = 'python-memcache'
case $::operatingsystem { case $::operatingsystem {
'Debian': { 'Debian': {
$service_provider = undef $service_provider = undef
@ -21,11 +22,12 @@ class keystone::params {
} }
} }
'RedHat': { 'RedHat': {
$package_name = 'openstack-keystone' $package_name = 'openstack-keystone'
$service_name = 'openstack-keystone' $service_name = 'openstack-keystone'
$keystone_wsgi_script_path = '/var/www/cgi-bin/keystone' $keystone_wsgi_script_path = '/var/www/cgi-bin/keystone'
$service_provider = undef $python_memcache_package_name = 'python-memcached'
$keystone_wsgi_script_source = 'puppet:///modules/keystone/httpd/keystone.py' $service_provider = undef
$keystone_wsgi_script_source = 'puppet:///modules/keystone/httpd/keystone.py'
} }
} }
} }

View File

@ -315,6 +315,10 @@ describe 'keystone' do
end end
it { should contain_keystone_config("memcache/servers").with_value('SERVER1:11211,SERVER2:11211') } it { should contain_keystone_config("memcache/servers").with_value('SERVER1:11211,SERVER2:11211') }
it { should contain_package('python-memcache').with(
:name => 'python-memcache',
:ensure => 'present'
) }
end end
describe 'do not configure memcache servers when not set' do describe 'do not configure memcache servers when not set' do