diff --git a/spec/classes/gnocchi_client_spec.rb b/spec/classes/gnocchi_client_spec.rb index 03733770..5571d5af 100644 --- a/spec/classes/gnocchi_client_spec.rb +++ b/spec/classes/gnocchi_client_spec.rb @@ -27,7 +27,15 @@ describe 'gnocchi::client' do when 'Debian' { :client_package_name => 'python3-gnocchiclient' } when 'RedHat' - { :client_package_name => 'python-gnocchiclient' } + if facts[:operatingsystem] == 'Fedora' + { :client_package_name => 'python3-gnocchiclient' } + else + if facts[:operatingsystemmajrelease] > '7' + { :client_package_name => 'python3-gnocchiclient' } + else + { :client_package_name => 'python-gnocchiclient' } + end + end end end diff --git a/spec/classes/gnocchi_init_spec.rb b/spec/classes/gnocchi_init_spec.rb index 19b9b72b..16b1ddbc 100644 --- a/spec/classes/gnocchi_init_spec.rb +++ b/spec/classes/gnocchi_init_spec.rb @@ -71,9 +71,21 @@ describe 'gnocchi' do :redis_package_name => 'python3-redis' } when 'RedHat' - { :gnocchi_common_package => 'gnocchi-common', - :redis_package_name => 'python-redis' - } + if facts[:operatingsystem] == 'Fedora' + { :gnocchi_common_package => 'gnocchi-common', + :redis_package_name => 'python3-redis' + } + else + if facts[:operatingsystemmajrelease] > '7' + { :gnocchi_common_package => 'gnocchi-common', + :redis_package_name => 'python3-redis' + } + else + { :gnocchi_common_package => 'gnocchi-common', + :redis_package_name => 'python-redis' + } + end + end end end it_behaves_like 'gnocchi'