Make Rapi backed set node tags correctly
authorKlaus Aehlig <aehlig@google.com>
Thu, 2 May 2013 12:31:04 +0000 (14:31 +0200)
committerKlaus Aehlig <aehlig@google.com>
Tue, 7 May 2013 15:59:16 +0000 (17:59 +0200)
Since the htools representation of a node now allows adding
the node tags, populate this field correctly in the Rapi
backend.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

src/Ganeti/HTools/Backend/Rapi.hs

index ffc6dc2..ab495f1 100644 (file)
@@ -166,8 +166,10 @@ parseNode ktg a = do
               dtotal  <- extract "dtotal"
               dfree   <- extract "dfree"
               ctotal  <- extract "ctotal"
-              return $ Node.create name mtotal mnode mfree
-                     dtotal dfree ctotal False spindles guuid'
+              tags    <- extract "tags"
+              return . flip Node.setNodeTags tags $
+                Node.create name mtotal mnode mfree dtotal dfree ctotal False
+                            spindles guuid'
   return (name, node)
 
 -- | Construct a group from a JSON object.