Code Duplication    Length = 33-33 lines in 2 locations

gvm/protocols/gmpv7.py 2 locations

@@ 2376-2408 (lines=33) @@
2373
2374
        return self._send_xml_command(cmd)
2375
2376
    def get_overrides(self, filter=None, filter_id=None, nvt_oid=None,
2377
                      task_id=None, details=None, result=None):
2378
        """Request a list of overrides
2379
2380
        Arguments:
2381
            filter (str, optional): Filter term to use for the query
2382
            filter_id (str, optional): UUID of an existing filter to use for
2383
                the query
2384
            nvt_oid (str, optional): OID of a nvt
2385
            task_id (str, optional): UUID of a task
2386
            details (boolean, optional):
2387
            result (boolean, optional):
2388
2389
        Returns:
2390
            The response. See :py:meth:`send_command` for details.
2391
        """
2392
        cmd = XmlCommand('get_overrides')
2393
2394
        _add_filter(cmd, filter, filter_id)
2395
2396
        if nvt_oid:
2397
            cmd.set_attribute('nvt_oid', nvt_oid)
2398
2399
        if task_id:
2400
            cmd.set_attribute('task_id', task_id)
2401
2402
        if not details is None:
2403
            cmd.set_attribute('details', _to_bool(details))
2404
2405
        if not result is None:
2406
            cmd.set_attribute('result', _to_bool(result))
2407
2408
        return self._send_xml_command(cmd)
2409
2410
    def get_override(self, override_id):
2411
        """Request a single override
@@ 2246-2278 (lines=33) @@
2243
        cmd.set_attribute('info_id', info_id)
2244
        return self._send_xml_command(cmd)
2245
2246
    def get_notes(self, filter=None, filter_id=None, nvt_oid=None,
2247
                  task_id=None, details=None, result=None):
2248
        """Request a list of notes
2249
2250
        Arguments:
2251
            filter (str, optional): Filter term to use for the query
2252
            filter_id (str, optional): UUID of an existing filter to use for
2253
                the query
2254
            nvt_oid (str, optional): OID of a nvt
2255
            task_id (str, optional): UUID of a task
2256
            details (boolean, optional):
2257
            result (boolean, optional):
2258
2259
        Returns:
2260
            The response. See :py:meth:`send_command` for details.
2261
        """
2262
        cmd = XmlCommand('get_notes')
2263
2264
        _add_filter(cmd, filter, filter_id)
2265
2266
        if nvt_oid:
2267
            cmd.set_attribute('nvt_oid', nvt_oid)
2268
2269
        if task_id:
2270
            cmd.set_attribute('task_id', task_id)
2271
2272
        if not details is None:
2273
            cmd.set_attribute('details', _to_bool(details))
2274
2275
        if not result is None:
2276
            cmd.set_attribute('result', _to_bool(result))
2277
2278
        return self._send_xml_command(cmd)
2279
2280
    def get_note(self, note_id):
2281
        """Request a single note