Merge "Refactor os distro/version check in client ut"

This commit is contained in:
Zuul 2020-04-01 17:55:03 +00:00 committed by Gerrit Code Review
commit 60b6455598
1 changed files with 13 additions and 8 deletions

View File

@ -32,15 +32,20 @@ describe 'openstacklib::openstackclient' do
end
let(:platform_params) do
if facts[:osfamily] == 'Debian' or (facts[:os_package_type] == 'rpm' \
and facts[:operatingsystemrelease].to_i > 7) then
openstackclient_package_name = 'python3-openstackclient'
else
openstackclient_package_name = 'python-openstackclient'
case facts[:osfamily]
when 'Debian'
{ :openstackclient_package_name => 'python3-openstackclient' }
when 'RedHat'
if facts[:operatingsystem] == 'Fedora'
{ :openstackclient_package_name => 'python3-openstackclient' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :openstackclient_package_name => 'python3-openstackclient' }
else
{ :openstackclient_package_name => 'python-openstackclient' }
end
end
end
{
:openstackclient_package_name => openstackclient_package_name
}
end
it_behaves_like 'openstacklib::openstackclient'