The configuration version is now again in the configuration file.
---
lib/config.py | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/lib/config.py b/lib/config.py
index 00e307a..57c56d8 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -43,19 +43,16 @@ from ganeti import constants
from ganeti import rpc
from ganeti import objects
from ganeti import serializer
-from ganeti import ssconf
_config_lock = locking.SharedLock()
-def ValidateConfig():
- sstore = ssconf.SimpleStore()
-
- if sstore.GetConfigVersion() != constants.CONFIG_VERSION:
+def _ValidateConfig(data):
+ if data.version != constants.CONFIG_VERSION:
raise errors.ConfigurationError("Cluster configuration version"
" mismatch, got %s instead of %s" %
- (sstore.GetConfigVersion(),
+ (data.version,
constants.CONFIG_VERSION))
@@ -840,9 +837,6 @@ class ConfigWriter:
# data is current, so skip loading of config file
return
- # Make sure the configuration has the right version
- ValidateConfig()
-
f = open(self._cfg_file, 'r')
try:
try:
@@ -851,6 +845,10 @@ class ConfigWriter:
raise errors.ConfigurationError(err)
finally:
f.close()
+
+ # Make sure the configuration has the right version
+ _ValidateConfig(data)
+
if (not hasattr(data, 'cluster') or
not hasattr(data.cluster, 'rsahostkeypub')):
raise errors.ConfigurationError("Incomplete configuration"
--
1.6.0.2