2
0
mirror of https://opendev.org/x/pyghmi synced 2026-03-29 06:13:30 +00:00

Correct return value of set_bootdev

command would return a number rather than a string for set_bootdev.
Correct this by returning the string passed in on success rather
than the resulting number.

Change-Id: I8e76b1ac9d0222630abe6b160e6271b13ef4987d
This commit is contained in:
Jarrod Johnson
2014-05-08 14:29:17 -04:00
parent 0dd388686e
commit d3ea606d71

View File

@@ -235,7 +235,7 @@ class Command(object):
"""
if bootdev not in boot_devices:
return {'error': "Unknown bootdevice %s requested" % bootdev}
bootdev = boot_devices[bootdev]
bootdevnum = boot_devices[bootdev]
# first, we disable timer by way of set system boot options,
# then move on to set chassis capabilities
# Set System Boot Options is netfn=0, command=8, data
@@ -247,9 +247,9 @@ class Command(object):
bootflags |= 1 << 5
if persist:
bootflags |= 1 << 6
if bootdev == 0:
if bootdevnum == 0:
bootflags = 0
data = (5, bootflags, bootdev, 0, 0, 0)
data = (5, bootflags, bootdevnum, 0, 0, 0)
response = self.raw_command(netfn=0, command=8, data=data)
if 'error' in response:
return response