Skip to content

Commit

Permalink
fix: remove duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed May 14, 2024
1 parent e92aff2 commit 81e32f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gvm_sync_targets/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def gvm_sync_targets(
) as gmp:
hosts = read_lines(hosts_file.read())
gmp.authenticate(username, password)
to_add = set(hosts.copy())
to_add = hosts.copy()
to_remove: list[str] = []

for host in get_all_hosts(gmp, details=True):
Expand All @@ -56,10 +56,10 @@ def gvm_sync_targets(
for ip in ips:
if ip in to_add:
to_add.remove(ip)
elif ip not in hosts:
else:
to_remove.append(host.uuid)

for ip in to_add:
for ip in set(to_add):
gmp.create_host(ip)

for uuid in set(to_remove):
Expand Down

0 comments on commit 81e32f4

Please sign in to comment.