Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: allinone: DC version
......................................................................

packaging: setup: allinone: DC version

Before this change, the allinone plugin created a DC with version
being the version of the ovirt-engine package. Currently this fails,
because the engine's version was bumped to 3.4, while the maximum
supported version is 3.3. In principal, we can now add a supported
version '3.4', but there is no reason to do so as long as we do not
have to for compatibility reasons.

This change creates the DC with version being the minimum of the
package version and the maximum supported version.

Change-Id: I01054b74f26fc961633d8f0a55429569dcc8cc31
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
1 file changed, 19 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/72/18172/1

diff --git a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py 
b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
index 4eb6fa8..d46689a 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/vdsm.py
@@ -52,9 +52,6 @@
     def __init__(self, context):
         super(Plugin, self).__init__(context=context)
         self._enabled = False
-        self._version = distutils.version.LooseVersion(
-            osetupconfig.PACKAGE_VERSION
-        ).version
 
     def _waitVDSMHostUp(self, engine_api, host):
         self.logger.info(_(
@@ -194,9 +191,26 @@
             password=self.environment[osetupcons.ConfigEnv.ADMIN_PASSWORD],
             ca_file=osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT,
         )
+
+        SupportedClusterLevels = self.environment[
+            osetupcons.DBEnv.STATEMENT
+        ].getVdcOption(name='SupportedClusterLevels')
+        self.logger.debug(
+            'SupportedClusterLevels [{levels}], '
+            'PACKAGE_VERSION [{pv}],'.format(
+                levels=SupportedClusterLevels,
+                pv=osetupconfig.PACKAGE_VERSION,
+            )
+        )
+        v = distutils.version.LooseVersion(
+            min(
+                osetupconfig.PACKAGE_VERSION,
+                max(SupportedClusterLevels.split(','))
+            )
+        ).version
         engine_version = self._ovirtsdk_xml.params.Version(
-            major=self._version[0],
-            minor=self._version[1],
+            major=v[0],
+            minor=v[1],
         )
 
         self.logger.debug('Creating the local data center')


-- 
To view, visit http://gerrit.ovirt.org/18172
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01054b74f26fc961633d8f0a55429569dcc8cc31
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to