Merge "Simplify chained comparisons"

This commit is contained in:
Jenkins 2014-08-29 08:37:10 +00:00 committed by Gerrit Code Review
commit 7a8484f879
1 changed files with 1 additions and 1 deletions

View File

@ -186,7 +186,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})