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:
James Page
2020-03-31 16:20:22 +01:00
parent 6b5a163022
commit 236a7beb34
+1 -1
View File
@@ -177,7 +177,7 @@ class HTTPClient(_BaseHTTPClient):
if kwargs.get('insecure', False) is True: if kwargs.get('insecure', False) is True:
self.session.verify = False self.session.verify = False
else: else:
if kwargs.get('cacert', None) is not '': if kwargs.get('cacert', None) != '':
self.session.verify = kwargs.get('cacert', True) self.session.verify = kwargs.get('cacert', True)
self.session.cert = (kwargs.get('cert_file'), self.session.cert = (kwargs.get('cert_file'),