Skip to content

Commit

Permalink
Bailing out on connection error
Browse files Browse the repository at this point in the history
It shouldn't try and continue in the `do_server_status` method if there is a connection error.
  • Loading branch information
keitwb authored Feb 8, 2018
1 parent 0a7d186 commit 630ceca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def do_server_status(self):
except Exception, e:
self.log('ERROR: Connection failed for %s:%s' % (
self.mongo_host, self.mongo_port))
return
db = con[self.mongo_db[0]]
if self.mongo_user and self.mongo_password:
db.authenticate(self.mongo_user, self.mongo_password)
Expand Down

0 comments on commit 630ceca

Please sign in to comment.