Code Duplication    Length = 33-33 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

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