diff --git a/manifests/params.pp b/manifests/params.pp index 69f2b2b8..8c0e4480 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,8 +5,11 @@ # class openstacklib::params { - $openstackclient_package_name = $::os_package_type ? { - 'debian' => 'python3-openstackclient', - default => 'python-openstackclient', + if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or + ($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) { + $pyvers = '3' + } else { + $pyvers = '' } + $openstackclient_package_name = "python${pyvers}-openstackclient" } diff --git a/spec/classes/openstacklib_openstackclient_spec.rb b/spec/classes/openstacklib_openstackclient_spec.rb index 201db1d8..6ef48055 100644 --- a/spec/classes/openstacklib_openstackclient_spec.rb +++ b/spec/classes/openstacklib_openstackclient_spec.rb @@ -35,7 +35,8 @@ describe 'openstacklib::openstackclient' do end let(:platform_params) do - if facts[:os_package_type] == 'debian' then + if facts[:os_package_type] == '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'