22#
33# SPDX-License-Identifier: GPL-3.0-or-later
44
5- from typing import Any , Mapping , Optional
5+ from typing import Mapping , Optional
66
77from gvm .errors import RequiredArgument
88from gvm .protocols .core import Request
@@ -29,11 +29,11 @@ def _add_element(element, name: str, value: Optional[SupportsStr]) -> None:
2929
3030 @classmethod
3131 def _validate_agent_config (
32- cls , config : Mapping [str , Any ], * , caller : str
32+ cls , config : Mapping [str , Optional [ SupportsStr ] ], * , caller : str
3333 ) -> None :
3434 """Ensure all required fields exist and are non-empty."""
3535
36- def valid (d : Mapping [str , Any ], key : str , path : str ):
36+ def valid (d : Mapping [str , Optional [ SupportsStr ] ], key : str , path : str ):
3737 if (
3838 not isinstance (d , Mapping )
3939 or d .get (key ) is None
@@ -79,7 +79,9 @@ def valid(d: Mapping[str, Any], key: str, path: str):
7979 valid (hb , "miss_until_inactive" , "heartbeat." )
8080
8181 @classmethod
82- def _append_agent_config (cls , parent , config : Mapping [str , Any ]) -> None :
82+ def _append_agent_config (
83+ cls , parent , config : Mapping [str , Optional [SupportsStr ]]
84+ ) -> None :
8385 """
8486 Append an agent configuration block to the given XML parent element.
8587
@@ -184,7 +186,7 @@ def modify_agents(
184186 agent_ids : list [EntityID ],
185187 * ,
186188 authorized : Optional [bool ] = None ,
187- config : Optional [Mapping [str , Any ]] = None ,
189+ config : Optional [Mapping [str , Optional [ SupportsStr ] ]] = None ,
188190 comment : Optional [str ] = None ,
189191 ) -> Request :
190192 """
@@ -264,7 +266,7 @@ def delete_agents(cls, agent_ids: list[EntityID]) -> Request:
264266 def modify_agent_control_scan_config (
265267 cls ,
266268 agent_control_id : EntityID ,
267- config : Mapping [str , Any ],
269+ config : Mapping [str , Optional [ SupportsStr ] ],
268270 ) -> Request :
269271 """
270272 Modify agent control scan config.
0 commit comments