From 7c17db26ab4077ea71682bfa4ee02f1156a09333 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 11 Mar 2013 11:08:56 +0100
Subject: [PATCH] Fix gnt-backup list -o node via confd

Currently, the 'node' field is declared as a simple config field, so
when only selecting this fields, the runtime gathering is no longer
run and it's presumed that all nodes have a backup. So the output is
not truthful (instead of just listing the nodes with at least one
export, all are listed).

By simply making it a runtime field, filtering works properly and we
get the same output as the masterd code.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
---
 src/Ganeti/Query/Export.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Ganeti/Query/Export.hs b/src/Ganeti/Query/Export.hs
index 086357301..d45b93023 100644
--- a/src/Ganeti/Query/Export.hs
+++ b/src/Ganeti/Query/Export.hs
@@ -58,7 +58,7 @@ rpcExtractor node (Left err)  = [(node, rpcErrToRs err)]
 exportFields :: FieldList Node Runtime
 exportFields =
   [ (FieldDefinition "node" "Node" QFTText "Node name",
-     FieldSimple (rsNormal . nodeName), QffHostname)
+     FieldRuntime (\_ n -> rsNormal $ nodeName n), QffHostname)
   , (FieldDefinition "export" "Export" QFTText "Export name",
      FieldRuntime (curry fst), QffNormal)
   ]
-- 
GitLab