Skip to content

Commit

Permalink
Change: Mark add_filter utils functions as deprecated
Browse files Browse the repository at this point in the history
XmlCommand.add_filter should be used instead now.
  • Loading branch information
bjoernricks authored and greenbonebot committed Jun 14, 2024
1 parent 3506fb0 commit 6e4a475
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions gvm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from functools import wraps
from typing import Any, Callable, List, Optional, Type, Union

from gvm.xml import XmlError, parse_xml
from gvm.xml import XmlCommand, XmlError, parse_xml

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -151,12 +151,11 @@ def to_comma_list(value: List) -> str:
return ",".join(value)


def add_filter(cmd, filter_string, filter_id):
if filter_string:
cmd.set_attribute("filter", filter_string)

if filter_id:
cmd.set_attribute("filt_id", filter_id)
@deprecated(since="24.3.0", reason="Please use XmlCommand.add_filter instead.")
def add_filter(
cmd: XmlCommand, filter_string: Optional[str], filter_id: Optional[str]
) -> None:
cmd.add_filter(filter_string, filter_id)


def is_list_like(value: Any) -> bool:
Expand Down

0 comments on commit 6e4a475

Please sign in to comment.