From f9afc8fa1e81077352dc8e36c30abd3d100d09c3 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 17 Jan 2019 21:49:27 +0100 Subject: [PATCH] Inherit pyvers from openstacklib::defaults Change-Id: I77a1eef4c2c9403c4cf37417030d8bc24281bc02 --- manifests/params.pp | 8 +------- spec/classes/panko_client_spec.rb | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index a0df1bb..08d5e13 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,13 +2,7 @@ # class panko::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 $client_package_name = "python${pyvers}-pankoclient" $group = 'panko' diff --git a/spec/classes/panko_client_spec.rb b/spec/classes/panko_client_spec.rb index 0eca2ce..88a3466 100644 --- a/spec/classes/panko_client_spec.rb +++ b/spec/classes/panko_client_spec.rb @@ -27,11 +27,7 @@ describe 'panko::client' do let(:platform_params) do case facts[:osfamily] when 'Debian' - if facts[:os_package_type] == 'debian' - { :client_package_name => 'python3-pankoclient' } - else - { :client_package_name => 'python-pankoclient' } - end + { :client_package_name => 'python3-pankoclient' } when 'RedHat' { :client_package_name => 'python-pankoclient' } end