Inherit pyvers from openstacklib::defaults

Depends-On: I84b767921d151a61429b2c89e6372c4b447f0d7d
Depends-On: I6769ae262cbe112c63c14b43acbbcdff13ea5e16
Change-Id: I65bd5fe3660afb218ffdab9837f42ea322307e61
This commit is contained in:
Lee Yarwood 2019-01-11 13:12:23 +00:00 committed by Tobias Urdin
parent a5c0041421
commit abbef3e120
3 changed files with 5 additions and 15 deletions

View File

@ -2,13 +2,7 @@
#
class aodh::params {
include ::openstacklib::defaults
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$pyvers = '3'
} else {
$pyvers = ''
}
$pyvers = $::openstacklib::defaults::pyvers
$client_package_name = "python${pyvers}-aodhclient"
$group = 'aodh'

View File

@ -10,7 +10,7 @@ describe 'aodh::client' do
it 'installs aodh client package' do
is_expected.to contain_package('python-aodhclient').with(
:ensure => 'present',
:name => 'python-aodhclient',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
end
@ -27,11 +27,7 @@ describe 'aodh::client' do
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian'
{ :client_package_name => 'python3-aodhclient' }
else
{ :client_package_name => 'python-aodhclient' }
end
{ :client_package_name => 'python3-aodhclient' }
when 'RedHat'
{ :client_package_name => 'python-aodhclient' }
end

View File

@ -22,7 +22,7 @@ describe 'aodh::evaluator' do
end
it 'installs python-redis package' do
is_expected.to contain_package(platform_params[:redis_package_name]).with(
is_expected.to contain_package('python-redis').with(
:name => platform_params[:redis_package_name],
:tag => 'openstack'
)
@ -116,7 +116,7 @@ describe 'aodh::evaluator' do
when 'Debian'
{ :evaluator_package_name => 'aodh-evaluator',
:evaluator_service_name => 'aodh-evaluator',
:redis_package_name => 'python-redis' }
:redis_package_name => 'python3-redis' }
when 'RedHat'
{ :evaluator_package_name => 'openstack-aodh-evaluator',
:evaluator_service_name => 'openstack-aodh-evaluator',