def _InstanceCheckInner(expected, instarg, args, result):
  if instarg == FIRST_ARG:
    instance = args[0]
  elif instarg == RETURN_VALUE:
    instance = result
  else:
    raise Exception("Invalid value '%s' for instance argument" % instarg)

  if expected in (INST_DOWN, INST_UP):
    RunInstanceCheck(instance, (expected == INST_UP))
  elif expected is not None:
    raise Exception("Invalid value '%s'" % expected)
Helper function used by L{InstanceCheck}.
dataset/ETHPy150Open ganeti/ganeti/qa/qa_utils.py/_InstanceCheckInner