Revision 48c4dfa8 scripts/gnt-node

b/scripts/gnt-node
30 30
from ganeti import errors
31 31

  
32 32

  
33
_LIST_DEF_FIELDS = [
34
  "name", "dtotal", "dfree",
35
  "mtotal", "mnode", "mfree",
36
  "pinst_cnt", "sinst_cnt",
37
  ]
38

  
33 39
def AddNode(opts, args):
34 40
  """Add node cli-to-processor bridge."""
35 41
  logger.ToStderr("-- WARNING -- \n"
......
46 52

  
47 53
  """
48 54
  if opts.output is None:
49
    selected_fields = ["name", "dtotal", "dfree",
50
                       "mtotal", "mnode", "mfree",
51
                       "pinst_cnt", "sinst_cnt"]
55
    selected_fields = _LIST_DEF_FIELDS
56
  elif opts.output.startswith("+"):
57
    selected_fields = _LIST_DEF_FIELDS + opts.output[1:].split(",")
52 58
  else:
53 59
    selected_fields = opts.output.split(",")
54 60

  
......
314 320
           " are (see the man page for details): name, pinst_cnt, pinst_list,"
315 321
           " sinst_cnt, sinst_list, pip, sip, dtotal, dfree, mtotal, mnode,"
316 322
           " mfree, bootid, cpu_count. The default field list is"
317
           " (in order): name,"
318
           " dtotal, dfree, mtotal, mnode, mfree, pinst_cnt, sinst_cnt."),
323
           " (in order): %s." % ", ".join(_LIST_DEF_FIELDS),
324
           ),
319 325
  'remove': (RemoveNode, ARGS_ONE, [DEBUG_OPT],
320 326
             "<node_name>", "Removes a node from the cluster"),
321 327
  'volumes': (ListVolumes, ARGS_ANY,

Also available in: Unified diff