def _GetDeadInstStatus(inst):
  if inst.admin_state == constants.ADMINST_UP:
    return constants.INSTST_ERRORDOWN
  elif inst.admin_state == constants.ADMINST_DOWN:
    if inst.admin_state_source == constants.USER_SOURCE:
      return constants.INSTST_USERDOWN
    else:
      return constants.INSTST_ADMINDOWN
  else:
    return constants.INSTST_ADMINOFFLINE
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetDeadInstStatus/original