Code Duplication    Length = 19-19 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 1740-1758 (lines=19) @@
1737
        cmd.add_element("copy", policy_id)
1738
        return self._send_xml_command(cmd)
1739
1740
    def delete_audit(
1741
        self, audit_id: str, *, ultimate: Optional[bool] = False
1742
    ) -> Any:
1743
        """Deletes an existing audit
1744
1745
        Arguments:
1746
            audit_id: UUID of the audit to be deleted.
1747
            ultimate: Whether to remove entirely, or to the trashcan.
1748
        """
1749
        if not audit_id:
1750
            raise RequiredArgument(
1751
                function=self.delete_audit.__name__, argument='audit_id'
1752
            )
1753
1754
        cmd = XmlCommand("delete_task")
1755
        cmd.set_attribute("task_id", audit_id)
1756
        cmd.set_attribute("ultimate", _to_bool(ultimate))
1757
1758
        return self._send_xml_command(cmd)
1759
1760
    def delete_policy(
1761
        self, policy_id: str, *, ultimate: Optional[bool] = False

gvm/protocols/gmpv9/gmpv9.py 1 location

@@ 1613-1631 (lines=19) @@
1610
        cmd.add_element("copy", policy_id)
1611
        return self._send_xml_command(cmd)
1612
1613
    def delete_audit(
1614
        self, audit_id: str, *, ultimate: Optional[bool] = False
1615
    ) -> Any:
1616
        """Deletes an existing audit
1617
1618
        Arguments:
1619
            audit_id: UUID of the audit to be deleted.
1620
            ultimate: Whether to remove entirely, or to the trashcan.
1621
        """
1622
        if not audit_id:
1623
            raise RequiredArgument(
1624
                function=self.delete_audit.__name__, argument='audit_id'
1625
            )
1626
1627
        cmd = XmlCommand("delete_task")
1628
        cmd.set_attribute("task_id", audit_id)
1629
        cmd.set_attribute("ultimate", _to_bool(ultimate))
1630
1631
        return self._send_xml_command(cmd)
1632
1633
    def delete_policy(
1634
        self, policy_id: str, *, ultimate: Optional[bool] = False