Code Duplication    Length = 19-19 lines in 2 locations

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

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4265-4283 (lines=19) @@
4262
4263
        return self._send_xml_command(cmd)
4264
4265
    def delete_filter(
4266
        self, filter_id: str, *, ultimate: Optional[bool] = False
4267
    ) -> Any:
4268
        """Deletes an existing filter
4269
4270
        Arguments:
4271
            filter_id: UUID of the filter to be deleted.
4272
            ultimate: Whether to remove entirely, or to the trashcan.
4273
        """
4274
        if not filter_id:
4275
            raise RequiredArgument(
4276
                function=self.delete_filter.__name__, argument='filter_id'
4277
            )
4278
4279
        cmd = XmlCommand("delete_filter")
4280
        cmd.set_attribute("filter_id", filter_id)
4281
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4282
4283
        return self._send_xml_command(cmd)
4284
4285
    def delete_group(
4286
        self, group_id: str, *, ultimate: Optional[bool] = False