diff --git a/pyipmi/chassis.py b/pyipmi/chassis.py index eed152f..215fd73 100644 --- a/pyipmi/chassis.py +++ b/pyipmi/chassis.py @@ -37,14 +37,14 @@ def chassis_control(self, option): rsp = self.send_message(req) check_completion_code(rsp.completion_code) - def set_boot_options(self, persistent_boot_option, boot_device): + def set_boot_options(self, bios_boot_type, persistent_boot_option, boot_device): req = create_request_by_name('SetSystemBootOptions') req.parameter_selector.boot_options = 5 req.parameter_selector.parameter_valid = 0 req.data_1.valid_flag = 1 # intersted field req.data_1.persistent_boot_option = persistent_boot_option - req.data_1.bios_boot_efi = 0 + req.data_1.bios_boot_type = bios_boot_type req.data_3.ignore = 0 req.data_4.ignore = 0 req.data_5.ignore = 0 diff --git a/pyipmi/integration_test.py b/pyipmi/integration_test.py index b70d28c..6d6862d 100644 --- a/pyipmi/integration_test.py +++ b/pyipmi/integration_test.py @@ -1,10 +1,10 @@ import sys # insert at 1, 0 is the script path (or '' in REPL) -sys.path.insert(1, '/Users/srmppn/Desktop/python-ipmi/') +sys.path.insert(1, '/Users/bvnkwiz/Documents/python-ipmi/') import pyipmi import pyipmi.interfaces -from pyipmi.msgs.chassis import BOOT_OPTION_LEGACY, BOOT_OPTION_EFI, BOOT_DEVICE_PXE, BOOT_DEVICE_DISK +from pyipmi.msgs.chassis import BOOT_OPTION_LEGACY, BOOT_OPTION_EFI, BOOT_DEVICE_PXE, BOOT_DEVICE_DISK, NON_PERSISTENT_BOOT_OPTION # Supported interface_types for ipmitool are: 'lan' , 'lanplus', and 'serial-terminal' interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='lan') @@ -18,5 +18,5 @@ connection.session.establish() device_id = connection.get_device_id() -connection.set_boot_options(persistent_boot_option = BOOT_OPTION_LEGACY, boot_device = BOOT_DEVICE_PXE) +connection.set_boot_options(bios_boot_type= BOOT_OPTION_LEGACY, persistent_boot_option = NON_PERSISTENT_BOOT_OPTION, boot_device = BOOT_DEVICE_PXE) result = connection.chassis_control_hard_reset() diff --git a/pyipmi/msgs/chassis.py b/pyipmi/msgs/chassis.py index 4301fbf..a41ce94 100644 --- a/pyipmi/msgs/chassis.py +++ b/pyipmi/msgs/chassis.py @@ -38,6 +38,10 @@ BOOT_DEVICE_PXE = 1 BOOT_DEVICE_DISK = 3 +# Persistent boot options +NON_PERSISTENT_BOOT_OPTION = 0 +PERSISTENT_BOOT_OPTION = 1 + @register_message_class class GetChassisCapabilitiesReq(Message): @@ -181,7 +185,7 @@ class SetSystemBootOptionsReq(Message): # boot flags (semi vi) Bitfield('data_1', 1, Bitfield.ReservedBit(5, 0), - Bitfield.Bit('bios_boot_efi', 1), + Bitfield.Bit('bios_boot_type', 1), Bitfield.Bit('persistent_boot_option', 1), Bitfield.Bit('valid_flag', 1)), Bitfield('data_2', 1,