Remove logic for CentOS < 9

... because RDO supports CentOS Stream 9 (aka CentOS 9) only since Zed.

This also refactors the logic to determine the Python 3 version and
makes the openstacklib::default class hard-fail in unsupported OS
Families.

Change-Id: I9d1fa698356d7840e50edf9c975e3672be62e912
This commit is contained in:
Takashi Kajinami
2022-11-21 23:59:09 +09:00
parent eaf7c98ae4
commit 23fd613cbd

View File

@@ -5,20 +5,15 @@
# This file is loaded in the params.pp of each class.
#
class openstacklib::defaults {
if ($::os['family'] == 'Debian') {
$pyver3 = '3'
} elsif $::os['family'] == 'RedHat' {
if Integer.new($::os['release']['major']) > 8 {
case $::osfamily {
'RedHat': {
$pyver3 = '3.9'
} elsif Integer.new($::os['release']['major']) == 8 {
$pyver3 = '3.6'
} else {
$pyver3 = '2.7'
}
} else {
# TODO(tkajinam) This is left to keep the previous behavior but we should
# revisit this later.
$pyver3 = '2.7'
'Debian': {
$pyver3 = '3'
}
default:{
fail("Unsupported osfamily: ${::osfamily}")
}
}
}