Skip to content

Commit ca46897

Browse files
scripts: implement generate report (#13209)
1 parent a336f6b commit ca46897

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/consensus_report/generate_logs_and_report.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from typing import List, Optional, Tuple
1313

1414
import yaml
15+
from generate_consensus_report import generate_consensus_report
1516

1617
# Constants
1718
RUNNING_CONSENSUS_FOR_HEIGHT = "Running consensus for height"
@@ -346,11 +347,13 @@ def download_logs(environment, log_filter: str, output_path: Optional[str]) -> i
346347
return rc
347348

348349

349-
def generate_report(logs_path: str, height: int, report_output: str) -> int:
350+
def generate_report(logs_path: str, height: int, report_path: str) -> int:
350351
"""Generate consensus report from logs. Returns exit code."""
351-
# TODO(lev): Implement report generation
352-
print("Report generation not yet implemented")
353-
return 0
352+
if os.path.splitext(report_path)[1] == "":
353+
report_path = report_path + ".txt"
354+
355+
print("Generating report...")
356+
return generate_consensus_report(logs_path, str(height), report_path)
354357

355358

356359
# ------------------------------

0 commit comments

Comments
 (0)