From faaaa4a7736423c9f5f6be239aef48ee7dc8ed9b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 10 Apr 2020 00:38:11 +0900 Subject: [PATCH] Expect python3 package in CentOS8 and Fedora In CentOS 8.x and Fedora, we expect to have python3 package, while we expect to have python2 in 7.x . Fix unit tests to expect the correct version according to os major version. Change-Id: I298706690ee73db76678653841514de120c61e27 --- spec/classes/horizon_init_spec.rb | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/spec/classes/horizon_init_spec.rb b/spec/classes/horizon_init_spec.rb index 6fb8c37a..43ae18c8 100644 --- a/spec/classes/horizon_init_spec.rb +++ b/spec/classes/horizon_init_spec.rb @@ -765,12 +765,30 @@ describe 'horizon' do } end when 'RedHat' - { :config_file => '/etc/openstack-dashboard/local_settings', - :package_name => 'openstack-dashboard', - :root_url => '/dashboard', - :root_path => '/usr/share/openstack-dashboard', - :memcache_package => 'python-memcached', - } + if facts[:operatingsystem] == 'Fedora' + { :config_file => '/etc/openstack-dashboard/local_settings', + :package_name => 'openstack-dashboard', + :root_url => '/dashboard', + :root_path => '/usr/share/openstack-dashboard', + :memcache_package => 'python3-memcached', + } + else + if facts[:operatingsystemmajrelease] > '7' + { :config_file => '/etc/openstack-dashboard/local_settings', + :package_name => 'openstack-dashboard', + :root_url => '/dashboard', + :root_path => '/usr/share/openstack-dashboard', + :memcache_package => 'python3-memcached', + } + else + { :config_file => '/etc/openstack-dashboard/local_settings', + :package_name => 'openstack-dashboard', + :root_url => '/dashboard', + :root_path => '/usr/share/openstack-dashboard', + :memcache_package => 'python-memcached', + } + end + end end end