From 94433a2ab522d8b6ae2e2cf24de0ff723e491c45 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 31 Jul 2014 10:22:53 -0400 Subject: [PATCH] Add 'persistent' to return dict of get_bootdev This enables a caller to understand more about the nature of the boot device parameter Change-Id: Iec2e9b5be06a6340fbc1e3461532f749c972558e --- pyghmi/ipmi/command.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 1d0b4216..b8f66fb1 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -142,14 +142,17 @@ class Command(object): (response['data'][1] & 0b1111111) == 5) if (response['data'][1] & 0b10000000 or not response['data'][2] & 0b10000000): - return {'bootdev': 'default'} + return {'bootdev': 'default', 'persistent': True} else: # will consult data2 of the boot flags parameter for the data + persistent = False + if response['data'][2] & 0b1000000: + persistent = True bootnum = (response['data'][3] & 0b111100) >> 2 bootdev = boot_devices.get(bootnum) if bootdev: - return {'bootdev': bootdev} + return {'bootdev': bootdev, 'persistent': persistent} else: - return {'bootdev': bootnum} + return {'bootdev': bootnum, 'persistent': persistent} def set_power(self, powerstate, wait=False): """Request power state change