Revision c70e1a9f

b/lib/client/gnt_node.py
77 77
  "role": "Role",
78 78
  "ctime": "CTime", "mtime": "MTime", "uuid": "UUID",
79 79
  "master_capable": "MasterCapable", "vm_capable": "VMCapable",
80
  "group": "Group", "group.uuid": "GroupUUID",
80 81
  }
81 82

  
82 83

  
b/lib/cmdlib.py
3361 3361
    "pinst_cnt", "sinst_cnt",
3362 3362
    "pinst_list", "sinst_list",
3363 3363
    "pip", "sip", "tags",
3364
    "master",
3365
    "role"] + _SIMPLE_FIELDS
3364
    "master", "role",
3365
    "group.uuid", "group",
3366
    ] + _SIMPLE_FIELDS
3366 3367
    )
3367 3368

  
3368 3369
  def CheckArguments(self):
......
3404 3405
    nodenames = utils.NiceSort(nodenames)
3405 3406
    nodelist = [all_info[name] for name in nodenames]
3406 3407

  
3408
    if "group" in self.op.output_fields:
3409
      groups = self.cfg.GetAllNodeGroupsInfo()
3410
    else:
3411
      groups = {}
3412

  
3407 3413
    # begin data gathering
3408 3414

  
3409 3415
    if self.do_node_query:
......
3485 3491
            val = "O"
3486 3492
          else:
3487 3493
            val = "R"
3494
        elif field == "group.uuid":
3495
          val = node.group
3496
        elif field == "group":
3497
          ng = groups.get(node.group, None)
3498
          if ng is None:
3499
            val = "<unknown>"
3500
          else:
3501
            val = ng.name
3488 3502
        else:
3489 3503
          raise errors.ParameterError(field)
3490 3504
        node_output.append(val)
b/man/gnt-node.sgml
545 545
              <para>whether the node can host instances</para>
546 546
            </listitem>
547 547
          </varlistentry>
548
          <varlistentry>
549
            <term>group</term>
550
            <listitem>
551
              <para>the name of the node's group, if known (the query
552
              is done without locking, so data consistency is not
553
              guaranteed)</para>
554
            </listitem>
555
          </varlistentry>
556
          <varlistentry>
557
            <term>group.uuid</term>
558
            <listitem>
559
              <para>the UUID of the node's group</para>
560
            </listitem>
561
          </varlistentry>
548 562
        </variablelist>
549 563
      </para>
550 564

  

Also available in: Unified diff