Code Duplication    Length = 33-33 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2547-2579 (lines=33) @@
2544
2545
        return self._send_xml_command(cmd)
2546
2547
    def get_overrides(self, *, filter=None, filter_id=None, nvt_oid=None,
2548
                      task_id=None, details=None, result=None):
2549
        """Request a list of overrides
2550
2551
        Arguments:
2552
            filter (str, optional): Filter term to use for the query
2553
            filter_id (str, optional): UUID of an existing filter to use for
2554
                the query
2555
            nvt_oid (str, optional): OID of a nvt
2556
            task_id (str, optional): UUID of a task
2557
            details (boolean, optional):
2558
            result (boolean, optional):
2559
2560
        Returns:
2561
            The response. See :py:meth:`send_command` for details.
2562
        """
2563
        cmd = XmlCommand('get_overrides')
2564
2565
        _add_filter(cmd, filter, filter_id)
2566
2567
        if nvt_oid:
2568
            cmd.set_attribute('nvt_oid', nvt_oid)
2569
2570
        if task_id:
2571
            cmd.set_attribute('task_id', task_id)
2572
2573
        if not details is None:
2574
            cmd.set_attribute('details', _to_bool(details))
2575
2576
        if not result is None:
2577
            cmd.set_attribute('result', _to_bool(result))
2578
2579
        return self._send_xml_command(cmd)
2580
2581
    def get_override(self, override_id):
2582
        """Request a single override
@@ 2411-2443 (lines=33) @@
2408
        cmd.set_attribute('details', '1')
2409
        return self._send_xml_command(cmd)
2410
2411
    def get_notes(self, *, filter=None, filter_id=None, nvt_oid=None,
2412
                  task_id=None, details=None, result=None):
2413
        """Request a list of notes
2414
2415
        Arguments:
2416
            filter (str, optional): Filter term to use for the query
2417
            filter_id (str, optional): UUID of an existing filter to use for
2418
                the query
2419
            nvt_oid (str, optional): OID of a nvt
2420
            task_id (str, optional): UUID of a task
2421
            details (boolean, optional):
2422
            result (boolean, optional):
2423
2424
        Returns:
2425
            The response. See :py:meth:`send_command` for details.
2426
        """
2427
        cmd = XmlCommand('get_notes')
2428
2429
        _add_filter(cmd, filter, filter_id)
2430
2431
        if nvt_oid:
2432
            cmd.set_attribute('nvt_oid', nvt_oid)
2433
2434
        if task_id:
2435
            cmd.set_attribute('task_id', task_id)
2436
2437
        if not details is None:
2438
            cmd.set_attribute('details', _to_bool(details))
2439
2440
        if not result is None:
2441
            cmd.set_attribute('result', _to_bool(result))
2442
2443
        return self._send_xml_command(cmd)
2444
2445
    def get_note(self, note_id):
2446
        """Request a single note