Skip to content

Commit

Permalink
improve sensing of smart available / enabled status rockstor#997
Browse files Browse the repository at this point in the history
some smart reports appear to have additional spaces after the
: char so allow matches for this to enable smart status read.
  • Loading branch information
phillxnet committed Jan 1, 2016
1 parent 99ff7bd commit 58207c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rockstor/system/smart.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ def available(device, test_mode=False):
a = False
e = False
for i in o:
# todo Check on matching as sometimes multiple spaces after ":" ie on lsi9207
if (re.match('SMART support is: Available', i) is not None):
# N.B. .* in pattern match to allow for multiple spaces
if (re.match('SMART support is:.* Available', i) is not None):
a = True
if (re.match('SMART support is: Enabled', i) is not None):
if (re.match('SMART support is:.* Enabled', i) is not None):
e = True
return a, e

Expand Down

0 comments on commit 58207c8

Please sign in to comment.