|
|
62708f |
diff --git a/plugin/hpsa/hpsa.py b/plugin/hpsa/hpsa.py
|
|
|
62708f |
index c56cb21..ed5593d 100644
|
|
|
62708f |
--- a/plugin/hpsa/hpsa.py
|
|
|
62708f |
+++ b/plugin/hpsa/hpsa.py
|
|
|
62708f |
@@ -118,25 +118,40 @@ def _sanitize_output(output_lines, return_warning=False):
|
|
|
62708f |
num_lines = len(output_lines)
|
|
|
62708f |
sanitized = []
|
|
|
62708f |
i = 0
|
|
|
62708f |
+
|
|
|
62708f |
+ critical_msgs = ['Warning:']
|
|
|
62708f |
+ info_msgs = ['Encryption is enabled']
|
|
|
62708f |
while i < num_lines:
|
|
|
62708f |
if output_lines[i]:
|
|
|
62708f |
- # Newer versions report things like media errors
|
|
|
62708f |
- if output_lines[i].startswith('Warning:'):
|
|
|
62708f |
- start = i + 1
|
|
|
62708f |
- warning = output_lines[i]
|
|
|
62708f |
-
|
|
|
62708f |
- # Append all lines until next empty
|
|
|
62708f |
- for z in range(start, num_lines):
|
|
|
62708f |
- i += 1
|
|
|
62708f |
- if output_lines[z]:
|
|
|
62708f |
- warning += ' ' + output_lines[z]
|
|
|
62708f |
- else:
|
|
|
62708f |
- break
|
|
|
62708f |
|
|
|
62708f |
- if warning_msg is None:
|
|
|
62708f |
- warning_msg = warning[9:]
|
|
|
62708f |
-
|
|
|
62708f |
- elif output_lines[i].startswith('Note:'):
|
|
|
62708f |
+ # Newer versions report things like media errors
|
|
|
62708f |
+ for critical_msg in critical_msgs:
|
|
|
62708f |
+ if output_lines[i].startswith(critical_msg):
|
|
|
62708f |
+ start = i + 1
|
|
|
62708f |
+ warning = output_lines[i]
|
|
|
62708f |
+
|
|
|
62708f |
+ # Append all lines until next empty
|
|
|
62708f |
+ for z in range(start, num_lines):
|
|
|
62708f |
+ i += 1
|
|
|
62708f |
+ if output_lines[z]:
|
|
|
62708f |
+ warning += ' ' + output_lines[z]
|
|
|
62708f |
+ else:
|
|
|
62708f |
+ break
|
|
|
62708f |
+
|
|
|
62708f |
+ if warning_msg is None:
|
|
|
62708f |
+ warning_msg = warning[9:]
|
|
|
62708f |
+
|
|
|
62708f |
+ for info_msg in info_msgs:
|
|
|
62708f |
+ # Discard the whole block
|
|
|
62708f |
+ if output_lines[i].startswith(info_msg):
|
|
|
62708f |
+ start = i
|
|
|
62708f |
+
|
|
|
62708f |
+ for z in range(start, num_lines):
|
|
|
62708f |
+ i += 1
|
|
|
62708f |
+ if not output_lines[z]:
|
|
|
62708f |
+ break
|
|
|
62708f |
+
|
|
|
62708f |
+ if output_lines[i].startswith('Note:'):
|
|
|
62708f |
# Discard
|
|
|
62708f |
pass
|
|
|
62708f |
else:
|