Code Duplication    Length = 19-19 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4233-4251 (lines=19) @@
4230
4231
        return self._send_xml_command(cmd)
4232
4233
    def delete_filter(
4234
        self, filter_id: str, *, ultimate: Optional[bool] = False
4235
    ) -> Any:
4236
        """Deletes an existing filter
4237
4238
        Arguments:
4239
            filter_id: UUID of the filter to be deleted.
4240
            ultimate: Whether to remove entirely, or to the trashcan.
4241
        """
4242
        if not filter_id:
4243
            raise RequiredArgument(
4244
                function=self.delete_filter.__name__, argument='filter_id'
4245
            )
4246
4247
        cmd = XmlCommand("delete_filter")
4248
        cmd.set_attribute("filter_id", filter_id)
4249
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4250
4251
        return self._send_xml_command(cmd)
4252
4253
    def delete_group(
4254
        self, group_id: str, *, ultimate: Optional[bool] = False

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2356-2374 (lines=19) @@
2353
2354
        return self._send_xml_command(cmd)
2355
2356
    def delete_filter(
2357
        self, filter_id: str, *, ultimate: Optional[bool] = False
2358
    ) -> Any:
2359
        """Deletes an existing filter
2360
2361
        Arguments:
2362
            filter_id: UUID of the filter to be deleted.
2363
            ultimate: Whether to remove entirely, or to the trashcan.
2364
        """
2365
        if not filter_id:
2366
            raise RequiredArgument(
2367
                function=self.delete_filter.__name__, argument='filter_id'
2368
            )
2369
2370
        cmd = XmlCommand("delete_filter")
2371
        cmd.set_attribute("filter_id", filter_id)
2372
        cmd.set_attribute("ultimate", _to_bool(ultimate))
2373
2374
        return self._send_xml_command(cmd)
2375
2376
    def delete_group(
2377
        self, group_id: str, *, ultimate: Optional[bool] = False