Revision ae5849b5 lib/cmdlib.py

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))

Also available in: Unified diff