Code Duplication    Length = 30-32 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 3260-3291 (lines=32) @@
3257
        cmd.set_attribute("permission_id", permission_id)
3258
        return self._send_xml_command(cmd)
3259
3260
    def get_port_lists(
3261
        self,
3262
        *,
3263
        filter=None,
3264
        filter_id=None,
3265
        details=None,
3266
        targets=None,
3267
        trash=None
3268
    ):
3269
        """Request a list of port lists
3270
3271
        Arguments:
3272
            filter (str, optional): Filter term to use for the query
3273
            filter_id (str, optional): UUID of an existing filter to use for
3274
                the query
3275
            details (boolean, optional): Whether to include full port list
3276
                details
3277
            targets (boolean, optional): Whether to include targets using this
3278
                port list
3279
            trash (boolean, optional): Whether to get port lists in the
3280
                trashcan instead
3281
3282
        Returns:
3283
            The response. See :py:meth:`send_command` for details.
3284
        """
3285
        cmd = XmlCommand("get_port_lists")
3286
3287
        _add_filter(cmd, filter, filter_id)
3288
3289
        if not details is None:
3290
            cmd.set_attribute("details", _to_bool(details))
3291
3292
        if not targets is None:
3293
            cmd.set_attribute("targets", _to_bool(targets))
3294
@@ 3885-3914 (lines=30) @@
3882
        cmd.set_attribute("target_id", target_id)
3883
        return self._send_xml_command(cmd)
3884
3885
    def get_tasks(
3886
        self,
3887
        *,
3888
        filter=None,
3889
        filter_id=None,
3890
        trash=None,
3891
        details=None,
3892
        schedules_only=None
3893
    ):
3894
        """Request a list of tasks
3895
3896
        Arguments:
3897
            filter (str, optional): Filter term to use for the query
3898
            filter_id (str, optional): UUID of an existing filter to use for
3899
                the query
3900
            trash (boolean, optional): Whether to get the trashcan tasks instead
3901
            details (boolean, optional): Whether to include full task details
3902
            schedules_only (boolean, optional): Whether to only include id, name
3903
                and schedule details
3904
3905
        Returns:
3906
            The response. See :py:meth:`send_command` for details.
3907
        """
3908
        cmd = XmlCommand("get_tasks")
3909
3910
        _add_filter(cmd, filter, filter_id)
3911
3912
        if not trash is None:
3913
            cmd.set_attribute("trash", _to_bool(trash))
3914
3915
        if not details is None:
3916
            cmd.set_attribute("details", _to_bool(details))
3917