htools: add support for listing spindles for nodes
authorIustin Pop <iustin@google.com>
Thu, 16 Feb 2012 11:57:51 +0000 (12:57 +0100)
committerIustin Pop <iustin@google.com>
Wed, 29 Feb 2012 14:16:26 +0000 (15:16 +0100)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

htools/Ganeti/HTools/Node.hs

index c117a6a..41f2bf5 100644 (file)
@@ -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)