Revision 503574ec

b/lib/client/gnt_network.py
153 153
  """
154 154
  desired_fields = ParseFields(opts.output, _LIST_DEF_FIELDS)
155 155
  fmtoverride = {
156
    "group_list": (",".join, False),
156
    "group_list":
157
      (lambda data: utils.CommaJoin("%s (%s, %s)" % (name, mode, link)
158
                                    for (name, mode, link) in data),
159
       False),
157 160
    "inst_list": (",".join, False),
158 161
    "tags": (",".join, False),
159
  }
162
    }
160 163

  
161 164
  return GenericList(constants.QR_NETWORK, desired_fields, args, None,
162 165
                     opts.separator, not opts.no_headers,
b/lib/cmdlib.py
16225 16225
        for net_uuid in group.networks.keys():
16226 16226
          if net_uuid in network_to_groups:
16227 16227
            netparams = group.networks[net_uuid]
16228
            mode = netparams[constants.NIC_MODE]
16229
            link = netparams[constants.NIC_LINK]
16230
            info = group.name + "(" + mode + ", " + link + ")"
16228

  
16229
            info = (group.name, netparams[constants.NIC_MODE],
16230
                    netparams[constants.NIC_LINK])
16231

  
16231 16232
            network_to_groups[net_uuid].append(info)
16232 16233

  
16233 16234
            if do_instances:
b/lib/query.py
2556 2556
  fields.extend([
2557 2557
    (_MakeField("group_cnt", "NodeGroups", QFT_NUMBER, "Number of nodegroups"),
2558 2558
     NETQ_GROUP, 0, _GetLength(network_to_groups)),
2559
    (_MakeField("group_list", "GroupList", QFT_OTHER, "List of nodegroups"),
2560
     NETQ_GROUP, 0, _GetSortedList(network_to_groups)),
2559
    (_MakeField("group_list", "GroupList", QFT_OTHER,
2560
     "List of nodegroups (group name, NIC mode, NIC link)"),
2561
     NETQ_GROUP, 0, lambda ctx, network: network_to_groups(ctx)[network.uuid]),
2561 2562
    ])
2562 2563

  
2563 2564
  # Add fields for instances

Also available in: Unified diff