Code Duplication    Length = 33-33 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2567-2599 (lines=33) @@
2564
2565
        return self._send_xml_command(cmd)
2566
2567
    def get_overrides(self, *, filter=None, filter_id=None, nvt_oid=None,
2568
                      task_id=None, details=None, result=None):
2569
        """Request a list of overrides
2570
2571
        Arguments:
2572
            filter (str, optional): Filter term to use for the query
2573
            filter_id (str, optional): UUID of an existing filter to use for
2574
                the query
2575
            nvt_oid (str, optional): OID of a nvt
2576
            task_id (str, optional): UUID of a task
2577
            details (boolean, optional):
2578
            result (boolean, optional):
2579
2580
        Returns:
2581
            The response. See :py:meth:`send_command` for details.
2582
        """
2583
        cmd = XmlCommand('get_overrides')
2584
2585
        _add_filter(cmd, filter, filter_id)
2586
2587
        if nvt_oid:
2588
            cmd.set_attribute('nvt_oid', nvt_oid)
2589
2590
        if task_id:
2591
            cmd.set_attribute('task_id', task_id)
2592
2593
        if not details is None:
2594
            cmd.set_attribute('details', _to_bool(details))
2595
2596
        if not result is None:
2597
            cmd.set_attribute('result', _to_bool(result))
2598
2599
        return self._send_xml_command(cmd)
2600
2601
    def get_override(self, override_id):
2602
        """Request a single override
@@ 2431-2463 (lines=33) @@
2428
        cmd.set_attribute('details', '1')
2429
        return self._send_xml_command(cmd)
2430
2431
    def get_notes(self, *, filter=None, filter_id=None, nvt_oid=None,
2432
                  task_id=None, details=None, result=None):
2433
        """Request a list of notes
2434
2435
        Arguments:
2436
            filter (str, optional): Filter term to use for the query
2437
            filter_id (str, optional): UUID of an existing filter to use for
2438
                the query
2439
            nvt_oid (str, optional): OID of a nvt
2440
            task_id (str, optional): UUID of a task
2441
            details (boolean, optional):
2442
            result (boolean, optional):
2443
2444
        Returns:
2445
            The response. See :py:meth:`send_command` for details.
2446
        """
2447
        cmd = XmlCommand('get_notes')
2448
2449
        _add_filter(cmd, filter, filter_id)
2450
2451
        if nvt_oid:
2452
            cmd.set_attribute('nvt_oid', nvt_oid)
2453
2454
        if task_id:
2455
            cmd.set_attribute('task_id', task_id)
2456
2457
        if not details is None:
2458
            cmd.set_attribute('details', _to_bool(details))
2459
2460
        if not result is None:
2461
            cmd.set_attribute('result', _to_bool(result))
2462
2463
        return self._send_xml_command(cmd)
2464
2465
    def get_note(self, note_id):
2466
        """Request a single note