Browse Source

Install python-redis if coordination url uses it

If tooz coordination is enabled and url is using redis
lets ensure python-redis is installed.

Change-Id: Iefe933f45353810200ec9c76ffc92f051db7a5e6
changes/51/433951/5
Pradeep Kilambi 6 years ago committed by Emilien Macchi
parent
commit
e50308cc6d
  1. 6
      manifests/evaluator.pp
  2. 2
      manifests/params.pp
  3. 4
      releasenotes/notes/install-python-redis-d695b95171f6c392.yaml
  4. 13
      spec/classes/aodh_evaluator_spec.rb

6
manifests/evaluator.pp

@ -31,6 +31,12 @@ class aodh::evaluator (
aodh_config {
'coordination/backend_url' : value => $coordination_url;
}
if ($coordination_url =~ /^redis/ ) {
ensure_resource('package', 'python-redis', {
name => $::aodh::params::redis_package_name,
tag => 'openstack',
})
}
}
ensure_resource( 'package', [$::aodh::params::evaluator_package_name],

2
manifests/params.pp

@ -24,6 +24,7 @@ class aodh::params {
$listener_service_name = 'openstack-aodh-listener'
$aodh_wsgi_script_path = '/var/www/cgi-bin/aodh'
$aodh_wsgi_script_source = '/usr/lib/python2.7/site-packages/aodh/api/app.wsgi'
$redis_package_name = 'python-redis'
}
'Debian': {
$common_package_name = 'aodh-common'
@ -43,6 +44,7 @@ class aodh::params {
$listener_service_name = 'aodh-listener'
$aodh_wsgi_script_path = '/usr/lib/cgi-bin/aodh'
$aodh_wsgi_script_source = '/usr/share/aodh/app.wsgi'
$redis_package_name = 'python-redis'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")

4
releasenotes/notes/install-python-redis-d695b95171f6c392.yaml

@ -0,0 +1,4 @@
---
fixes:
- Install python-redis if the coordination backend url is redis. This is
an indirect dependency on evaluator coordination to work.

13
spec/classes/aodh_evaluator_spec.rb

@ -20,6 +20,13 @@ describe 'aodh::evaluator' do
it 'configures backend_url' do
is_expected.to contain_aodh_config('coordination/backend_url').with_value('redis://localhost:6379')
end
it 'installs python-redis package' do
is_expected.to contain_package(platform_params[:redis_package_name]).with(
:name => platform_params[:redis_package_name],
:tag => 'openstack'
)
end
end
context 'when enabled' do
@ -98,10 +105,12 @@ describe 'aodh::evaluator' do
case facts[:osfamily]
when 'Debian'
{ :evaluator_package_name => 'aodh-evaluator',
:evaluator_service_name => 'aodh-evaluator' }
:evaluator_service_name => 'aodh-evaluator',
:redis_package_name => 'python-redis' }
when 'RedHat'
{ :evaluator_package_name => 'openstack-aodh-evaluator',
:evaluator_service_name => 'openstack-aodh-evaluator' }
:evaluator_service_name => 'openstack-aodh-evaluator',
:redis_package_name => 'python-redis' }
end
end
it_configures 'aodh-evaluator'

Loading…
Cancel
Save