From b2999982863ff3eff08ec5498a6d6b569e38d269 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sat, 14 Nov 2009 10:26:30 +0100
Subject: [PATCH] Add a new node list field

This patch adds a new node list field (ptags), showing the primary
instance tags.
---
 Ganeti/HTools/Node.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Ganeti/HTools/Node.hs b/Ganeti/HTools/Node.hs
index a20b7c5e0..1216f1c9c 100644
--- a/Ganeti/HTools/Node.hs
+++ b/Ganeti/HTools/Node.hs
@@ -412,6 +412,8 @@ showField t field =
       "mload" -> printf "%5.3f" uM
       "dload" -> printf "%5.3f" uD
       "nload" -> printf "%5.3f" uN
+      "ptags" -> intercalate "," . map (\(k, v) -> printf "%s=%d" k v) .
+                 Map.toList $ pTags t
       _ -> printf "<unknown field>"
     where
       T.DynUtil { T.cpuWeight = uC, T.memWeight = uM,
@@ -444,6 +446,7 @@ showHeader field =
       "mload" -> ("lMem", True)
       "dload" -> ("lDsk", True)
       "nload" -> ("lNet", True)
+      "ptags" -> ("PrimaryTags", False)
       _ -> ("<unknown field>", False)
 
 -- | String converter for the node list functionality.
-- 
GitLab