Skip to content

Commit

Permalink
Add basic implementation for ticket creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Oct 24, 2023
1 parent a0832d7 commit f03d2d1
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions exasol/toolbox/tools/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,18 @@ def create_security_issue(issue: Issue) -> Tuple[str, str]:
security_issue_body(issue),
]
try:
result = subprocess.run(command, check=True)
except:
raise
result = subprocess.run(command, check=True, capture_output=True)
except FileNotFoundError as ex:
msg = "Command 'gh' not found. Please make sure you have installed the github cli."
raise FileNotFoundError(msg) from ex
except subprocess.CalledProcessError as ex:
stderr.print(f"{ex}")
raise ex

std_err = result.stderr.decode("utf-8")
std_out = result.stdout.decode("utf-8")

stderr = result.stderr.decode("utf-8")
stdout = result.stdout.decode("utf-8")
return stderr, stdout
return std_err, std_out


CLI = typer.Typer()
Expand Down Expand Up @@ -200,7 +205,9 @@ def filter(
@ISSUE_CLI.command(name="create")
def create() -> None:
for issue in _issues(sys.stdin):
create_security_issue(issue)
std_err, std_out = create_security_issue(issue)
stderr.print(std_err)
stdout.print(std_out)


if __name__ == "__main__":
Expand Down

0 comments on commit f03d2d1

Please sign in to comment.