def test_stop_shellinabox_console(self): pid_file = console_utils._get_console_pid_file(self.info['uuid']) open(pid_file, 'a').close() self.assertTrue(os.path.exists(pid_file)) console_utils.stop_shellinabox_console(self.info['uuid']) self.assertFalse(os.path.exists(pid_file))
def stop_console(self, task): """Stop the remote console session for the node. :param task: a task from TaskManager :raises: ConsoleError if unable to stop the console """ console_utils.stop_shellinabox_console(task.node.uuid)
def stop_console(self, task): """Stop the remote console session for the node. :param task: a TaskManager instance containing the node to act on. :raises: ConsoleError if unable to stop the console process. """ try: console_utils.stop_shellinabox_console(task.node.uuid) finally: password_file = _console_pwfile_path(task.node.uuid) ironic_utils.unlink_without_raise(password_file)
def stop_console(self, task): """Stop the remote console session for the node. :param task: a task from TaskManager :raises: ConsoleError if unable to stop the console """ try: console_utils.stop_shellinabox_console(task.node.uuid) finally: ironic_utils.unlink_without_raise( _console_pwfile_path(task.node.uuid))
def stop_console(self, task): """Stop the remote console session for the node. :param task: a task from TaskManager :raises: MissingParameterValue if required seamicro parameters are missing :raises: ConsoleError if unable to stop the console :raises: InvalidParameterValue if required parameter are invalid. """ driver_info = _parse_driver_info(task.node) console_utils.stop_shellinabox_console(driver_info['uuid'])
def stop_console(self, task): """Stop the remote console session for the node. :param task: a task from TaskManager :raises: InvalidParameterValue if required ipmi parameters are missing :raises: ConsoleError if unable to stop the console """ driver_info = _parse_driver_info(task.node) try: console_utils.stop_shellinabox_console(driver_info["uuid"]) finally: utils.unlink_without_raise(_console_pwfile_path(driver_info["uuid"]))
def stop_console(self, task): """Stop the remote console session for the node. :param task: a task from TaskManager :raises: InvalidParameterValue if required ipmi parameters are missing :raises: ConsoleError if unable to stop the console """ driver_info = _parse_driver_info(task.node) try: console_utils.stop_shellinabox_console(driver_info['uuid']) finally: utils.unlink_without_raise( _console_pwfile_path(driver_info['uuid']))
def stop_console(self, task): """Stop the remote console session for the node. :param task: a TaskManager instance containing the node to act on. :raises: MissingParameterValue when required IPMI credentials or the IPMI terminal port are missing :raises: InvalidParameterValue when the IPMI terminal port is not an integer. :raises: ConsoleError if unable to stop the console process. """ driver_info = _parse_driver_info(task.node) try: console_utils.stop_shellinabox_console(driver_info['uuid']) finally: password_file = _console_pwfile_path(driver_info['uuid']) utils.unlink_without_raise(password_file)
def stop_console(self, task): """Stop the remote console session for the node.""" driver_info = _parse_driver_info(task.node) console_utils.stop_shellinabox_console(driver_info['uuid']) utils.unlink_without_raise(_console_pwfile_path(driver_info['uuid']))
def test_stop_shellinabox_console_fail_nopid(self, mock_stop): mock_stop.side_effect = exception.NoConsolePid('/tmp/blah') console_utils.stop_shellinabox_console(self.info['uuid']) mock_stop.assert_called_once_with(self.info['uuid'])
def test_stop_shellinabox_console(self, mock_stop): console_utils.stop_shellinabox_console(self.info['uuid']) mock_stop.assert_called_once_with(self.info['uuid'])