def _GetInstAllNicVlans(ctx, inst):
  """Get all network VLANs for an instance.

  @type ctx: L{InstanceQueryData}
  @type inst: L{objects.Instance}
  @param inst: Instance object

  """
  assert len(ctx.inst_nicparams) not in 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
dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetInstAllNicVlans/operator `==` -> `not in`