Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing f character to declare formatted strings #1043

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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