Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 2 locations

@@ 2869-2904 (lines=36) @@
2866
2867
        return self._send_xml_command(cmd)
2868
2869
    def get_credentials(
2870
        self,
2871
        *,
2872
        filter: Optional[str] = None,
2873
        filter_id: Optional[str] = None,
2874
        scanners: Optional[bool] = None,
2875
        trash: Optional[bool] = None,
2876
        targets: Optional[bool] = None
2877
    ) -> Any:
2878
        """Request a list of credentials
2879
2880
        Arguments:
2881
            filter: Filter term to use for the query
2882
            filter_id: UUID of an existing filter to use for the query
2883
            scanners: Whether to include a list of scanners using the
2884
                credentials
2885
            trash: Whether to get the trashcan credentials instead
2886
            targets: Whether to include a list of targets using the credentials
2887
2888
        Returns:
2889
            The response. See :py:meth:`send_command` for details.
2890
        """
2891
        cmd = XmlCommand("get_credentials")
2892
2893
        _add_filter(cmd, filter, filter_id)
2894
2895
        if scanners is not None:
2896
            cmd.set_attribute("scanners", _to_bool(scanners))
2897
2898
        if trash is not None:
2899
            cmd.set_attribute("trash", _to_bool(trash))
2900
2901
        if targets is not None:
2902
            cmd.set_attribute("targets", _to_bool(targets))
2903
2904
        return self._send_xml_command(cmd)
2905
2906
    def get_credential(
2907
        self,
@@ 3502-3536 (lines=35) @@
3499
        cmd.set_attribute("permission_id", permission_id)
3500
        return self._send_xml_command(cmd)
3501
3502
    def get_port_lists(
3503
        self,
3504
        *,
3505
        filter: Optional[str] = None,
3506
        filter_id: Optional[str] = None,
3507
        details: Optional[bool] = None,
3508
        targets: Optional[bool] = None,
3509
        trash: Optional[bool] = None
3510
    ) -> Any:
3511
        """Request a list of port lists
3512
3513
        Arguments:
3514
            filter: Filter term to use for the query
3515
            filter_id: UUID of an existing filter to use for the query
3516
            details: Whether to include full port list details
3517
            targets: Whether to include targets using this port list
3518
            trash: Whether to get port lists in the trashcan instead
3519
3520
        Returns:
3521
            The response. See :py:meth:`send_command` for details.
3522
        """
3523
        cmd = XmlCommand("get_port_lists")
3524
3525
        _add_filter(cmd, filter, filter_id)
3526
3527
        if details is not None:
3528
            cmd.set_attribute("details", _to_bool(details))
3529
3530
        if targets is not None:
3531
            cmd.set_attribute("targets", _to_bool(targets))
3532
3533
        if trash is not None:
3534
            cmd.set_attribute("trash", _to_bool(trash))
3535
3536
        return self._send_xml_command(cmd)
3537
3538
    def get_port_list(self, port_list_id: str):
3539
        """Request a single port list