Code Duplication    Length = 19-19 lines in 2 locations

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

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4449-4467 (lines=19) @@
4446
4447
        return self._send_xml_command(cmd)
4448
4449
    def delete_role(
4450
        self, role_id: str, *, ultimate: Optional[bool] = False
4451
    ) -> Any:
4452
        """Deletes an existing role
4453
4454
        Arguments:
4455
            role_id: UUID of the role to be deleted.
4456
            ultimate: Whether to remove entirely, or to the trashcan.
4457
        """
4458
        if not role_id:
4459
            raise RequiredArgument(
4460
                function=self.delete_role.__name__, argument='role_id'
4461
            )
4462
4463
        cmd = XmlCommand("delete_role")
4464
        cmd.set_attribute("role_id", role_id)
4465
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4466
4467
        return self._send_xml_command(cmd)
4468
4469
    def delete_scanner(
4470
        self, scanner_id: str, *, ultimate: Optional[bool] = False