From 2b92e042bb8a4510abec38fcfc302d8de1e28f37 Mon Sep 17 00:00:00 2001 From: Darren Archibald Date: Fri, 23 Feb 2024 06:55:32 -0800 Subject: [PATCH] spacewalk: fix CA cert file path for Oracle Linux Update the CA cert file that is available in Oracle Linux to register with ULN. Orabug: 30435672 Signed-off-by: Si-Wei Liu Signed-off-by: Vijay Balakrishna Acked-by: Joe Kennedy Reviewed-by: Laurence Rochfort Signed-off-by: Darren Archibald Signed-off-by: Rajesh Harekal --- cloudinit/config/cc_spacewalk.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloudinit/config/cc_spacewalk.py b/cloudinit/config/cc_spacewalk.py index 08514f2..7248cce 100644 --- a/cloudinit/config/cc_spacewalk.py +++ b/cloudinit/config/cc_spacewalk.py @@ -3,7 +3,7 @@ import logging -from cloudinit import subp +from cloudinit import subp, util from cloudinit.cloud import Cloud from cloudinit.config import Config from cloudinit.config.schema import MetaSchema @@ -21,6 +21,7 @@ distros = ["redhat", "fedora", "openeuler"] required_packages = ["rhn-setup"] def_ca_cert_path = "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" +ol_ca_cert_path = "/usr/share/rhn/ULN-CA-CERT" def is_registered(): @@ -74,9 +75,14 @@ # Need to have this installed before further things will work. cloud.distro.install_packages(required_packages) if not is_registered(): + if util.system_info()['variant'] == "ol": + cert = ol_ca_cert_path + else: + cert = def_ca_cert_path do_register( spacewalk_server, cloud.datasource.get_hostname(fqdn=True).hostname, + ca_cert_path=cert, proxy=cfg.get("proxy"), activation_key=cfg.get("activation_key"), )