ginger-dev-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ginger-dev-list] [PATCH] Fix Firmware level information of BMC-based ma


From: pvital
Subject: [Ginger-dev-list] [PATCH] Fix Firmware level information of BMC-based machines.
Date: Wed, 18 Nov 2015 10:46:18 -0200

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):
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]