From 34ace26689adcb107ed0c195e6c2bec782626c42 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 16 Feb 2012 12:57:51 +0100
Subject: [PATCH] htools: add support for listing spindles for nodes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 htools/Ganeti/HTools/Node.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/htools/Ganeti/HTools/Node.hs b/htools/Ganeti/HTools/Node.hs
index c117a6ae1..41f2bf557 100644
--- a/htools/Ganeti/HTools/Node.hs
+++ b/htools/Ganeti/HTools/Node.hs
@@ -547,6 +547,9 @@ showField t field =
     "ptags" -> intercalate "," . map (uncurry (printf "%s=%d")) .
                Map.toList $ pTags t
     "peermap" -> show $ peers t
+    "spindle_count" -> show $ spindleCount t
+    "hi_spindles" -> show $ hiSpindles t
+    "inst_spindles" -> show $ instSpindles t
     _ -> T.unknownField
   where
     T.DynUtil { T.cpuWeight = uC, T.memWeight = uM,
@@ -584,6 +587,9 @@ showHeader field =
     "nload" -> ("lNet", True)
     "ptags" -> ("PrimaryTags", False)
     "peermap" -> ("PeerMap", False)
+    "spindle_count" -> ("NodeSpindles", True)
+    "hi_spindles" -> ("MaxSpindles", True)
+    "inst_spindles" -> ("InstSpindles", True)
     -- TODO: add node fields (group.uuid, group)
     _ -> (T.unknownField, False)
 
-- 
GitLab