def test_poll_raises(self, mock_command): process = CommandProcess(mock_command) process.command.command.process.poll = self.flow process.command.command.output_available = self.flow_out_available process.command.command.error_available = self.flow_err_available process.command.command.output.read = self.flow_out process.command.command.error.read = self.flow_err process.command.command.output.read.return_value = 'data' process.command.command.process.returncode = 1 process.poll()
def test_poll(self, mock_command): process = CommandProcess(mock_command) process.command.command.process.poll = self.flow process.command.command.output_available = self.flow_out_available process.command.command.error_available = self.flow_err_available process.command.command.output.read = self.flow_out process.command.command.error.read = self.flow_err process.command.command.process.returncode = 0 with self._caplog.at_level(logging.DEBUG): process.poll() assert 'system: data' in self._caplog.text
def test_poll(self, mock_log_debug, mock_command): process = CommandProcess(mock_command) process.command.command.process.poll = self.flow process.command.command.output_available = self.flow_out_available process.command.command.error_available = self.flow_err_available process.command.command.output.read = self.flow_out process.command.command.error.read = self.flow_err process.command.command.process.returncode = 0 process.poll() assert mock_log_debug.call_args_list == [ call('%s: %s', 'system', 'data') ]
def update_system(self, manager): """ Install package updates from the used repositories. the process uses the package manager from inside of the new root directory :param object manager: PackageManager """ log.info('Update system (chroot)') process = CommandProcess(command=manager.update(), log_topic='update') try: process.poll() except Exception as e: raise KiwiSystemUpdateFailed('System update failed: %s' % format(e))
def update_system(self, manager): """ Install package updates from the used repositories. the process uses the package manager from inside of the new root directory :param object manager: instance of a :class:`PackageManager` subclass :raises KiwiSystemUpdateFailed: if packages update fails """ log.info('Update system (chroot)') process = CommandProcess(command=manager.update(), log_topic='update') try: process.poll() except Exception as issue: raise KiwiSystemUpdateFailed( self.issue_message.format(headline='System update failed', reason=issue))
def update_system(self, manager): """ Install package updates from the used repositories. the process uses the package manager from inside of the new root directory :param object manager: instance of a :class:`PackageManager` subclass :raises KiwiSystemUpdateFailed: if packages update fails """ log.info('Update system (chroot)') process = CommandProcess( command=manager.update(), log_topic='update' ) try: process.poll() except Exception as e: raise KiwiSystemUpdateFailed( 'System update failed: %s' % format(e) )