diff --git a/spec/classes/openstacklib_openstackclient_spec.rb b/spec/classes/openstacklib_openstackclient_spec.rb index 29b984a4..f6c5d490 100644 --- a/spec/classes/openstacklib_openstackclient_spec.rb +++ b/spec/classes/openstacklib_openstackclient_spec.rb @@ -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'