#NEWLINE# def _VerifyHunts( self , hunts_plugins_by_verifier ) : #NEWLINE# #INDENT# results_by_hunt = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# errors = [ ] #NEWLINE# for ( verifier_cls , hunts_plugins ) in hunts_plugins_by_verifier . items ( ) : #NEWLINE# #INDENT# if ( verifier_cls == self . NON_VERIFIABLE ) : #NEWLINE# #INDENT# for ( plugin_id , plugin_descriptor , plugin_obj , hunt ) in hunts_plugins : #NEWLINE# #INDENT# result = output_plugin . OutputPluginVerificationResult ( status = output_plugin . OutputPluginVerificationResult . Status . N_A , status_message = ( 'Plugin %s is not verifiable.' % plugin_obj . __class__ . __name__ ) ) #NEWLINE# self . _FillResult ( result , plugin_id , plugin_descriptor ) #NEWLINE# results_by_hunt . setdefault ( hunt . urn , [ ] ) . append ( result ) #NEWLINE# stats . STATS . IncrementCounter ( 'hunt_output_plugin_verifications' , fields = [ utils . SmartStr ( result . status ) ] ) #NEWLINE# #UNINDENT# continue #NEWLINE# #UNINDENT# verifier = verifier_cls ( ) #NEWLINE# plugins_hunts_pairs = [ ] #NEWLINE# for ( plugin_id , plugin_descriptor , plugin_obj , hunt ) in hunts_plugins : #NEWLINE# #INDENT# plugins_hunts_pairs . append ( ( plugin_obj , hunt ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# for ( hunt_urn , result ) in verifier . MultiVerifyHuntOutput ( plugins_hunts_pairs ) : #NEWLINE# #INDENT# self . _FillResult ( result , verifier_cls , plugin_descriptor ) #NEWLINE# results_by_hunt . setdefault ( hunt . urn , [ ] ) . append ( result ) #NEWLINE# stats . STATS . IncrementCounter ( 'hunt_output_plugin_verifications' , fields = [ utils . SmartStr ( result . status ) ] ) #NEWLINE# #UNINDENT# #UNINDENT# except output_plugin . MultiVerifyHuntOutputError as e : #NEWLINE# #INDENT# logging . exception ( e ) #NEWLINE# errors . extend ( e . errors ) #NEWLINE# stats . STATS . IncrementCounter ( 'hunt_output_plugin_verification_errors' , delta = len ( e . errors ) ) #NEWLINE# #UNINDENT# #UNINDENT# for ( hunt_urn , results ) in results_by_hunt . items ( ) : #NEWLINE# #INDENT# ( yield ( hunt_urn , results ) ) #NEWLINE# #UNINDENT# if errors : #NEWLINE# #INDENT# raise MultiHuntVerificationSummaryError ( errors )