def set_bios_config(self, task, **kwargs): """Change BIOS settings. This method is used to change the BIOS settings on a node. :param task: a TaskManager instance containing the node to act on. :param kwargs: a dictionary of {'AttributeName': 'NewValue'} :raises: DracOperationError on an error from python-dracclient. :returns: A dictionary containing the commit_required key with a Boolean value indicating whether commit_bios_config() needs to be called to make the changes. """ return bios.set_config(task, **kwargs)
def test_set_config_nochange(self, client): _mock_pywsman_responses(client, _set_config()) with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: task.node = self.node res = bios.set_config(task, MemTest='Disabled', ProcCStates='Disabled', SystemModelName='PowerEdge R630', AssetTag=None, Proc1NumCores=8, AcPwrRcvryUserDelay=60) self.assertFalse(res)
def set_bios_config(self, task, **kwargs): """Change BIOS settings. This method is used to change the BIOS settings on a node. :param task: a TaskManager instance containing the node to act on. :param kwargs: a dictionary of {'AttributeName': 'NewValue'} :raises: DracOperationError on an error from python-dracclient. :returns: A dictionary containing the ``commit_required`` key with a Boolean value indicating whether commit_bios_config() needs to be called to make the changes. """ return drac_bios.set_config(task, **kwargs)
def test_set_config_needreboot(self, client): mock_pywsman = _mock_pywsman_responses(client, _set_config()) invoke_xml = test_utils.mock_wsman_root(bios_wsman_mock.Invoke_Commit) # TODO(victor-lowther) This needs more work. # Specifically, we will need to verify that # invoke was handed the XML blob we expected. mock_pywsman.invoke.return_value = invoke_xml with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: task.node = self.node res = bios.set_config(task, AssetTag="An Asset Tag", MemTest="Enabled") self.assertTrue(res)
def set_bios_config(self, task, **kwargs): """Change BIOS settings. This method is used to change the BIOS settings on a node. :param task: the ironic task used to identify the node. :param kwargs: a dictionary of {'AttributeName': 'NewValue'} :raises: DracOperationFailed if any of the attributes cannot be set for any reason. :raises: DracClientError on an error from the pywsman library. :returns: A dictionary containing the commit_needed key with a boolean value indicating whether commit_config() needs to be called to make the changes. """ return {'commit_needed': bios.set_config(task, **kwargs)}
def test_set_config_needreboot(self, client): mock_pywsman = _mock_pywsman_responses(client, _set_config()) invoke_xml = test_utils.mock_wsman_root( bios_wsman_mock.Invoke_Commit) # TODO(victor-lowther) This needs more work. # Specifically, we will need to verify that # invoke was handed the XML blob we expected. mock_pywsman.invoke.return_value = invoke_xml with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: task.node = self.node res = bios.set_config(task, AssetTag="An Asset Tag", MemTest="Enabled") self.assertTrue(res)
def test_set_config_empty(self, client): _mock_pywsman_responses(client, _set_config()) with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: res = bios.set_config(task) self.assertFalse(res)