From 895b3982d7c835a3fe4d4bd8d21de2fc6a95abac Mon Sep 17 00:00:00 2001 From: Ozan Unsal Date: Tue, 24 May 2022 13:12:06 +0200 Subject: [PATCH] Update the cts_keytab field in order to get the hostname of the server - This change is required for the following issue. Authentication is required for importing composes to the CTS and finding generic keytabs in different servers. JIRA: RHELCMP-8930 Signed-off-by: Ozan Unsal --- pungi/compose.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pungi/compose.py b/pungi/compose.py index e3ed352c..e289a7a2 100644 --- a/pungi/compose.py +++ b/pungi/compose.py @@ -24,6 +24,7 @@ import time import tempfile import shutil import json +import socket import kobo.log import kobo.tback @@ -98,6 +99,8 @@ def get_compose_info( authentication = get_authentication(conf) if cts_keytab: environ_copy = dict(os.environ) + if "$HOSTNAME" in cts_keytab: + cts_keytab = cts_keytab.replace("$HOSTNAME", socket.gethostname()) os.environ["KRB5_CLIENT_KTNAME"] = cts_keytab try: