Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 2 locations

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