From bf15d7f382c57dc21288ff07aa8bd0185086be56 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 4 Jan 2018 16:58:35 -0500 Subject: [PATCH] Fix the custom cookies feature As written, it broke non-custom case. Change-Id: I2a533207f060c3d06ee8fc0826d6a8d7f1ec39c1 --- pyghmi/util/webclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 5de6798d..c7c237d7 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -169,7 +169,7 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): for ckey in self.cookies: cookies.append('{0}={1}'.format(ckey, self.cookies[ckey])) cookies_header = '; '.join(cookies) - if headers['Cookie'] is None: + if headers.get('Cookie', None) is None: headers['Cookie'] = cookies_header else: headers['Cookie'] += '; ' + '; '.join(cookies)