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 <ounsal@redhat.com>
This commit is contained in:
Ozan Unsal 2022-05-24 13:12:06 +02:00 committed by onosek
parent c4aa45beab
commit 895b3982d7
1 changed files with 3 additions and 0 deletions

View File

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