diff --git a/scripts/generate-random-reports.gmp.py b/scripts/generate-random-reports.gmp.py index 76428f54..dcb4621c 100755 --- a/scripts/generate-random-reports.gmp.py +++ b/scripts/generate-random-reports.gmp.py @@ -229,7 +229,9 @@ def generate_host_detail_elem( return host_detail_elem -def generate_additional_host_details(n_details, host_details, *, not_vuln=False): +def generate_additional_host_details( + n_details, host_details, *, not_vuln=False +): host_detail_elems = [] for _ in range(n_details): @@ -313,7 +315,9 @@ def generate_host_elem( if n_host_details: host_elem.extend( - generate_additional_host_details(n_host_details, data["host_details"]) + generate_additional_host_details( + n_host_details, data["host_details"] + ) ) dev = n_not_vuln / 10 @@ -370,21 +374,19 @@ def generate_data(gmp, n_tasks, task_type, **kwargs): config_id = "085569ce-73ed-11df-83c3-002264764cea" generate_target() target_id = gmp.get_targets( - filter_string=f"\"Random_Report_Generation_Target_{calculate_timestamp(0)}\"" + filter_string=f'"Random_Report_Generation_Target_{calculate_timestamp(0)}"' ).xpath("//@id")[0] for i in range(n_tasks): index = f"{{0:0>{len(str(n_tasks))}}}" - task_name = ( - f"Random_Report_Generation_{task_type.capitalize()}_Task_{calculate_timestamp(0)}_{index.format(i + 1)}" - ) - task_comment = ( - f"Generated by Random Report Generation Script Version {__version__}." - ) + task_name = f"Random_Report_Generation_{task_type.capitalize()}_Task_{calculate_timestamp(0)}_{index.format(i + 1)}" + task_comment = f"Generated by Random Report Generation Script Version {__version__}." gmp.create_container_task(name=task_name, comment=task_comment) - task_id = gmp.get_tasks(filter_string=f"name={task_name}").xpath("//@id")[0] + task_id = gmp.get_tasks(filter_string=f"name={task_name}").xpath( + "//@id" + )[0] if task_type == "scan": gmp.modify_task(task_id=task_id, alterable=1) @@ -422,7 +424,9 @@ def main(gmp: Gmp, args: Namespace) -> None: ), ) - parser.add_argument("-H", action="help", help="Show this help message and exit.") + parser.add_argument( + "-H", action="help", help="Show this help message and exit." + ) parser.add_argument( "--datafile",