Refactor os distro/version check in client ut
... so that we can easilty understand which distro and which version we expect python3 packages. Change-Id: I385a4a5b123519961791ef6d842ab84990ea00c9
This commit is contained in:
@@ -32,15 +32,20 @@ describe 'openstacklib::openstackclient' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
if facts[:osfamily] == 'Debian' or (facts[:os_package_type] == 'rpm' \
|
case facts[:osfamily]
|
||||||
and facts[:operatingsystemrelease].to_i > 7) then
|
when 'Debian'
|
||||||
openstackclient_package_name = 'python3-openstackclient'
|
{ :openstackclient_package_name => 'python3-openstackclient' }
|
||||||
else
|
when 'RedHat'
|
||||||
openstackclient_package_name = 'python-openstackclient'
|
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
|
end
|
||||||
{
|
|
||||||
:openstackclient_package_name => openstackclient_package_name
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'openstacklib::openstackclient'
|
it_behaves_like 'openstacklib::openstackclient'
|
||||||
|
Reference in New Issue
Block a user