Files
Florence Blanc-Renaud 6ddd9d978a Upgrade: use openssl_engine on rhel9
The upgrade on RHEL9 needs to update /etc/sysconfig/ipa-dnskeysyncd
with DNSSEC_TOKENS_DIR and DNSSEC_SOFTHSM_PIN because those
environment variables are used by the systemd unit for ipa-dnskeysyncd.

Currently the upgrade skips this step because of a wrong comparison when
defining the constants:
HAS_PKCS11_OPENSSL_ENGINE = osinfo.version_number == (9,)

The above evaluates to false because osinfo.version_number is a tuple with
(9, minor_version).
Replace the comparison with osinfo.version_number[0] == 9 to make
sure that the upgrade code is properly called on RHEL 9.x

Fixes: https://pagure.io/freeipa/issue/9913
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2026-01-07 15:20:29 +01:00

41 lines
1.1 KiB
Python

#
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
'''
This RHEL base platform module exports platform related constants.
'''
# Fallback to default constant definitions
from __future__ import absolute_import
from ipaplatform.redhat.constants import (
RedHatConstantsNamespace, User, Group
)
from ipaplatform.osinfo import osinfo
# RHEL 7 and earlier use /etc/sysconfig/nfs
# RHEL 8 uses /etc/nfs.conf
HAS_NFS_CONF = osinfo.version_number >= (8,)
# RHEL 9 uses pkcs11 as openssl engine
HAS_PKCS11_OPENSSL_ENGINE = osinfo.version_number[0] == 9
# RHEL 10 and later deprecated OpenSSL engine and recommend using OpenSSL
# provider API.
HAS_OPENSSL_PROVIDER = osinfo.version_number >= (10,)
__all__ = ("constants", "User", "Group")
class RHELConstantsNamespace(RedHatConstantsNamespace):
IPA_ADTRUST_PACKAGE_NAME = "ipa-server-trust-ad"
IPA_DNS_PACKAGE_NAME = "ipa-server-dns"
if HAS_NFS_CONF:
SECURE_NFS_VAR = None
if HAS_PKCS11_OPENSSL_ENGINE:
NAMED_OPENSSL_ENGINE = "pkcs11"
if HAS_OPENSSL_PROVIDER:
NAMED_OPENSSL_PROVIDER = True
constants = RHELConstantsNamespace()