From e5928ed09c5077dc396c9a003b11aea3fc8eac6a Mon Sep 17 00:00:00 2001 From: Guillaume Date: Tue, 19 Dec 2023 15:40:27 +0100 Subject: [PATCH] Don't check return status from smartctl -a Some device doesn't support SMART capability and getting information from such device 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 --- SOURCES/etc/xapi.d/plugins/smartctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOURCES/etc/xapi.d/plugins/smartctl.py b/SOURCES/etc/xapi.d/plugins/smartctl.py index 6958ac0..053f223 100755 --- a/SOURCES/etc/xapi.d/plugins/smartctl.py +++ b/SOURCES/etc/xapi.d/plugins/smartctl.py @@ -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)