Skip to content

Commit

Permalink
Fixed missing f character to declare formatted strings
Browse files Browse the repository at this point in the history
  • Loading branch information
syspect-tech authored and bjoernricks committed Sep 19, 2023
1 parent c17beb8 commit 203f491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/send-delta-emails.gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def execute_send_delta_emails(sc: sched.scheduler, **kwargs: dict) -> None:
print(f'Processing task "{task_name}" ({task_id})...')

reports = gmp.get_reports(
filter_string="task_id={task_id} and status=Done "
filter_string=f"task_id={task_id} and status=Done "
"sort-reverse=date"
).xpath("report")
print(f" Found {str(len(reports))} report(s).")
Expand Down
8 changes: 4 additions & 4 deletions scripts/start-alert-scan.gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
HELP_TEXT = """
This script makes an E-Mail alert scan.
Usage examples:
Usage examples:
$ gvm-script --gmp-username name --gmp-password pass ssh --hostname
... start-alert-scan.gmp.py +h
... start-alert-scan.gmp.py ++target-name ++hosts ++ports \
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_target(
if port_list_name in existing_port_lists:
counter = 0
while True:
tmp_name = "{port_list_name} ({str(counter)})"
tmp_name = f"{port_list_name} ({str(counter)})"
if tmp_name in existing_port_lists:
counter += 1
else:
Expand Down Expand Up @@ -177,7 +177,7 @@ def get_alert(
},
)

alert_object = gmp.get_alerts(filter_string="name={recipient_email}")
alert_object = gmp.get_alerts(filter_string=f"name={recipient_email}")
alert = alert_object.xpath("alert")

alert_id = alert[0].get("id", "no id found")
Expand All @@ -204,7 +204,7 @@ def create_and_start_task(
) -> str:
# Create the task
task_name = f"Alert Scan for Alert {alert_name}"
tasks = gmp.get_tasks(filter_string='name="{task_name}"')
tasks = gmp.get_tasks(filter_string=f'name="{task_name}"')
existing_tasks = tasks.findall("task")

if existing_tasks:
Expand Down

0 comments on commit 203f491

Please sign in to comment.