Skip to content

Commit

Permalink
Fixes a wrong key in the results of get_health
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume <[email protected]>
  • Loading branch information
gthvn1 committed Jan 27, 2025
1 parent 38604e4 commit 3473dc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SOURCES/etc/xapi.d/plugins/smartctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def get_health(session, args):
cmd = run_command(["smartctl", "-j", "-H", "-d", device['type'], device['name']], check=False)
json_output = json.loads(cmd['stdout'])
if json_output['smart_status']['passed']:
results[disk] = "PASSED"
results[device['name']] = "PASSED"
else:
results[disk] = "FAILED"
results[device['name']] = "FAILED"
return json.dumps(results)


Expand Down

0 comments on commit 3473dc8

Please sign in to comment.