make sure plugin exits cleanly if unable to run clustat -fx command

This commit is contained in:
Pall Sigurdsson 2012-04-23 12:43:14 +00:00
parent 5cdbba7b66
commit ceda55b389
1 changed files with 6 additions and 3 deletions

View File

@ -120,9 +120,12 @@ def main():
usage()
sys.exit()
clustatOutput = os.popen('/usr/sbin/clustat -fx')
dom = xml.dom.minidom.parse(clustatOutput)
try:
clustatOutput = os.popen('/usr/sbin/clustat -fx')
dom = xml.dom.minidom.parse(clustatOutput)
except Exception, e:
print "Error: could not parse output of : '/usr/sbin/clustat -fx': ", e
sys.exit(3)
if typeCheck == 'cluster':
# First we query for the state of the cluster itself.