From 580ead284fbaf6d4b5c6cfd42eea3c59b41df391 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 17 Jan 2019 21:30:39 +0100 Subject: [PATCH] Inherit pyvers from openstacklib::defaults Change-Id: I4d27bbbb16f87cf0051f1bbed2429e1c8affd14c --- manifests/params.pp | 12 +++--------- spec/classes/glare_client_spec.rb | 6 +----- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 3e0597c..f0d1010 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,13 +2,7 @@ # class glare::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 $group = 'glare' $client_package_name = "python${pyvers}-glareclient" @@ -18,9 +12,9 @@ class glare::params { $glare_package_name = 'openstack-glare' $glare_service_name = 'openstack-glare-api' if ($::operatingsystem != 'fedora' and versioncmp($::operatingsystemrelease, '7') < 0) { - $pyceph_package_name = 'python-ceph' + $pyceph_package_name = "python${pyvers}-ceph" } else { - $pyceph_package_name = 'python-rbd' + $pyceph_package_name = "python${pyvers}-rbd" } } 'Debian': { diff --git a/spec/classes/glare_client_spec.rb b/spec/classes/glare_client_spec.rb index 3ce64f8..6c40ae9 100644 --- a/spec/classes/glare_client_spec.rb +++ b/spec/classes/glare_client_spec.rb @@ -27,11 +27,7 @@ describe 'glare::client' do let(:platform_params) do case facts[:osfamily] when 'Debian' - if facts[:os_package_type] == 'debian' - { :client_package_name => 'python3-glareclient' } - else - { :client_package_name => 'python-glareclient' } - end + { :client_package_name => 'python3-glareclient' } when 'RedHat' { :client_package_name => 'python-glareclient' } end