Revision 319856a9 lib/config.py
b/lib/config.py | ||
---|---|---|
21 | 21 |
|
22 | 22 |
"""Configuration management for Ganeti |
23 | 23 |
|
24 |
This module provides the interface to the ganeti cluster configuration.
|
|
24 |
This module provides the interface to the Ganeti cluster configuration.
|
|
25 | 25 |
|
26 |
The configuration data is stored on every node but is updated on the master |
|
27 |
only. After each update, the master distributes the data to the other nodes. |
|
26 | 28 |
|
27 |
The configuration data is stored on every node but is updated on the |
|
28 |
master only. After each update, the master distributes the data to the |
|
29 |
other nodes. |
|
30 |
|
|
31 |
Currently the data storage format is pickle as yaml was initially not |
|
32 |
available, then we used it but it was a memory-eating slow beast, so |
|
33 |
we reverted to pickle using custom Unpicklers. |
|
29 |
Currently, the data storage format is JSON. YAML was slow and consuming too |
|
30 |
much memory. |
|
34 | 31 |
|
35 | 32 |
""" |
36 | 33 |
|
... | ... | |
45 | 42 |
from ganeti import rpc |
46 | 43 |
from ganeti import objects |
47 | 44 |
|
45 |
|
|
48 | 46 |
def _my_uuidgen(): |
49 | 47 |
"""Poor-man's uuidgen using the uuidgen binary. |
50 | 48 |
|
... | ... | |
497 | 495 |
f = open(self._cfg_file, 'r') |
498 | 496 |
try: |
499 | 497 |
try: |
500 |
data = objects.ConfigObject.Load(f)
|
|
498 |
data = objects.ConfigData.Load(f)
|
|
501 | 499 |
except Exception, err: |
500 |
raise |
|
502 | 501 |
raise errors.ConfigurationError(err) |
503 | 502 |
finally: |
504 | 503 |
f.close() |
Also available in: Unified diff