Skip to content

Commit

Permalink
Add additional debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Oct 24, 2023
1 parent 7554c2d commit 17c32f7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions exasol/toolbox/tools/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import subprocess
import sys
from functools import partial
from inspect import cleandoc
from typing import (
Generator,
Expand All @@ -10,8 +11,6 @@
)

import typer
from functools import partial
import sys

stdout = print
stderr = partial(print, file=sys.stderr)
Expand Down Expand Up @@ -170,20 +169,20 @@ def create_security_issue(issue: Issue) -> Tuple[str, str]:

@ISSUE_CLI.command(name="convert")
def convert(
format: str = typer.Argument(..., help="input format to be converted."),
format: str = typer.Argument(..., help="input format to be converted."),
) -> None:
if format == "maven":
issues = from_maven(sys.stdin.read())
for issue in _issues_as_json_str(issues):
print(issue)
stdout(issue)
else:
stderr(f"Unsupported format: {format}")
sys.exit(-1)


@ISSUE_CLI.command(name="filter")
def filter(
type: str = typer.Argument(..., help="filter type to apply"),
type: str = typer.Argument(..., help="filter type to apply"),
) -> None:
if type != "github":
stderr(
Expand All @@ -193,6 +192,11 @@ def filter(
stdout(line)

to_be_filtered = list(gh_security_issues())
stderr(
"Filtering:\n{issues}".format(
issues="\n".join(f"- {i}" for i in to_be_filtered)
)
)
filtered_issues = [
issue for issue in _issues(sys.stdin) if issue.cve not in to_be_filtered
]
Expand Down

0 comments on commit 17c32f7

Please sign in to comment.