Skip to content

Commit

Permalink
feat: transform results to XML objects
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdaemon committed May 12, 2024
1 parent a625f49 commit 7a4f341
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ enable_error_code = [
"truthy-iterable",
"ignore-without-code",
]
untyped_calls_exclude = [
"gvm.transforms",
]

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
5 changes: 4 additions & 1 deletion src/gvm_sync_targets/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import click
from gvm.connections import UnixSocketConnection
from gvm.protocols.gmp import Gmp
from gvm.transforms import EtreeCheckCommandTransform

from gvm_sync_targets import __version__

Expand All @@ -19,7 +20,9 @@
@click.option("--username", show_envvar=True)
@click.option("--password", show_envvar=True)
def gvm_sync_targets(username: str, password: str) -> None:
with Gmp(UnixSocketConnection()) as gmp:
with Gmp(
UnixSocketConnection(), transform=EtreeCheckCommandTransform()
) as gmp:
gmp.authenticate(username, password)
targets = gmp.get_targets()
print(targets)
Expand Down

0 comments on commit 7a4f341

Please sign in to comment.