From 792e32d24398c88e017e24c74e7bbcaed277ab8b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Apr 2018 15:12:39 -0400 Subject: [PATCH] Check the status for no power permission It is possible to assert no power permission without providing a reason. Check and add the no power permission state explicitly in such a case. Change-Id: I48b81217405fc63a1d5b4772ab9e338b85d79204 --- pyghmi/ipmi/oem/lenovo/nextscale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index 7bc06348..ab27c688 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -94,11 +94,11 @@ def fpc_get_nodeperm(ipmicmd, number, sz): if ie.ipmicode == 0xd5: # no node present return (pygconst.Health.Ok, ['Absent']) raise - perminfo = ord(rsp['data'][1]) health = pygconst.Health.Ok states = [] if len(rsp['data']) == 4: # different gens handled rc differently rsp['data'] = b'\x00' + bytes(rsp['data']) + perminfo = ord(rsp['data'][1]) if sz == 6: # FPC permfail = ('\x02', '\x03') elif sz == 2: # SMM @@ -109,6 +109,9 @@ def fpc_get_nodeperm(ipmicmd, number, sz): if perminfo & 0x40: states.append('Node Fault') health = pygconst.Health.Failed + if perminfo & 0x20: + states.append('No Power Permission') + health = pygconst.Health.Failed return (health, states)