Simplify chained comparisons

Change-Id: Ie4a840bf4b587c72ab9bdfb0ec539829fe380595
This commit is contained in:
Dina Belova 2014-08-20 16:46:48 +04:00
parent b5b744c90e
commit 65f21b8292

View File

@ -188,7 +188,7 @@ class ConnectionPool(object):
try:
client = pymongo.MongoClient(url, safe=True)
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 '
'%(retries)d retries. Giving up.') %
{'retries': max_retries})