Simplify chained comparisons
Change-Id: Ie4a840bf4b587c72ab9bdfb0ec539829fe380595
This commit is contained in:
parent
b5b744c90e
commit
65f21b8292
@ -188,7 +188,7 @@ class ConnectionPool(object):
|
|||||||
try:
|
try:
|
||||||
client = pymongo.MongoClient(url, safe=True)
|
client = pymongo.MongoClient(url, safe=True)
|
||||||
except pymongo.errors.ConnectionFailure as e:
|
except pymongo.errors.ConnectionFailure as e:
|
||||||
if max_retries >= 0 and attempts >= max_retries:
|
if 0 <= max_retries <= attempts:
|
||||||
LOG.error(_('Unable to connect to the database after '
|
LOG.error(_('Unable to connect to the database after '
|
||||||
'%(retries)d retries. Giving up.') %
|
'%(retries)d retries. Giving up.') %
|
||||||
{'retries': max_retries})
|
{'retries': max_retries})
|
||||||
|
Loading…
Reference in New Issue
Block a user