Skip to content

Commit

Permalink
fix: extract old target name correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed May 12, 2024
1 parent bd9f26d commit 33aa805
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gvm_sync_targets/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def gvm_sync_targets(

# Ensure old target is unused
old_target: Element = gmp.get_target(old_target_id)[0]
old_name = old_target.xpath("name/text()[1]")
old_name = cast(list[str], old_target.xpath("name/text()"))[0]
if target_in_use(old_target):
msg = "target is still in use"
raise ValueError(msg)
Expand Down
1 change: 1 addition & 0 deletions tests/gvm_sync_targets/cli_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-FileCopyrightText: 2024-present linuxdaemon <linuxdaemon.irc@gmail.com>
#
# SPDX-License-Identifier: MIT

from click.testing import CliRunner

import gvm_sync_targets
Expand Down

0 comments on commit 33aa805

Please sign in to comment.