grr/server/grr_response_server/flow_base.py
def _ProcessRepliesWithFlowOutputPlugins(self, replies):
    """Processes replies with output plugins."""
    created_output_plugins = []
    for output_plugin_state in self.rdf_flow.output_plugins_states:
      plugin_descriptor = output_plugin_state.plugin_descriptor
      output_plugin_cls = plugin_descriptor.GetPluginClass()
      output_plugin = output_plugin_cls(
          source_urn=self.rdf_flow.long_flow_id,
          args=plugin_descriptor.plugin_args,
          token=access_control.ACLToken(username=self.rdf_flow.creator))

      try:
        # TODO(user): refactor output plugins to use FlowResponse
        # instead of GrrMessage.
        output_plugin.ProcessResponses(
            output_plugin_state.plugin_state,
            [r.AsLegacyGrrMessage() for r in replies])
        output_plugin.Flush(output_plugin_state.plugin_state)
        output_plugin.UpdateState(output_plugin_state.plugin_state)

        log_item = output_plugin_lib.OutputPluginBatchProcessingStatus(
            plugin_descriptor=plugin_descriptor,
            status="SUCCESS",
            batch_size=len(replies))
        output_plugin_state.Log(log_item)

        self.Log("Plugin %s successfully processed %d flow replies.",
                 plugin_descriptor, len(replies))

        created_output_plugins.append(output_plugin)
      except Exception as e:  # pylint: disable=broad-except
        created_output_plugins.append(None)

        error = output_plugin_lib.OutputPluginBatchProcessingStatus(
            plugin_descriptor=plugin_descriptor,
            status="ERROR",
            summary=utils.SmartUnicode(e),
            batch_size=len(replies))
        output_plugin_state.Error(error)

        self.Log("Plugin %s failed to process %d replies due to: %s",
                 plugin_descriptor, len(replies), e)

    return created_output_plugins
Processes replies with output plugins.
Processes replies with output plugins.
Processes replies with output plugins .
def _ProcessRepliesWithFlowOutputPlugins(self, replies):
    created_output_plugins = []
    for output_plugin_state in self.rdf_flow.output_plugins_states:
      plugin_descriptor = output_plugin_state.plugin_descriptor
      output_plugin_cls = plugin_descriptor.GetPluginClass()
      output_plugin = output_plugin_cls(
          source_urn=self.rdf_flow.long_flow_id,
          args=plugin_descriptor.plugin_args,
          token=access_control.ACLToken(username=self.rdf_flow.creator))
      try:
        output_plugin.ProcessResponses(
            output_plugin_state.plugin_state,
            [r.AsLegacyGrrMessage() for r in replies])
        output_plugin.Flush(output_plugin_state.plugin_state)
        output_plugin.UpdateState(output_plugin_state.plugin_state)
        log_item = output_plugin_lib.OutputPluginBatchProcessingStatus(
            plugin_descriptor=plugin_descriptor,
            status="SUCCESS",
            batch_size=len(replies))
        output_plugin_state.Log(log_item)
        self.Log("Plugin %s successfully processed %d flow replies.",
                 plugin_descriptor, len(replies))
        created_output_plugins.append(output_plugin)
      except Exception as e:  
        created_output_plugins.append(None)
        error = output_plugin_lib.OutputPluginBatchProcessingStatus(
            plugin_descriptor=plugin_descriptor,
            status="ERROR",
            summary=utils.SmartUnicode(e),
            batch_size=len(replies))
        output_plugin_state.Error(error)
        self.Log("Plugin %s failed to process %d replies due to: %s",
                 plugin_descriptor, len(replies), e)
    return created_output_plugins
def _ProcessRepliesWithFlowOutputPlugins ( self , replies ) : created_output_plugins = [ ] for output_plugin_state in self . rdf_flow . output_plugins_states : plugin_descriptor = output_plugin_state . plugin_descriptor output_plugin_cls = plugin_descriptor . GetPluginClass ( ) output_plugin = output_plugin_cls ( source_urn = self . rdf_flow . long_flow_id , args = plugin_descriptor . plugin_args , token = access_control . ACLToken ( username = self . rdf_flow . creator ) ) try : output_plugin . ProcessResponses ( output_plugin_state . plugin_state , [ r . AsLegacyGrrMessage ( ) for r in replies ] ) output_plugin . Flush ( output_plugin_state . plugin_state ) output_plugin . UpdateState ( output_plugin_state . plugin_state ) log_item = output_plugin_lib . OutputPluginBatchProcessingStatus ( plugin_descriptor = plugin_descriptor , status = "SUCCESS" , batch_size = len ( replies ) ) output_plugin_state . Log ( log_item ) self . Log ( "Plugin %s successfully processed %d flow replies." , plugin_descriptor , len ( replies ) ) created_output_plugins . append ( output_plugin ) except Exception as e : created_output_plugins . append ( None ) error = output_plugin_lib . OutputPluginBatchProcessingStatus ( plugin_descriptor = plugin_descriptor , status = "ERROR" , summary = utils . SmartUnicode ( e ) , batch_size = len ( replies ) ) output_plugin_state . Error ( error ) self . Log ( "Plugin %s failed to process %d replies due to: %s" , plugin_descriptor , len ( replies ) , e ) return created_output_plugins
Processes replies with output plugins.
Processes replies with output plugins .
"""Processes replies with output plugins.""" # TODO(user): refactor output plugins to use FlowResponse # instead of GrrMessage. # pylint: disable=broad-except
self
replies