authtoken cannot manage python-memcache on RedHat

The keystone::resource::authtoken define does not
have access to the keystone::params class so it
used the package resource title as package name
when trying to install.

This resulted in the non-existing python-memcache
package failed to install on RedHat based systems.

This includes the params class inside the define
so it gets access to the python_memcache_package_name
variable.

Change-Id: I3470292d87620db717251092fbacf16b2cace571
Closes-Bug: 1711437
This commit is contained in:
Tobias Urdin 2018-04-25 16:53:02 +02:00 committed by Alex Schultz
parent 73f863e21c
commit f9cac1faf7
4 changed files with 31 additions and 2 deletions

View File

@ -14,7 +14,13 @@ class keystone::params {
$package_name = 'keystone'
$service_name = 'keystone'
$keystone_wsgi_script_path = '/usr/lib/cgi-bin/keystone'
$python_memcache_package_name = 'python-memcache'
if $::os_package_type == 'debian' {
$python_memcache_package_name = 'python3-memcache'
} else {
$python_memcache_package_name = 'python-memcache'
}
$mellon_package_name = 'libapache2-mod-auth-mellon'
$openidc_package_name = 'libapache2-mod-auth-openidc'
}

View File

@ -254,6 +254,7 @@ define keystone::resource::authtoken(
$auth_uri = undef,
) {
include ::keystone::params
include ::keystone::deps
if $auth_uri {

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixed bug where it would select the wrong memcache python binding package
name when installing on RedHat based operating systems.
Deployments settings the manage_memcache_package to true is now working as intended.

View File

@ -152,7 +152,7 @@ describe 'keystone::resource::authtoken' do
is_expected.to contain_keystone_config('keystone_authtoken/memcache_pool_dead_retry').with_value( params[:memcache_pool_dead_retry] )
is_expected.to contain_keystone_config('keystone_authtoken/memcache_pool_conn_get_timeout').with_value( params[:memcache_pool_conn_get_timeout] )
is_expected.to contain_package('python-memcache').with(
:name => 'python-memcache',
:name => platform_params[:memcache_package_name],
:ensure => 'present'
)
end
@ -185,6 +185,22 @@ describe 'keystone::resource::authtoken' do
facts.merge!(OSDefaults.get_facts())
end
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian' then
memcache_package_name = 'python3-memcache'
else
memcache_package_name = 'python-memcache'
end
when 'RedHat'
memcache_package_name = 'python-memcached'
end
{
:memcache_package_name => memcache_package_name
}
end
include_examples 'shared examples'
end
end