Fix SyntaxWarning with Python 3.8
Under Python 3.8, the following SyntaxWarning is logged on every
glanceclient invocation:
SyntaxWarning: "is not" with a literal. Did you mean "!="?
if kwargs.get('cacert', None) is not '':
Make use of '!=' rather than 'is not' to avoid this warning.
Change-Id: I11ed568932ec5ea0ffee629d6fd434433f262b67
This commit is contained in:
@@ -177,7 +177,7 @@ class HTTPClient(_BaseHTTPClient):
|
||||
if kwargs.get('insecure', False) is True:
|
||||
self.session.verify = False
|
||||
else:
|
||||
if kwargs.get('cacert', None) is not '':
|
||||
if kwargs.get('cacert', None) != '':
|
||||
self.session.verify = kwargs.get('cacert', True)
|
||||
|
||||
self.session.cert = (kwargs.get('cert_file'),
|
||||
|
||||
Reference in New Issue
Block a user