Browse Source

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
changes/53/795553/3 19.1.0
Thomas Goirand 4 months ago
committed by Takashi Kajinami
parent
commit
508fc7adde
  1. 5
      manifests/defaults.pp
  2. 3
      manifests/params.pp
  3. 6
      spec/classes/openstacklib_openstackclient_spec.rb

5
manifests/defaults.pp

@ -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'
}
}

3
manifests/params.pp

@ -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': {

6
spec/classes/openstacklib_openstackclient_spec.rb

@ -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

Loading…
Cancel
Save