Skip to content

Commit

Permalink
Don't check return status from smartctl -a
Browse files Browse the repository at this point in the history
Some devices don't support SMART capability and getting information
from such devices returns an error code 4. As it happens in CI we remove
the check of the return code knowing that this error code is a field
of the JSON output.

Signed-off-by: Guillaume <[email protected]>
  • Loading branch information
gthvn1 committed Dec 20, 2023
1 parent e9415e0 commit d4b8cd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SOURCES/etc/xapi.d/plugins/smartctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_information(session, args):
with OperationLocker():
disks = _list_disks()
for disk in disks:
cmd = run_command(["smartctl", "-j", "-a", disk])
cmd = run_command(["smartctl", "-j", "-a", disk], check=False)
results[disk] = json.loads(cmd['stdout'])
return json.dumps(results)

Expand Down

0 comments on commit d4b8cd6

Please sign in to comment.