Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
bugfix: reuse session object for health check
Browse files Browse the repository at this point in the history
Change-Id: I230575948751766f78aec381c3d94ac96e372471
  • Loading branch information
isaacm committed Mar 28, 2016
1 parent fce2fb8 commit b088e04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions poppy/storage/cassandra/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,12 @@ def is_alive(self):
"""Health check for Cassandra."""

try:
self.session.execute(
self.database.execute(
"SELECT cluster_name, data_center FROM system.local;")
except Exception:
except Exception as ex:
LOG.exception("Cassandra storage health check failed: {0}".format(
str(ex))
)
return False
return True

Expand Down

0 comments on commit b088e04

Please sign in to comment.