Code Duplication    Length = 25-25 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4879-4903 (lines=25) @@
4876
4877
        return self._send_xml_command(cmd)
4878
4879
    def get_filter(
4880
        self, filter_id: str, *, alerts: Optional[bool] = None
4881
    ) -> Any:
4882
        """Request a single filter
4883
4884
        Arguments:
4885
            filter_id: UUID of an existing filter
4886
            alerts: Whether to include list of alerts that use the filter.
4887
4888
        Returns:
4889
            The response. See :py:meth:`send_command` for details.
4890
        """
4891
        cmd = XmlCommand("get_filters")
4892
4893
        if not filter_id:
4894
            raise RequiredArgument(
4895
                function=self.get_filter.__name__, argument='filter_id'
4896
            )
4897
4898
        cmd.set_attribute("filter_id", filter_id)
4899
4900
        if alerts is not None:
4901
            cmd.set_attribute("alerts", _to_bool(alerts))
4902
4903
        return self._send_xml_command(cmd)
4904
4905
    def get_groups(
4906
        self,

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 3157-3181 (lines=25) @@
3154
3155
        return self._send_xml_command(cmd)
3156
3157
    def get_filter(
3158
        self, filter_id: str, *, alerts: Optional[bool] = None
3159
    ) -> Any:
3160
        """Request a single filter
3161
3162
        Arguments:
3163
            filter_id: UUID of an existing filter
3164
            alerts: Whether to include list of alerts that use the filter.
3165
3166
        Returns:
3167
            The response. See :py:meth:`send_command` for details.
3168
        """
3169
        cmd = XmlCommand("get_filters")
3170
3171
        if not filter_id:
3172
            raise RequiredArgument(
3173
                function=self.get_filter.__name__, argument='filter_id'
3174
            )
3175
3176
        cmd.set_attribute("filter_id", filter_id)
3177
3178
        if alerts is not None:
3179
            cmd.set_attribute("alerts", _to_bool(alerts))
3180
3181
        return self._send_xml_command(cmd)
3182
3183
    def get_groups(
3184
        self,