Skip to content

Commit

Permalink
Merge pull request #50 from sac/sh-exception
Browse files Browse the repository at this point in the history
Self-heal status fails if glusterd is down, handle it sanely
  • Loading branch information
sac authored Sep 1, 2020
2 parents 05c814b + 017680b commit b5f27d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions gstatus/glusterlib/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ def _update_snapshot_info(self):
volume['snapshots'] = snapshot.info(volname = volume['name'])

def _update_heal_info(self):
heal_fail = 0
for volume in self.volume_data:
if volume['status'].lower() == 'started':
volume['healinfo'] = heal.info(volume['name'])

try:
volume['healinfo'] = heal.info(volume['name'])
except GlusterCmdException:
heal_fail = 1
pass
if heal_fail:
print("Note: Unable to get self-heal status for one or more volumes")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from gstatus import version

f = open('README')
f = open('README.md')
long_description = f.read().strip()
f.close()

Expand Down

0 comments on commit b5f27d0

Please sign in to comment.