Issue:
The perccli-1.11.03-1.noarch might generate invalid control character:
00001e0 / 0 0 " , \n \t \t \t " R e v i s i
00001f0 o n N o " : " d _ 022 002 r y
0000200 S e "
# Note the 022 and 002 control character.
Fix:
Remove all non-printable characters([^\x20-\x7e]) to space before pass them
to Python json.loads().
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/megaraid/megaraid.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugin/megaraid/megaraid.py b/plugin/megaraid/megaraid.py
index 58d1723..6868178 100644
--- a/plugin/megaraid/megaraid.py
+++ b/plugin/megaraid/megaraid.py
@@ -300,6 +300,8 @@ def _storcli_exec(self, storcli_cmds, flag_json=True):
else:
raise
+ output = re.sub("[^\x20-\x7e]", " ", output)
+
if flag_json:
output_dict = json.loads(output)
ctrl_output = output_dict.get('Controllers')
--
1.8.3.1