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

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

Re: [Ginger-dev-list] [PATCH] Fix Firmware level information of BMC-base


From: Rodrigo Trujillo
Subject: Re: [Ginger-dev-list] [PATCH] Fix Firmware level information of BMC-based machines.
Date: Wed, 18 Nov 2015 11:29:20 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Reviewed-by: Rodrigo Trujillo <address@hidden>

On 11/18/2015 10:46 AM, address@hidden wrote:
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):




reply via email to

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