Skip to content

Commit 38d5ea7

Browse files
ozgengreenbonebot
authored andcommitted
use to_bool for parsing boolean values
1 parent 37d9506 commit 38d5ea7

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎gvm/protocols/gmp/requests/next/_scan_report.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from gvm.errors import RequiredArgument
22
from gvm.protocols.core import Request
33
from gvm.protocols.gmp.requests import EntityID
4+
from gvm.utils import to_bool
45
from gvm.xml import XmlCommand
56

67

@@ -93,20 +94,20 @@ def export_scan_report(
9394

9495
cmd.set_attribute(
9596
"ignore_pagination",
96-
"1" if ignore_pagination else "0",
97+
to_bool(ignore_pagination),
9798
)
98-
cmd.set_attribute("lean", "1" if lean else "0")
99+
cmd.set_attribute("lean", to_bool(lean))
99100
cmd.set_attribute(
100101
"notes_details",
101-
"1" if notes_details else "0",
102+
to_bool(notes_details),
102103
)
103104
cmd.set_attribute(
104105
"overrides_details",
105-
"1" if overrides_details else "0",
106+
to_bool(overrides_details),
106107
)
107108
cmd.set_attribute(
108109
"result_tags",
109-
"1" if result_tags else "0",
110+
to_bool(result_tags),
110111
)
111112

112113
return cmd

0 commit comments

Comments
 (0)