Skip to content

Commit

Permalink
CA-150952: properly check for XAPI session existence
Browse files Browse the repository at this point in the history
Don't check if a XAPI session exists by comparing session with the empty
string because if a XAPI session does exist it returns a error string,
which evaluates to true.

Signed-off-by: Thanos Makatos <thanos.makatos@citrix.com>

(cherry picked from commit 3fd6375cc13cb4106153b15c31c62580fd7dcc89)
  • Loading branch information
Thanos Makatos committed Nov 25, 2014
1 parent cb39f5e commit b5c7890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ def get_pool_restrictions(session):

def read_caching_is_restricted(session):
"""Tells whether read caching is restricted."""
if session is None or session == "":
if session is None or (isinstance(session, str) and session == ""):
return True
restrictions = get_pool_restrictions(session)
if 'restrict_read_caching' in restrictions and \
Expand Down

0 comments on commit b5c7890

Please sign in to comment.