2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-28 11:57:34 +00:00

Implement retrieval of uefi flag in boot devs

While pyghmi supported the setting of the parameter,
it did not support the retrieval for the data.  Remedy
this senseless asymmetry.

Change-Id: Ib26412e012d08b39df7b6997a1f929d4277219f9
This commit is contained in:
Jarrod Johnon 2014-11-14 14:49:12 -05:00
parent 06714089fe
commit 7eb6fab348

View File

@ -145,14 +145,21 @@ class Command(object):
return {'bootdev': 'default', 'persistent': True}
else: # will consult data2 of the boot flags parameter for the data
persistent = False
uefimode = False
if response['data'][2] & 0b1000000:
persistent = True
if response['data'][2] & 0b100000:
uefimode = True
bootnum = (response['data'][3] & 0b111100) >> 2
bootdev = boot_devices.get(bootnum)
if bootdev:
return {'bootdev': bootdev, 'persistent': persistent}
return {'bootdev': bootdev,
'persistent': persistent,
'uefimode': uefimode}
else:
return {'bootdev': bootnum, 'persistent': persistent}
return {'bootdev': bootnum,
'persistent': persistent,
'uefimode': uefimode}
def set_power(self, powerstate, wait=False):
"""Request power state change