Complete and enable the haskell QueryClusterInfo call
authorIustin Pop <iustin@google.com>
Wed, 22 Aug 2012 16:53:34 +0000 (18:53 +0200)
committerIustin Pop <iustin@google.com>
Mon, 3 Sep 2012 12:13:26 +0000 (14:13 +0200)
Since we have now access to all cluster parameters, we can "fill" the
parameters, and can finally enable it in CLI/RAPI.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

htools/Ganeti/Queryd.hs
lib/client/gnt_cluster.py
lib/rapi/rlib2.py

index 1ac44fc..eeeef7a 100644 (file)
@@ -66,8 +66,6 @@ handleCall cdata QueryClusterInfo =
       hypervisors = clusterEnabledHypervisors cluster
       bits = show (bitSize (0::Int)) ++ "bits"
       arch_tuple = [bits, arch]
-      -- FIXME: this is for the missing *params fields
-      empty_params = showJSON $ J.makeObj ([]::[(String, JSValue)])
       obj = [ ("software_version", showJSON $ C.releaseVersion)
             , ("protocol_version", showJSON $ C.protocolVersion)
             , ("config_version", showJSON $ C.configVersion)
@@ -78,15 +76,14 @@ handleCall cdata QueryClusterInfo =
             , ("master", showJSON $ clusterMasterNode cluster)
             , ("default_hypervisor", showJSON $ head hypervisors)
             , ("enabled_hypervisors", showJSON $ hypervisors)
-            -- FIXME: *params missing
-            , ("hvparams", empty_params)
-            , ("os_hvp", empty_params)
+            , ("hvparams", showJSON $ clusterHvparams cluster)
+            , ("os_hvp", showJSON $ clusterOsHvp cluster)
             , ("beparams", showJSON $ clusterBeparams cluster)
             , ("osparams", showJSON $ clusterOsparams cluster)
             , ("ipolicy", showJSON $ clusterIpolicy cluster)
             , ("nicparams", showJSON $ clusterNicparams cluster)
             , ("ndparams", showJSON $ clusterNdparams cluster)
-            , ("diskparams", empty_params)
+            , ("diskparams", showJSON $ clusterDiskparams cluster)
             , ("candidate_pool_size",
                showJSON $ clusterCandidatePoolSize cluster)
             , ("master_netdev",  showJSON $ clusterMasterNetdev cluster)
index 680ced6..309f37e 100644 (file)
@@ -389,7 +389,7 @@ def ShowClusterConfig(opts, args):
   @return: the desired exit code
 
   """
-  cl = GetClient()
+  cl = GetClient(query=True)
   result = cl.QueryClusterInfo()
 
   ToStdout("Cluster name: %s", result["name"])
index 4259a6e..e77dca8 100644 (file)
@@ -214,7 +214,7 @@ class R_2_info(baserlib.OpcodeResource):
     """Returns cluster information.
 
     """
-    client = self.GetClient()
+    client = self.GetClient(query=True)
     return client.QueryClusterInfo()