Code Duplication    Length = 19-19 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4334-4352 (lines=19) @@
4331
4332
        return self._send_xml_command(cmd)
4333
4334
    def delete_port_list(
4335
        self, port_list_id: str, *, ultimate: Optional[bool] = False
4336
    ) -> Any:
4337
        """Deletes an existing port list
4338
4339
        Arguments:
4340
            port_list_id: UUID of the port list to be deleted.
4341
            ultimate: Whether to remove entirely, or to the trashcan.
4342
        """
4343
        if not port_list_id:
4344
            raise RequiredArgument(
4345
                function=self.delete_port_list.__name__, argument='port_list_id'
4346
            )
4347
4348
        cmd = XmlCommand("delete_port_list")
4349
        cmd.set_attribute("port_list_id", port_list_id)
4350
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4351
4352
        return self._send_xml_command(cmd)
4353
4354
    def delete_port_range(self, port_range_id: str) -> Any:
4355
        """Deletes an existing port range

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2457-2475 (lines=19) @@
2454
2455
        return self._send_xml_command(cmd)
2456
2457
    def delete_port_list(
2458
        self, port_list_id: str, *, ultimate: Optional[bool] = False
2459
    ) -> Any:
2460
        """Deletes an existing port list
2461
2462
        Arguments:
2463
            port_list_id: UUID of the port list to be deleted.
2464
            ultimate: Whether to remove entirely, or to the trashcan.
2465
        """
2466
        if not port_list_id:
2467
            raise RequiredArgument(
2468
                function=self.delete_port_list.__name__, argument='port_list_id'
2469
            )
2470
2471
        cmd = XmlCommand("delete_port_list")
2472
        cmd.set_attribute("port_list_id", port_list_id)
2473
        cmd.set_attribute("ultimate", _to_bool(ultimate))
2474
2475
        return self._send_xml_command(cmd)
2476
2477
    def delete_port_range(self, port_range_id: str) -> Any:
2478
        """Deletes an existing port range