From e5367b088f6df9056f45da63a38b4e949d60e880 Mon Sep 17 00:00:00 2001 From: Jana Cupova Date: Nov 15 2022 11:19:31 +0000 Subject: Fix logout when hub is older than CLI https://pagure.io/koji/issue/3396 --- diff --git a/koji/__init__.py b/koji/__init__.py index 1ad588a..a479300 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -2651,7 +2651,16 @@ class ClientSession(object): # bypass _callMethod (no retries) # XXX - is that really what we want? handler, headers, request = self._prepCall('logout', (), {"session_id": session_id}) - self._sendCall(handler, headers, request) + try: + self._sendCall(handler, headers, request) + except Fault as fault: + ex = convertFault(fault) + if isinstance(ex, ParameterError): + # except when hub is older than 1.31 + handler, headers, request = self._prepCall('logout', (), {}) + self._sendCall(handler, headers, request) + else: + raise ex except AuthExpired: # this can happen when an exclusive session is forced pass