diff options
author | Rod Smith <rod.smith@canonical.com> | 2015-08-14 10:59:19 -0400 |
---|---|---|
committer | Rod Smith <rod.smith@canonical.com> | 2015-08-14 10:59:19 -0400 |
commit | d2d8431bb37fa91c07ba16054dc71495c339b15b (patch) | |
tree | b7d14e52a7edcebe70e6e69ac87cf9d4f0eb2321 /bin | |
parent | af20494204f76817117b475a470bbd1a454f0045 (diff) |
Keep SMART test from crashing if controller says it supports SMART via 'smartctl -i' but then says it doesn't support SMART logging via 'smartctl -l'.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/disk_smart | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/disk_smart b/bin/disk_smart index 7e6929f..fc5e21f 100755 --- a/bin/disk_smart +++ b/bin/disk_smart @@ -165,7 +165,10 @@ def get_smart_entries(disk, type='selftest'): break # Get lengths from header - line = next(stdout_lines) + try: + line = next(stdout_lines) + except StopIteration: + logging.info('No entries found in log') if not line.startswith('Num'): entries.append('No entries found in log yet') return entries, returncode |