From: Paulo Vital <address@hidden>
The output of lsmcode command on BMC-based machines is extremely different than
its output on FSP-based machines. Because of that, the information provided in
Administration tab regarding the current Firmware level is not being pretty
formatted in BMC-based machines.
This patch parses the output of lsmcode command to get the correct information
about the Firmware level installed.
Signed-off-by: Paulo Vital <address@hidden>
---
models/firmware.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/models/firmware.py b/models/firmware.py
index fb35fef..5f99a7f 100644
--- a/models/firmware.py
+++ b/models/firmware.py
@@ -49,8 +49,13 @@ class FirmwareModel(object):
wok_log.error('Unable to retreive firmware level.')
return {'level': 'Unknown'}
# Cut out the chatter from the command output
- levels = output.split()[5:]
- levels = " ".join(levels)
+ # First, need check what type of output was returned due to diffs
+ # between some machine version
+ if output.split()[5] != 'Product':
+ levels = output.split()[5:]
+ levels = " ".join(levels)
+ else:
+ levels = output.split()[13]
return {'level': levels}
def update(self, name, params):