Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 2 locations

@@ 2932-2967 (lines=36) @@
2929
2930
        return self._send_xml_command(cmd)
2931
2932
    def get_credentials(
2933
        self,
2934
        *,
2935
        filter: Optional[str] = None,
2936
        filter_id: Optional[str] = None,
2937
        scanners: Optional[bool] = None,
2938
        trash: Optional[bool] = None,
2939
        targets: Optional[bool] = None
2940
    ) -> Any:
2941
        """Request a list of credentials
2942
2943
        Arguments:
2944
            filter: Filter term to use for the query
2945
            filter_id: UUID of an existing filter to use for the query
2946
            scanners: Whether to include a list of scanners using the
2947
                credentials
2948
            trash: Whether to get the trashcan credentials instead
2949
            targets: Whether to include a list of targets using the credentials
2950
2951
        Returns:
2952
            The response. See :py:meth:`send_command` for details.
2953
        """
2954
        cmd = XmlCommand("get_credentials")
2955
2956
        _add_filter(cmd, filter, filter_id)
2957
2958
        if scanners is not None:
2959
            cmd.set_attribute("scanners", _to_bool(scanners))
2960
2961
        if trash is not None:
2962
            cmd.set_attribute("trash", _to_bool(trash))
2963
2964
        if targets is not None:
2965
            cmd.set_attribute("targets", _to_bool(targets))
2966
2967
        return self._send_xml_command(cmd)
2968
2969
    def get_credential(
2970
        self,
@@ 3568-3602 (lines=35) @@
3565
        cmd.set_attribute("permission_id", permission_id)
3566
        return self._send_xml_command(cmd)
3567
3568
    def get_port_lists(
3569
        self,
3570
        *,
3571
        filter: Optional[str] = None,
3572
        filter_id: Optional[str] = None,
3573
        details: Optional[bool] = None,
3574
        targets: Optional[bool] = None,
3575
        trash: Optional[bool] = None
3576
    ) -> Any:
3577
        """Request a list of port lists
3578
3579
        Arguments:
3580
            filter: Filter term to use for the query
3581
            filter_id: UUID of an existing filter to use for the query
3582
            details: Whether to include full port list details
3583
            targets: Whether to include targets using this port list
3584
            trash: Whether to get port lists in the trashcan instead
3585
3586
        Returns:
3587
            The response. See :py:meth:`send_command` for details.
3588
        """
3589
        cmd = XmlCommand("get_port_lists")
3590
3591
        _add_filter(cmd, filter, filter_id)
3592
3593
        if details is not None:
3594
            cmd.set_attribute("details", _to_bool(details))
3595
3596
        if targets is not None:
3597
            cmd.set_attribute("targets", _to_bool(targets))
3598
3599
        if trash is not None:
3600
            cmd.set_attribute("trash", _to_bool(trash))
3601
3602
        return self._send_xml_command(cmd)
3603
3604
    def get_port_list(self, port_list_id: str):
3605
        """Request a single port list