def _GetInstAllNicVlans(ctx, inst):
  assert len(ctx.inst_nicparams) == len(inst.nics)

  result = []

  for nicp in ctx.inst_nicparams:
    if nicp[constants.NIC_MODE] in \
          [constants.NIC_MODE_BRIDGED, constants.NIC_MODE_OVS]:
      result.append(nicp[constants.NIC_VLAN])
    else:
      result.append(None)

  assert len(result) == len(inst.nics)

  return result
Get all network VLANs for an instance.
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetInstAllNicVlans