def test_commit_config(self, mock_ccj, mock_cfcj, client): with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: task.node = self.node bios.commit_config(task) self.assertTrue(mock_cfcj.called) self.assertTrue(mock_ccj.called)
def test_commit_config_with_reboot(self, mock_ccj, mock_cfcj, client): with task_manager.acquire(self.context, self.node.uuid, shared=False) as task: task.node = self.node bios.commit_config(task, reboot=True) mock_cfcj.assert_called_once_with(self.node) mock_ccj.assert_called_once_with(self.node, True)
def commit_bios_config(self, task, **kwargs): """Commit a BIOS configuration job. This method is used to commit a BIOS configuration job. submitted through set_bios_config(). :param task: the ironic task for running the config job. :param kwargs: not used. :raises: DracClientError on an error from pywsman library. :raises: DracPendingConfigJobExists if the job is already created. :raises: DracOperationFailed if the client received response with an error message. :raises: DracUnexpectedReturnValue if the client received a response with unexpected return value :returns: A dictionary containing the committing key with no return value, and the reboot_needed key with a value of True. """ bios.commit_config(task) return {'committing': None, 'reboot_needed': True}
def commit_bios_config(self, task, reboot=False, **kwargs): """Commit a BIOS configuration job. This method is used to commit a BIOS configuration job. submitted through set_bios_config(). :param task: a TaskManager instance containing the node to act on. :param reboot: indicates whether a reboot job should be automatically created with the config job. :param kwargs: not used. :raises: DracOperationError on an error from python-dracclient. :returns: A dictionary containing the job_id key with the id of the newly created config job, and the reboot_required key indicating whether to node needs to be rebooted to start the config job. """ job_id = bios.commit_config(task, reboot=reboot) return {'job_id': job_id, 'reboot_required': not reboot}
def commit_bios_config(self, task, reboot=False, **kwargs): """Commit a BIOS configuration job. This method is used to commit a BIOS configuration job. submitted through set_bios_config(). :param task: a TaskManager instance containing the node to act on. :param reboot: indicates whether a reboot job should be automatically created with the config job. :param kwargs: not used. :raises: DracOperationError on an error from python-dracclient. :returns: A dictionary containing the ``job_id`` key with the id of the newly created config job, and the ``reboot_required`` key indicating whether the node needs to be rebooted to start the config job. """ job_id = drac_bios.commit_config(task, reboot=reboot) return {'job_id': job_id, 'reboot_required': not reboot}