Skip to content
Snippets Groups Projects
Commit 7c2a85c2 authored by ale's avatar ale
Browse files

Merge branch 'smartmon-device-info' into 'master'

float-base: dumber but more reliable SMART support detection

See merge request !270
parents 8cb3d7ea 953b7f63
No related branches found
No related tags found
1 merge request!270float-base: dumber but more reliable SMART support detection
......@@ -232,16 +232,13 @@ def device_smart_capabilities(device):
(bool): True whenever SMART is available, False otherwise.
(bool): True whenever SMART is enabled, False otherwise.
"""
groups = device_info(device)
state = {
g[1].split(' ', 1)[0]
for g in groups if g[0] == 'SMART support'}
smart_available = 'Available' in state
smart_enabled = 'Enabled' in state
return smart_available, smart_enabled
try:
subprocess.check_call(
['/usr/sbin/smartctl', '--info'] + device.smartctl_select(),
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return True, True
except subprocess.CalledProcessError:
return False, False
def collect_device_info(device):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment