Get rid of the $pyvers variable

Since everyone has switched to Python3, it's time for the removal of the
$pyvers variable.

Change-Id: I371ef3a2e257e6d197238e7e9cbfd9d445405be5
This commit is contained in:
Thomas Goirand 2021-06-09 16:20:08 +02:00 committed by Takashi Kajinami
parent de68e1eace
commit 508fc7adde
3 changed files with 2 additions and 12 deletions

View File

@ -7,23 +7,18 @@
class openstacklib::defaults {
if ($::os['family'] == 'Debian') {
$pyvers = '3'
$pyver3 = '3'
} elsif $::os['family'] == 'RedHat' {
if Integer.new($::os['release']['major']) > 8 {
$pyvers = '3'
$pyver3 = '3.9'
} elsif Integer.new($::os['release']['major']) == 8 {
$pyvers = '3'
$pyver3 = '3.6'
} else {
$pyvers = ''
$pyver3 = '2.7'
}
} else {
# TODO(tkajinam) This is left to keep the previous behavior but we should
# revisit this later.
$pyvers = ''
$pyver3 = '2.7'
}
}

View File

@ -6,9 +6,8 @@
class openstacklib::params {
include openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$openstackclient_package_name = "python${pyvers}-openstackclient"
$openstackclient_package_name = 'python3-openstackclient'
case $::osfamily {
'RedHat': {

View File

@ -36,11 +36,7 @@ describe 'openstacklib::openstackclient' do
when 'Debian'
{ :openstackclient_package_name => 'python3-openstackclient' }
when 'RedHat'
if facts[:operatingsystemmajrelease] > '7'
{ :openstackclient_package_name => 'python3-openstackclient' }
else
{ :openstackclient_package_name => 'python-openstackclient' }
end
{ :openstackclient_package_name => 'python3-openstackclient' }
end
end