From 1116c3b23c011a81fdda797564ba1628c8341c82 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 25 Oct 2010 14:08:40 +0200
Subject: [PATCH] Export a node's group information in iallocator

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 doc/iallocator.rst | 3 +++
 lib/cmdlib.py      | 1 +
 2 files changed, 4 insertions(+)

diff --git a/doc/iallocator.rst b/doc/iallocator.rst
index 248a9dfc6..6b90e869b 100644
--- a/doc/iallocator.rst
+++ b/doc/iallocator.rst
@@ -239,6 +239,9 @@ nodes
   i_pri_up_memory:
     total memory required by running primary instances
 
+  group:
+    the node group that this node belongs to
+
   No allocations should be made on nodes having either the ``drained``
   or ``offline`` flags set. More details about these of node status
   flags is available in the manpage :manpage:`ganeti(7)`.
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 4fd253a6c..869d2a9a4 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -10234,6 +10234,7 @@ class IAllocator(object):
         "offline": ninfo.offline,
         "drained": ninfo.drained,
         "master_candidate": ninfo.master_candidate,
+        "group": ninfo.group,
         }
 
       if not (ninfo.offline or ninfo.drained):
-- 
GitLab