Fix reference before assignment

In 'store_session_cookie', if the server does not set the session
cookie for some reason, the 'session_cookie' variable does not get
assigned, resulting in UnboundLocalError.  Set an initial value of
'None'.

Fixes: https://fedorahosted.org/freeipa/ticket/6636
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Fraser Tweedale
2017-01-31 11:23:58 +10:00
committed by Martin Basti
parent f4088b3a00
commit 924794f62b

View File

@@ -706,6 +706,7 @@ class KerbTransport(SSLTransport):
cookie_header = [cookie_header]
# Search for the session cookie
session_cookie = None
try:
for cookie in cookie_header:
session_cookie = \