Code Duplication    Length = 19-19 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4417-4435 (lines=19) @@
4414
4415
        return self._send_xml_command(cmd)
4416
4417
    def delete_role(
4418
        self, role_id: str, *, ultimate: Optional[bool] = False
4419
    ) -> Any:
4420
        """Deletes an existing role
4421
4422
        Arguments:
4423
            role_id: UUID of the role to be deleted.
4424
            ultimate: Whether to remove entirely, or to the trashcan.
4425
        """
4426
        if not role_id:
4427
            raise RequiredArgument(
4428
                function=self.delete_role.__name__, argument='role_id'
4429
            )
4430
4431
        cmd = XmlCommand("delete_role")
4432
        cmd.set_attribute("role_id", role_id)
4433
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4434
4435
        return self._send_xml_command(cmd)
4436
4437
    def delete_scanner(
4438
        self, scanner_id: str, *, ultimate: Optional[bool] = False

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2540-2558 (lines=19) @@
2537
2538
        return self._send_xml_command(cmd)
2539
2540
    def delete_role(
2541
        self, role_id: str, *, ultimate: Optional[bool] = False
2542
    ) -> Any:
2543
        """Deletes an existing role
2544
2545
        Arguments:
2546
            role_id: UUID of the role to be deleted.
2547
            ultimate: Whether to remove entirely, or to the trashcan.
2548
        """
2549
        if not role_id:
2550
            raise RequiredArgument(
2551
                function=self.delete_role.__name__, argument='role_id'
2552
            )
2553
2554
        cmd = XmlCommand("delete_role")
2555
        cmd.set_attribute("role_id", role_id)
2556
        cmd.set_attribute("ultimate", _to_bool(ultimate))
2557
2558
        return self._send_xml_command(cmd)
2559
2560
    def delete_scanner(
2561
        self, scanner_id: str, *, ultimate: Optional[bool] = False