session_storage: Correctly handle string/byte types

In session_storage.py, store_data() stores data as the bytes data
type but get_data() is returning a string. Have get_data() return
bytes as well.

https://pagure.io/freeipa/issue/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Stanislav Laznicka
2017-06-02 15:12:09 +02:00
committed by Martin Babinsky
parent 468eb3c712
commit d665224a85
2 changed files with 5 additions and 2 deletions

View File

@@ -887,7 +887,10 @@ class RPCClient(Connectible):
# (possibly with more than one cookie).
try:
cookie_string = read_persistent_client_session_data(principal)
except Exception:
cookie_string = cookie_string.decode('utf-8')
except Exception as e:
self.log.debug('Error reading client session data: {err}'
.format(err=e))
return None
# Search for the session cookie within the cookie string