From c140d4066f6da769009cce81685e0ece117be469 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Nov 23 2016 11:26:46 +0000 Subject: Restore baseurl to original if GSSAPI login didn't work Signed-off-by: Patrick Uiterwijk --- diff --git a/koji/__init__.py b/koji/__init__.py index 4723844..24cec68 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -2114,6 +2114,7 @@ class ClientSession(object): ) # force https + old_baseurl = self.baseurl uri = urlparse.urlsplit(self.baseurl) if uri[0] != 'https': self.baseurl = 'https://%s%s' % (uri[1], uri[2]) @@ -2128,6 +2129,9 @@ class ClientSession(object): self.opts['auth'] = HTTPKerberosAuth() try: sinfo = self.callMethod('sslLogin', proxyuser) + except: + # Auth with https didn't work. Restore for the next attempt. + self.baseurl = old_baseurl finally: self.opts = old_opts if not sinfo: