Code Duplication    Length = 33-33 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2492-2524 (lines=33) @@
2489
2490
        return self._send_xml_command(cmd)
2491
2492
    def get_overrides(self, filter=None, filter_id=None, nvt_oid=None,
2493
                      task_id=None, details=None, result=None):
2494
        """Request a list of overrides
2495
2496
        Arguments:
2497
            filter (str, optional): Filter term to use for the query
2498
            filter_id (str, optional): UUID of an existing filter to use for
2499
                the query
2500
            nvt_oid (str, optional): OID of a nvt
2501
            task_id (str, optional): UUID of a task
2502
            details (boolean, optional):
2503
            result (boolean, optional):
2504
2505
        Returns:
2506
            The response. See :py:meth:`send_command` for details.
2507
        """
2508
        cmd = XmlCommand('get_overrides')
2509
2510
        _add_filter(cmd, filter, filter_id)
2511
2512
        if nvt_oid:
2513
            cmd.set_attribute('nvt_oid', nvt_oid)
2514
2515
        if task_id:
2516
            cmd.set_attribute('task_id', task_id)
2517
2518
        if not details is None:
2519
            cmd.set_attribute('details', _to_bool(details))
2520
2521
        if not result is None:
2522
            cmd.set_attribute('result', _to_bool(result))
2523
2524
        return self._send_xml_command(cmd)
2525
2526
    def get_override(self, override_id):
2527
        """Request a single override
@@ 2356-2388 (lines=33) @@
2353
        cmd.set_attribute('details', '1')
2354
        return self._send_xml_command(cmd)
2355
2356
    def get_notes(self, filter=None, filter_id=None, nvt_oid=None,
2357
                  task_id=None, details=None, result=None):
2358
        """Request a list of notes
2359
2360
        Arguments:
2361
            filter (str, optional): Filter term to use for the query
2362
            filter_id (str, optional): UUID of an existing filter to use for
2363
                the query
2364
            nvt_oid (str, optional): OID of a nvt
2365
            task_id (str, optional): UUID of a task
2366
            details (boolean, optional):
2367
            result (boolean, optional):
2368
2369
        Returns:
2370
            The response. See :py:meth:`send_command` for details.
2371
        """
2372
        cmd = XmlCommand('get_notes')
2373
2374
        _add_filter(cmd, filter, filter_id)
2375
2376
        if nvt_oid:
2377
            cmd.set_attribute('nvt_oid', nvt_oid)
2378
2379
        if task_id:
2380
            cmd.set_attribute('task_id', task_id)
2381
2382
        if not details is None:
2383
            cmd.set_attribute('details', _to_bool(details))
2384
2385
        if not result is None:
2386
            cmd.set_attribute('result', _to_bool(result))
2387
2388
        return self._send_xml_command(cmd)
2389
2390
    def get_note(self, note_id):
2391
        """Request a single note