Revision ae5849b5

b/daemons/ganeti-masterd
240 240
      op = opcodes.OpQueryExports(nodes=nodes)
241 241
      return self._Query(op)
242 242

  
243
    elif method == luxi.REQ_QUERY_CONFIG_VALUES:
244
      fields = args
245
      op = opcodes.OpQueryConfigValues(output_fields=fields)
246
      return self._Query(op)
247

  
243 248
    else:
244 249
      raise ValueError("Invalid operation")
245 250

  
b/lib/cmdlib.py
1859 1859
    return result
1860 1860

  
1861 1861

  
1862
class LUDumpClusterConfig(NoHooksLU):
1863
  """Return a text-representation of the cluster-config.
1862
class LUQueryConfigValues(NoHooksLU):
1863
  """Return configuration values.
1864 1864

  
1865 1865
  """
1866 1866
  _OP_REQP = []
......
1869 1869
  def ExpandNames(self):
1870 1870
    self.needed_locks = {}
1871 1871

  
1872
    static_fields = ["cluster_name", "master_node"]
1873
    _CheckOutputFields(static=static_fields,
1874
                       dynamic=[],
1875
                       selected=self.op.output_fields)
1876

  
1872 1877
  def CheckPrereq(self):
1873 1878
    """No prerequisites.
1874 1879

  
......
1879 1884
    """Dump a representation of the cluster config to the standard output.
1880 1885

  
1881 1886
    """
1882
    return self.cfg.DumpConfig()
1887
    values = []
1888
    for field in self.op.output_fields:
1889
      if field == "cluster_name":
1890
        values.append(self.cfg.GetClusterName())
1891
      elif field == "master_node":
1892
        values.append(self.cfg.GetMasterNode())
1893
      else:
1894
        raise errors.ParameterError(field)
1895
    return values
1883 1896

  
1884 1897

  
1885 1898
class LUActivateInstanceDisks(NoHooksLU):
......
4271 4284
  """
4272 4285
  _OP_REQP = ["instances"]
4273 4286
  REQ_BGL = False
4287

  
4274 4288
  def ExpandNames(self):
4275 4289
    self.needed_locks = {}
4276 4290
    self.share_locks = dict(((i, 1) for i in locking.LEVELS))
b/lib/config.py
814 814
                    for node in self._UnlockedGetNodeList()])
815 815
    return my_dict
816 816

  
817
  @locking.ssynchronized(_config_lock, shared=1)
818
  def DumpConfig(self):
819
    """Return the entire configuration of the cluster.
820
    """
821
    self._OpenConfig()
822
    return self._config_data
823

  
824 817
  def _BumpSerialNo(self):
825 818
    """Bump up the serial number of the config.
826 819

  
b/lib/luxi.py
51 51
REQ_QUERY_INSTANCES = "QueryInstances"
52 52
REQ_QUERY_NODES = "QueryNodes"
53 53
REQ_QUERY_EXPORTS = "QueryExports"
54
REQ_QUERY_CONFIG_VALUES = "QueryConfigValues"
54 55

  
55 56
DEF_CTMO = 10
56 57
DEF_RWTO = 60
......
311 312
  def QueryExports(self, nodes):
312 313
    return self.CallMethod(REQ_QUERY_EXPORTS, nodes)
313 314

  
315
  def QueryConfigValues(self, fields):
316
    return self.CallMethod(REQ_QUERY_CONFIG_VALUES, fields)
317

  
314 318
# TODO: class Server(object)
b/lib/mcpu.py
46 46
    opcodes.OpDestroyCluster: cmdlib.LUDestroyCluster,
47 47
    opcodes.OpQueryClusterInfo: cmdlib.LUQueryClusterInfo,
48 48
    opcodes.OpVerifyCluster: cmdlib.LUVerifyCluster,
49
    opcodes.OpDumpClusterConfig: cmdlib.LUDumpClusterConfig,
49
    opcodes.OpQueryConfigValues: cmdlib.LUQueryConfigValues,
50 50
    opcodes.OpRenameCluster: cmdlib.LURenameCluster,
51 51
    opcodes.OpVerifyDisks: cmdlib.LUVerifyDisks,
52 52
    opcodes.OpSetClusterParams: cmdlib.LUSetClusterParams,
b/lib/opcodes.py
227 227
  __slots__ = []
228 228

  
229 229

  
230
class OpDumpClusterConfig(OpCode):
231
  """Dump the cluster configuration."""
232
  OP_ID = "OP_CLUSTER_DUMPCONFIG"
233
  __slots__ = []
230
class OpQueryConfigValues(OpCode):
231
  """Query cluster configuration values."""
232
  OP_ID = "OP_CLUSTER_CONFIG_QUERY"
233
  __slots__ = ["output_fields"]
234 234

  
235 235

  
236 236
class OpRenameCluster(OpCode):

Also available in: Unified diff