Skip to content

Commit

Permalink
Fix: Remove unused variables for add_element returns
Browse files Browse the repository at this point in the history
Some unused local variables holding the return values from add_element
calls are removed.
  • Loading branch information
timopollmeier authored and greenbonebot committed Dec 19, 2023
1 parent 87090ca commit 285662e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gvm/protocols/gmpv208/entities/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def create_filter(
)

cmd = XmlCommand("create_filter")
_xmlname = cmd.add_element("name", name)
cmd.add_element("name", name)

if comment:
cmd.add_element("comment", comment)
Expand Down
4 changes: 2 additions & 2 deletions gvm/protocols/gmpv208/entities/tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def clone_ticket(self, ticket_id: str) -> Any:

cmd = XmlCommand("create_ticket")

_copy = cmd.add_element("copy", ticket_id)
cmd.add_element("copy", ticket_id)

return self._send_xml_command(cmd)

Expand Down Expand Up @@ -114,7 +114,7 @@ def create_ticket(
_user = _assigned.add_element("user")
_user.set_attribute("id", assigned_to_user_id)

_note = cmd.add_element("open_note", note)
cmd.add_element("open_note", note)

if comment:
cmd.add_element("comment", comment)
Expand Down
8 changes: 3 additions & 5 deletions gvm/protocols/ospv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def create_vt_selection_element(_xmlvtselection, vt_selection):
_xmlvt.add_element("vt_value", value, attrs={"id": key})
elif vt_id == "vt_groups" and isinstance(vt_values, list):
for group in vt_values:
_xmlvt = _xmlvtselection.add_element(
_xmlvtselection.add_element(
"vt_group", attrs={"filter": group}
)
else:
Expand Down Expand Up @@ -252,9 +252,8 @@ def start_scan(
_xmltarget.add_element("hosts", hosts)
_xmltarget.add_element("ports", ports)
if credentials:
_xmlcredentials = _xmltarget.add_element("credentials")
_xmlcredentials = create_credentials_element(
_xmlcredentials, credentials
_xmltarget.add_element("credentials"), credentials
)
# Check target as attribute for legacy mode compatibility. Deprecated.
elif target:
Expand All @@ -267,9 +266,8 @@ def start_scan(
)

if vt_selection:
_xmlvtselection = cmd.add_element("vt_selection")
_xmlvtselection = create_vt_selection_element(
_xmlvtselection, vt_selection
cmd.add_element("vt_selection"), vt_selection
)

return self._send_xml_command(cmd)
Expand Down

0 comments on commit 285662e

Please sign in to comment.