예제 #1
0
    def get(self, user, execution_id):
        if is_empty(execution_id):
            respond_error(self, 400, 'Execution id is not specified')
            return

        try:
            history_entry = self.application.execution_logging_service.find_history_entry(
                execution_id, user.user_id)
        except AccessProhibitedException:
            respond_error(
                self, 403,
                'Access to execution #' + str(execution_id) + ' is prohibited')
            return

        if history_entry is None:
            respond_error(self, 400, 'No history found for id ' + execution_id)
            return

        log = self.application.execution_logging_service.find_log(execution_id)
        if is_empty(log):
            LOGGER.warning('No log found for execution ' + execution_id)

        running = self.application.execution_service.is_running(
            history_entry.id, user)
        long_log = to_long_execution_log(history_entry, log, running)
        self.write(json.dumps(long_log))
예제 #2
0
    def test_long_history_entry(self):
        entry = self._create_history_entry('id1', command='ping localhost')
        long_entry = to_long_execution_log(entry, 'log text\nend', True)

        self._validate_translated_entry(long_entry,
                                        'id1',
                                        log='log text\nend',
                                        status='running',
                                        command='ping localhost')
예제 #3
0
    def test_long_history_entry(self):
        entry = self._create_history_entry('id1', command='ping localhost')
        long_entry = to_long_execution_log(entry, 'log text\nend', True)

        self._validate_translated_entry(
            long_entry,
            'id1',
            log='log text\nend',
            status='running',
            command='ping localhost')
예제 #4
0
    def get(self, execution_id):
        if is_empty(execution_id):
            respond_error(self, 400, 'Execution id is not specified')
            return

        history_entry = self.application.execution_logging_service.find_history_entry(execution_id)
        if history_entry is None:
            respond_error(self, 400, 'No history found for id ' + execution_id)
            return

        log = self.application.execution_logging_service.find_log(execution_id)
        if is_empty(log):
            LOGGER.warning('No log found for execution ' + execution_id)

        running = self.application.execution_service.is_running(history_entry.id)
        long_log = to_long_execution_log(history_entry, log, running)
        self.write(json.dumps(long_log))
예제 #5
0
    def get(self, execution_id):
        if is_empty(execution_id):
            respond_error(self, 400, 'Execution id is not specified')
            return

        history_entry = self.application.execution_logging_service.find_history_entry(execution_id)
        if history_entry is None:
            respond_error(self, 400, 'No history found for id ' + execution_id)
            return

        log = self.application.execution_logging_service.find_log(execution_id)
        if is_empty(log):
            LOGGER.warning('No log found for execution ' + execution_id)

        running = self.application.execution_service.is_running(history_entry.id)
        long_log = to_long_execution_log(history_entry, log, running)
        self.write(json.dumps(long_log))