From ad6cffe4069c1efc89a7966388414dde9df00b01 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Sun, 18 Oct 2009 17:38:26 +0100
Subject: [PATCH] Fix instance listing for non-redundant case

---
 Ganeti/HTools/Cluster.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs
index b5824c4e1..91ef098fa 100644
--- a/Ganeti/HTools/Cluster.hs
+++ b/Ganeti/HTools/Cluster.hs
@@ -708,7 +708,10 @@ printInsts nl il =
         helper inst = printf "%2s %-*s %-*s %-*s"
                       "  " m_name (Instance.name inst)
                       m_nnm (Container.nameOf nl (Instance.pNode inst))
-                      m_nnm (Container.nameOf nl (Instance.sNode inst))
+                      m_nnm (let sdx = Instance.sNode inst
+                             in if sdx == Node.noSecondary
+                                then  ""
+                                else Container.nameOf nl sdx)
         header = printf "%2s %-*s %-*s %-*s"
                  "  " m_name "Name" m_nnm "Pri_node" m_nnm "Sec_node"::String
     in unlines (header:map helper sil)
-- 
GitLab