code cleaning
This commit is contained in:
parent
9693e0d22b
commit
c3f1fd1e04
1 changed files with 71 additions and 71 deletions
|
@ -188,7 +188,10 @@ ceph_cmd.append('--format=json')
|
|||
p = subprocess.Popen(ceph_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
output, err = p.communicate()
|
||||
|
||||
if output:
|
||||
if not output:
|
||||
print("UNKNOWN : fail to execute ceph status command")
|
||||
sys.exit(STATUS['UNKNOWN'])
|
||||
|
||||
data = json.loads(output.decode(sys.getdefaultencoding()))
|
||||
|
||||
status = 'OK'
|
||||
|
@ -258,6 +261,3 @@ if output:
|
|||
else:
|
||||
print("%s / %s OSDs down (OSDs UP : %s/%s)" % (msg, num_lost_osd, total_osd_up, total_osd))
|
||||
sys.exit(STATUS[status])
|
||||
else:
|
||||
print("UNKNOWN : fail to execute ceph status command")
|
||||
sys.exit(STATUS['UNKNOWN'])
|
||||
|
|
Loading…
Reference in a new issue