Revision 02f99608 lib/ssconf.py

b/lib/ssconf.py
35 35
from ganeti import serializer
36 36

  
37 37

  
38
class SimpleConfigReader:
38
class SimpleConfigReader(object):
39 39
  """Simple class to read configuration file.
40 40

  
41 41
  """
......
74 74
  def GetNodeList(self):
75 75
    return self._config_data["nodes"].keys()
76 76

  
77
  @classmethod
78
  def FromDict(cls, val, cfg_file=constants.CLUSTER_CONF_FILE):
79
    """Alternative construction from a dictionary.
80

  
81
    """
82
    obj = SimpleConfigReader.__new__(cls)
83
    obj._config_data = val
84
    obj._file_name = cfg_file
85
    return obj
86

  
77 87

  
78 88
class SimpleConfigWriter(SimpleConfigReader):
79 89
  """Simple class to write configuration file.

Also available in: Unified diff