From 1d20a58af369f8f5c431e6ab17e36b6584e568b3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 31 Mar 2020 16:06:23 +0900 Subject: [PATCH] Expect python3 client package in CentOS8 In CentOS, we expect to have python3 client package in 8.x while we expect to have python2 in 7.x . Fix unit tests to expect the correct version according to os major version. Change-Id: I1150ec8cd0a683d855030e1f75893677be1d9652 --- spec/classes/cinder_client_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/classes/cinder_client_spec.rb b/spec/classes/cinder_client_spec.rb index fc3b18b7..ed4d5e6f 100644 --- a/spec/classes/cinder_client_spec.rb +++ b/spec/classes/cinder_client_spec.rb @@ -43,7 +43,15 @@ describe 'cinder::client' do when 'Debian' { :client_package_name => 'python3-cinderclient' } when 'RedHat' - { :client_package_name => 'python-cinderclient' } + if facts[:operatingsystem] == 'Fedora' + { :client_package_name => 'python3-cinderclient' } + else + if facts[:operatingsystemmajrelease] > '7' + { :client_package_name => 'python3-cinderclient' } + else + { :client_package_name => 'python-cinderclient' } + end + end end end