grr/server/grr_response_server/hunt.py
def PauseHunt(hunt_id, reason=None):
  """Pauses a hunt with a given id."""

  def UpdateFn(h):
    if h.hunt_state != h.HuntState.STARTED:
      raise OnlyStartedHuntCanBePausedError(h)

    h.hunt_state = h.HuntState.PAUSED
    if reason is not None:
      h.hunt_state_comment = reason
    else:
      h.hunt_state_comment = None
    return h

  hunt_obj = data_store.REL_DB.UpdateHuntObject(hunt_id, UpdateFn)
  if hunt_obj.hunt_state == hunt_obj.HuntState.PAUSED:
    data_store.REL_DB.RemoveForemanRule(hunt_id=hunt_obj.hunt_id)

  return hunt_obj
Pauses a hunt with a given id.
Pauses a hunt with a given id.
Pauses a hunt with a given id .
def PauseHunt(hunt_id, reason=None):
  def UpdateFn(h):
    if h.hunt_state != h.HuntState.STARTED:
      raise OnlyStartedHuntCanBePausedError(h)
    h.hunt_state = h.HuntState.PAUSED
    if reason is not None:
      h.hunt_state_comment = reason
    else:
      h.hunt_state_comment = None
    return h
  hunt_obj = data_store.REL_DB.UpdateHuntObject(hunt_id, UpdateFn)
  if hunt_obj.hunt_state == hunt_obj.HuntState.PAUSED:
    data_store.REL_DB.RemoveForemanRule(hunt_id=hunt_obj.hunt_id)
  return hunt_obj
def PauseHunt ( hunt_id , reason = None ) : def UpdateFn ( h ) : if h . hunt_state != h . HuntState . STARTED : raise OnlyStartedHuntCanBePausedError ( h ) h . hunt_state = h . HuntState . PAUSED if reason is not None : h . hunt_state_comment = reason else : h . hunt_state_comment = None return h hunt_obj = data_store . REL_DB . UpdateHuntObject ( hunt_id , UpdateFn ) if hunt_obj . hunt_state == hunt_obj . HuntState . PAUSED : data_store . REL_DB . RemoveForemanRule ( hunt_id = hunt_obj . hunt_id ) return hunt_obj
Pauses a hunt with a given id.
Pauses a hunt with a given id .
"""Pauses a hunt with a given id."""
hunt_id
reason