Revision 72747d91 src/Ganeti/Query/Server.hs
b/src/Ganeti/Query/Server.hs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
{- |
8 | 8 |
|
9 |
Copyright (C) 2012 Google Inc. |
|
9 |
Copyright (C) 2012, 2013 Google Inc.
|
|
10 | 10 |
|
11 | 11 |
This program is free software; you can redistribute it and/or modify |
12 | 12 |
it under the terms of the GNU General Public License as published by |
... | ... | |
87 | 87 |
handleCall cdata QueryClusterInfo = |
88 | 88 |
let cluster = configCluster cdata |
89 | 89 |
hypervisors = clusterEnabledHypervisors cluster |
90 |
def_hv = case hypervisors of |
|
91 |
x:_ -> showJSON x |
|
92 |
[] -> JSNull |
|
90 | 93 |
bits = show (bitSize (0::Int)) ++ "bits" |
91 | 94 |
arch_tuple = [bits, arch] |
92 | 95 |
obj = [ ("software_version", showJSON C.releaseVersion) |
... | ... | |
97 | 100 |
, ("architecture", showJSON arch_tuple) |
98 | 101 |
, ("name", showJSON $ clusterClusterName cluster) |
99 | 102 |
, ("master", showJSON $ clusterMasterNode cluster) |
100 |
, ("default_hypervisor", showJSON $ head hypervisors)
|
|
103 |
, ("default_hypervisor", def_hv)
|
|
101 | 104 |
, ("enabled_hypervisors", showJSON hypervisors) |
102 | 105 |
, ("hvparams", showJSON $ clusterHvparams cluster) |
103 | 106 |
, ("os_hvp", showJSON $ clusterOsHvp cluster) |
Also available in: Unified diff