2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 11:48:33 +00:00

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
This commit is contained in:
Jarrod Johnson 2018-04-11 15:12:39 -04:00
parent 3db33fafb5
commit 792e32d243

View File

@ -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)