The configuration version is now again in the configuration file.
---
 lib/config.py |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/lib/config.py b/lib/config.py
index 768c128..7e02623 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -44,22 +44,11 @@ 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:
-    raise errors.ConfigurationError("Cluster configuration version"
-                                    " mismatch, got %s instead of %s" %
-                                    (sstore.GetConfigVersion(),
-                                     constants.CONFIG_VERSION))
-
-
 class ConfigWriter:
   """The interface to the cluster configuration.
 
@@ -756,9 +745,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:
@@ -767,6 +753,14 @@ class ConfigWriter:
         raise errors.ConfigurationError(err)
     finally:
       f.close()
+
+    # Make sure the configuration has the right version
+    if data.version != constants.CONFIG_VERSION:
+      raise errors.ConfigurationError("Cluster configuration version"
+                                      " mismatch, got %s instead of %s" %
+                                      (data.version,
+                                       constants.CONFIG_VERSION))
+
     if (not hasattr(data, 'cluster') or
         not hasattr(data.cluster, 'rsahostkeypub')):
       raise errors.ConfigurationError("Incomplete configuration"
-- 
1.6.0.2

Reply via email to