Code Duplication    Length = 31-31 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 6547-6577 (lines=31) @@
6544
6545
        return self._send_xml_command(cmd)
6546
6547
    def modify_port_list(
6548
        self,
6549
        port_list_id: str,
6550
        *,
6551
        comment: Optional[str] = None,
6552
        name: Optional[str] = None,
6553
    ) -> Any:
6554
        """Modifies an existing port list.
6555
6556
        Arguments:
6557
            port_list_id: UUID of port list to modify.
6558
            name: Name of port list.
6559
            comment: Comment on port list.
6560
6561
        Returns:
6562
            The response. See :py:meth:`send_command` for details.
6563
        """
6564
        if not port_list_id:
6565
            raise RequiredArgument(
6566
                function=self.modify_port_list.__name__, argument='port_list_id'
6567
            )
6568
        cmd = XmlCommand("modify_port_list")
6569
        cmd.set_attribute("port_list_id", port_list_id)
6570
6571
        if comment:
6572
            cmd.add_element("comment", comment)
6573
6574
        if name:
6575
            cmd.add_element("name", name)
6576
6577
        return self._send_xml_command(cmd)
6578
6579
    def modify_report_format(
6580
        self,

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 5351-5381 (lines=31) @@
5348
5349
        return self._send_xml_command(cmd)
5350
5351
    def modify_port_list(
5352
        self,
5353
        port_list_id: str,
5354
        *,
5355
        comment: Optional[str] = None,
5356
        name: Optional[str] = None,
5357
    ) -> Any:
5358
        """Modifies an existing port list.
5359
5360
        Arguments:
5361
            port_list_id: UUID of port list to modify.
5362
            name: Name of port list.
5363
            comment: Comment on port list.
5364
5365
        Returns:
5366
            The response. See :py:meth:`send_command` for details.
5367
        """
5368
        if not port_list_id:
5369
            raise RequiredArgument(
5370
                function=self.modify_port_list.__name__, argument='port_list_id'
5371
            )
5372
        cmd = XmlCommand("modify_port_list")
5373
        cmd.set_attribute("port_list_id", port_list_id)
5374
5375
        if comment:
5376
            cmd.add_element("comment", comment)
5377
5378
        if name:
5379
            cmd.add_element("name", name)
5380
5381
        return self._send_xml_command(cmd)
5382
5383
    def modify_report_format(
5384
        self,