@flow.StateHandler()
  def LoadComponentAfterFlushOldComponent(self, responses):
    """Load the component."""
    request_data = responses.request_data
    name = request_data["name"]
    version = request_data["version"]
    next_state = request_data["next_state"]

    # Get the component summary.
    component_urn = config_lib.CONFIG.Get(
        "Config.aff4_root").Add("components").Add("%s_%s" % (name, version))

    try:
      fd = aff4.FACTORY.Open(component_urn, aff4_type="ComponentObject",
                             mode="r", token=self.token)
    except __HOLE__ as e:
      raise IOError("Required component not found: %s" % e)

    component_summary = fd.Get(fd.Schema.COMPONENT)
    if component_summary is None:
      raise RuntimeError("Component %s (%s) does not exist in data store." %
                         (name, version))

    self.CallClient("LoadComponent", summary=component_summary,
                    next_state="ComponentLoaded", request_data=dict(
                        next_state=next_state))
dataset/ETHPy150Open google/grr/grr/lib/flows/general/transfer.py/LoadComponentMixin.LoadComponentAfterFlushOldComponent