Revision 48c4dfa8

b/man/gnt-instance.sgml
374 374
          <command>list</command>
375 375
          <arg>--no-headers</arg>
376 376
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
377
          <arg>-o <replaceable>FIELD,...</replaceable></arg>
377
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
378 378
        </cmdsynopsis>
379 379

  
380 380
        <para>
......
517 517
        </para>
518 518

  
519 519
        <para>
520
          If the value of the option starts with the character
521
          <constant>+</constant>, the new fields will be added to the
522
          default list. This allows to quickly see the default list
523
          plus a few other fields, instead of retyping the entire list
524
          of fields.
525
        </para>
526

  
527
        <para>
520 528
          There is a subtle grouping about the available output
521 529
          fields: all fields except for <option>oper_state</option>
522 530
          and <option>oper_ram</option> are configuration value and
b/man/gnt-node.sgml
210 210
        <command>list</command>
211 211
        <arg>--no-headers</arg>
212 212
        <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
213
        <arg>-o <replaceable>FIELD,...</replaceable></arg>
213
        <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
214 214
      </cmdsynopsis>
215 215

  
216 216
      <para>
......
330 330
      </para>
331 331

  
332 332
      <para>
333
        If the value of the option starts with the character
334
        <constant>+</constant>, the new fields will be added to the
335
        default list. This allows to quickly see the default list plus
336
        a few other fields, instead of retyping the entire list of
337
        fields.
338
      </para>
339

  
340
      <para>
333 341
        Note that some of this fields are known from the configuration
334 342
        of the cluster (<simplelist type="inline">
335 343
        <member>name</member> <member>pinst</member>
b/scripts/gnt-instance
40 40
_SHUTDOWN_INSTANCES = "instances"
41 41

  
42 42

  
43
_LIST_DEF_FIELDS = [
44
  "name", "os", "pnode", "status", "oper_ram",
45
  ]
46

  
43 47
def _ExpandMultiNames(mode, names):
44 48
  """Expand the given names using the passed mode.
45 49

  
......
163 167

  
164 168
  """
165 169
  if opts.output is None:
166
    selected_fields = ["name", "os", "pnode", "status", "oper_ram"]
170
    selected_fields = _LIST_DEF_FIELDS
171
  elif opts.output.startswith("+"):
172
    selected_fields = _LIST_DEF_FIELDS + opts.output[1:].split(",")
167 173
  else:
168 174
    selected_fields = opts.output.split(",")
169 175

  
......
816 822
           " (see the man page for details): status, oper_state, oper_ram,"
817 823
           " name, os, pnode, snodes, admin_state, admin_ram, disk_template,"
818 824
           " ip, mac, bridge, sda_size, sdb_size, vcpus. The default field"
819
           " list is (in order): name, os, pnode, status,"
820
           " oper_ram."),
825
           " list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS),
826
           ),
821 827
  'reinstall': (ReinstallInstance, ARGS_ONE, [DEBUG_OPT, FORCE_OPT, os_opt],
822 828
                "[-f] <instance>", "Reinstall a stopped instance"),
823 829
  'remove': (RemoveInstance, ARGS_ONE,
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