2
0
mirror of https://opendev.org/x/pyghmi synced 2026-01-11 18:52:33 +00:00

Merge "Check the status for no power permission"

This commit is contained in:
Zuul
2018-04-12 21:46:11 +00:00
committed by Gerrit Code Review

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)