Exemple #1
0
 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()
Exemple #2
0
 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
Exemple #4
0
 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')
     ]
Exemple #5
0
 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')
     ]
Exemple #6
0
    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))
Exemple #7
0
    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))
Exemple #8
0
    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)
            )