From cf847a6267d36fe31b90e758024c87406388c322 Mon Sep 17 00:00:00 2001
From: Frank Buettner <frank.buettner@mdc-berlin.de>
Date: Feb 10 2023 11:35:01 +0000
Subject: Let "--principal=" works for users using multiple TGT's


fix for https://pagure.io/koji/issue/3680
---

diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py
index 02c0cb9..f334bc5 100644
--- a/cli/koji_cli/lib.py
+++ b/cli/koji_cli/lib.py
@@ -760,6 +760,8 @@ def activate_session(session, options):
             if getattr(options, 'keytab', None) and getattr(options, 'principal', None):
                 session.gssapi_login(principal=options.principal, keytab=options.keytab,
                                      proxyuser=runas)
+            elif getattr(options, 'principal', None):
+                session.gssapi_login(principal=options.principal,proxyuser=runas)
             else:
                 session.gssapi_login(proxyuser=runas)
         except socket.error as e:

