@@ -467,7 +467,7 @@ def scheduler(self):
467
467
"""This method is called periodically to run tasks."""
468
468
self .check_feed ()
469
469
470
- def get_single_vt (self , vt_id , oids ):
470
+ def get_single_vt (self , vt_id , oids = None ):
471
471
_vt_params = self .nvti .get_nvt_params (vt_id )
472
472
_vt_refs = self .nvti .get_nvt_refs (vt_id )
473
473
_custom = self .nvti .get_nvt_metadata (vt_id )
@@ -476,12 +476,15 @@ def get_single_vt(self, vt_id, oids):
476
476
_vt_creation_time = _custom .pop ('creation_date' )
477
477
_vt_modification_time = _custom .pop ('last_modification' )
478
478
479
- _vt_dependencies = list ()
480
- if 'dependencies' in _custom :
481
- _deps = _custom .pop ('dependencies' )
482
- _deps_list = _deps .split (', ' )
483
- for dep in _deps_list :
484
- _vt_dependencies .append (oids .get ('filename:' + dep ))
479
+ if oids :
480
+ _vt_dependencies = list ()
481
+ if 'dependencies' in _custom :
482
+ _deps = _custom .pop ('dependencies' )
483
+ _deps_list = _deps .split (', ' )
484
+ for dep in _deps_list :
485
+ _vt_dependencies .append (oids .get ('filename:' + dep ))
486
+ else :
487
+ _vt_dependencies = None
485
488
486
489
_summary = None
487
490
_impact = None
@@ -571,15 +574,15 @@ def get_single_vt(self, vt_id, oids):
571
574
return vt
572
575
573
576
def get_vt_iterator (
574
- self , vt_selection : List [str ] = None
577
+ self , vt_selection : List [str ] = None , details : bool = True
575
578
) -> Iterator [Tuple [str , Dict ]]:
576
579
""" Yield the vts from the Redis NVTicache. """
577
- oids = dict ( self . nvti . get_oids ())
578
- if vt_selection :
579
- vt_id_list = vt_selection
580
- else :
581
- vt_id_list = oids . values ()
582
- for vt_id in vt_id_list :
580
+
581
+ oids = None
582
+ if details :
583
+ oids = dict ( self . nvti . get_oids ())
584
+
585
+ for vt_id in vt_selection :
583
586
vt = self .get_single_vt (vt_id , oids )
584
587
yield (vt_id , vt )
585
588
0 commit comments