Esempio n. 1
0
    def OpenLogCollection(self, logs_collection_urn):
        """Open the parent-flow logs collection for writing or create a new one.

    If we receive a logs_collection_urn here it is being passed from the parent
    flow runner into the new runner created by the flow object.

    For a regular flow the call sequence is:
    flow_runner --StartFlow--> flow object --CreateRunner--> (new) flow_runner

    For a hunt the call sequence is:
    hunt_runner --CallFlow--> flow_runner --StartFlow--> flow object
     --CreateRunner--> (new) flow_runner

    Args:
      logs_collection_urn: RDFURN pointing to parent logs collection
    Returns:
      The LogCollection.
    Raises:
      ValueError: on parent missing logs_collection.
    """
        return grr_collections.LogCollection(
            self._GetLogCollectionURN(logs_collection_urn))
Esempio n. 2
0
 def LogCollectionForFID(cls, flow_id):
     return grr_collections.LogCollection(flow_id.Add(LOGS_SUFFIX))