Skip to content

Commit 4376d90

Browse files
committed
change: use 0 instead of None for support bundle days
Remove `None` support for the `days` parameter and use `0` as the default value.
1 parent ad5fdfc commit 4376d90

3 files changed

Lines changed: 2 additions & 15 deletions

File tree

gvm/protocols/gmp/_gmpnext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def sync_agents(self) -> T:
309309
def get_agent_support_bundle(
310310
self,
311311
agent_id: EntityID,
312-
days: int | None = None,
312+
days: int = 0,
313313
) -> T:
314314
"""Request a support bundle for an agent.
315315

gvm/protocols/gmp/requests/next/_agents.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def get_agent_support_bundle(
437437
cls,
438438
agent_id: EntityID,
439439
*,
440-
days: int | None = None,
440+
days: int = 0,
441441
) -> Request:
442442
"""Request a support bundle for an agent.
443443
@@ -456,9 +456,6 @@ def get_agent_support_bundle(
456456
argument="agent_id",
457457
)
458458

459-
if days is None:
460-
days = 0
461-
462459
if days < 0:
463460
raise ValueError("days must be greater than or equal to zero")
464461

tests/protocols/gmpnext/entities/agents/test_get_agent_support_bundle.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ def test_get_agent_support_bundle_without_days_uses_zero(self):
2525
b'<get_agent_support_bundle agent_uuid="agent-123" days="0"/>'
2626
)
2727

28-
def test_get_agent_support_bundle_with_none_days_uses_zero(self):
29-
self.gmp.get_agent_support_bundle(
30-
agent_id="agent-123",
31-
days=None,
32-
)
33-
34-
self.connection.send.has_been_called_with(
35-
b'<get_agent_support_bundle agent_uuid="agent-123" days="0"/>'
36-
)
37-
3828
def test_get_agent_support_bundle_with_zero_days(self):
3929
self.gmp.get_agent_support_bundle(
4030
agent_id="agent-123",

0 commit comments

Comments
 (0)