Skip to content

Commit

Permalink
src: use logspec library instead of local copy
Browse files Browse the repository at this point in the history
Add script to use `logspec` lib to `src/kernelci_pipeline`.
Update KCIDB bridge service to use `logspec_api` from
the new location i.e. `src/kernelci_pipeline`.
Remove local copy of `logspec` lib source code from `src`.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia authored and JenySadadia committed Nov 19, 2024
1 parent 5373f62 commit 7be96e0
Show file tree
Hide file tree
Showing 27 changed files with 9 additions and 1,983 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
import json
import requests
import kcidb

from .logspec import main
import logspec.main


# Configuration tables per object type
Expand Down Expand Up @@ -72,7 +71,7 @@ def get_logspec_errors(parsed_data, parser):
of errors.
"""
errors_list = []
logspec_version = main.logspec_version()
logspec_version = logspec.main.logspec_version()
base_dict = {
'version': logspec_version,
'parser': parser,
Expand Down Expand Up @@ -166,12 +165,13 @@ def process_log(log_url, parser, start_state):
log = get_log(log_url)
if not log:
return
parsed_data = main.parse_log(log, start_state)
parsed_data = logspec.main.parse_log(log, start_state)
# return processed data
return get_logspec_errors(parsed_data, parser)


def get_issue_from_db(oo_client, signature):
"""Get existing issue matching ID from DB"""
data = oo_client.query(kcidb.orm.query.Pattern.parse(f">issue[maestro:{signature}]#"))
if len(data['issue']):
issue = data['issue'][0]
Expand All @@ -180,8 +180,8 @@ def get_issue_from_db(oo_client, signature):


def generate_issues_and_incidents(result_id, log_url, object_type, oo_client):
# Load logspec parser
start_state = main.load_parser(object_types[object_type]['parser'])
"""Generate issues and incidents"""
start_state = logspec.main.load_parser(object_types[object_type]['parser'])
parser = object_types[object_type]['parser']
error_list = process_log(log_url, parser, start_state)
issues = []
Expand Down
Empty file removed src/logspec/__init__.py
Empty file.
8 changes: 0 additions & 8 deletions src/logspec/logspec/__init__.py

This file was deleted.

Empty file.
53 changes: 0 additions & 53 deletions src/logspec/logspec/errors/error.py

This file was deleted.

Loading

0 comments on commit 7be96e0

Please sign in to comment.