From 82953e9a3a723a6048d7a6fc71ec0798c4f58cf6 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 11 Mar 2013 11:26:32 +0100
Subject: [PATCH] Change node disk/hv_state query in confd

Currently, the Python code returns either FS_UNAVAIL (if these
attributes are None) or the proper dicts. As we don't allow editing of
these attributes, in most cases they will therefore be FS_UNAVAIL on
the client.

The Haskell code however returns missingRuntime, which is FS_NODATA,
so a mismatch (that also incurs a RPC call). Fixing it is easy, and
makes the output consistent.

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

diff --git a/src/Ganeti/Query/Node.hs b/src/Ganeti/Query/Node.hs
index e114a4699..293ceb7a5 100644
--- a/src/Ganeti/Query/Node.hs
+++ b/src/Ganeti/Query/Node.hs
@@ -198,9 +198,9 @@ nodeFields =
   -- non-implemented node resource model; they are declared just for
   -- parity, but are not functional
   , (FieldDefinition "hv_state" "HypervisorState" QFTOther "Hypervisor state",
-     missingRuntime, QffNormal)
+     FieldSimple (const rsUnavail), QffNormal)
   , (FieldDefinition "disk_state" "DiskState" QFTOther "Disk state",
-     missingRuntime, QffNormal)
+     FieldSimple (const rsUnavail), QffNormal)
   ] ++
   map nodeLiveFieldBuilder nodeLiveFieldsDefs ++
   map buildNdParamField allNDParamFields ++
-- 
GitLab