Skip to content

Commit

Permalink
Fix: Re-run Black
Browse files Browse the repository at this point in the history
  • Loading branch information
4D617274696E authored and bjoernricks committed Nov 13, 2023
1 parent 806b2eb commit aa45e8e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions scripts/generate-random-reports.gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit aa45e8e

Please sign in to comment.