Sandro Bonazzola has uploaded a new change for review.

Change subject: packaging: setup: removed version checks on upgrade
......................................................................

packaging: setup: removed version checks on upgrade

Removed code for checking the cluster and datacenter
compatibility level during upgrade.
Upgrade will be supported only from 3.2 and 3.2 already
checked on compatibility level > 2.2.
So there's no way we'll have a cluster or a datacenter
with compatibility level = 2.2 managed by the system
we're upgrading.

Change-Id: I277fa2c46f53fd3d04455aa87ce5db2852c08632
Signed-off-by: Sandro Bonazzola <sbona...@redhat.com>
---
M packaging/fedora/setup/engine-upgrade.py
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-common/core/misc.py
M packaging/setup/plugins/ovirt-engine-setup/db/schema.py
4 files changed, 0 insertions(+), 89 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/15861/1

diff --git a/packaging/fedora/setup/engine-upgrade.py 
b/packaging/fedora/setup/engine-upgrade.py
index 95075c1..ae9145a 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -47,9 +47,6 @@
 
 ETL_SERVICE="/etc/init.d/ovirt-engine-etl"
 
-# Versions
-UNSUPPORTED_VERSION = "2.2"
-
 #MSGS
 MSG_ERROR_CLEAR_ZOMBIES = "Error: Couldn't clear zombie tasks"
 MSG_CLEAR_DB_INCONSISTENCIES = "\nINFO: DB validation tools provided the \
@@ -69,9 +66,6 @@
 MSG_RC_ERROR = "Return Code is not zero"
 MSG_INFO_NO_UPGRADE_AVAIL = "No updates available"
 MSG_INFO_UPGRADE_AVAIL = "%d Updates available:"
-MSG_ERROR_INCOMPATIBLE_UPGRADE = "\nError: a data center or cluster version %s 
were found on the system.\n\
-Such upgrade flow is not supported. Upgrade all %s data centers and clusters 
and rerun the upgrade utility.\n" \
-% (UNSUPPORTED_VERSION, UNSUPPORTED_VERSION)
 MSG_ERROR_NO_ROLLBACK_AVAIL = "Error: Installed packages are missing from the 
yum repositories\n\
 Please check your yum repositories or use --no-yum-rollback"
 MSG_ERROR_NEW_SETUP_AVAIL="\nError: New %s rpm available via yum.\n\
@@ -728,39 +722,6 @@
                 messages.append(MSG_ERR_FAILED_START_SERVICE % s.name)
             break
 
-def unsupportedVersionsPresent(oldversion=UNSUPPORTED_VERSION, 
dbName=basedefs.DB_NAME):
-    """ Check whether there are UNSUPPORTED_VERSION
-    objects present. If yes, throw an Exception
-
-    dbName is provided for flexibility of quering different possible DBs.
-    """
-    queryCheckDCVersions="SELECT compatibility_version FROM storage_pool;"
-    dcVersions, rc = utils.execRemoteSqlCommand(
-        userName=SERVER_ADMIN,
-        dbHost=SERVER_NAME,
-        dbPort=SERVER_PORT,
-        dbName=dbName,
-        sqlQuery=queryCheckDCVersions,
-        failOnError=True,
-        errMsg=MSG_ERROR_CONNECT_DB,
-    )
-    queryCheckClusterVersions="SELECT compatibility_version FROM vds_groups;"
-    clusterVersions, rc = utils.execRemoteSqlCommand(
-        userName=SERVER_ADMIN,
-        dbHost=SERVER_NAME,
-        dbPort=SERVER_PORT,
-        dbName=dbName,
-        sqlQuery=queryCheckClusterVersions,
-        failOnError=True,
-        errMsg=MSG_ERROR_CONNECT_DB,
-    )
-
-    for versions in dcVersions, clusterVersions:
-        if oldversion in versions:
-            return True
-
-    return False
-
 def preupgradeUUIDCheck():
     VDSStatus_Maintenance = 2
 
@@ -1312,11 +1273,6 @@
                                   dbFolder=basedefs.DIR_DB_BACKUPS,
                                   msg=output_messages.MSG_STOP_UPGRADE_SPACE,
                                   )
-
-    # Check minimal supported versions of installed components
-    if unsupportedVersionsPresent(dbName=currentDbName):
-        print MSG_ERROR_INCOMPATIBLE_UPGRADE
-        raise Exception(MSG_ERROR_INCOMPATIBLE_UPGRADE)
 
     rhyum.clean()
     try:
diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 1009c0e..18214d1 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -529,7 +529,6 @@
     UNINSTALL_ENABLED_FILE_GROUPS = 'OVESETUP_CORE/uninstallEnabledFileGroups'
     REGISTER_UNINSTALL_GROUPS = 'OVESETUP_CORE/registerUninstallGroups'
     CONFIRM_UNINSTALL_GROUPS = 'OVESETUP_CORE/confirmUninstallGroups'
-    UPGRADE_SUPPORTED_VERSIONS = 'OVESETUP_CORE/upgradeSupportedVersions'
 
     @osetupattrs(
         answerfile=True,
diff --git a/packaging/setup/plugins/ovirt-engine-common/core/misc.py 
b/packaging/setup/plugins/ovirt-engine-common/core/misc.py
index 83476d2..4c59b26 100644
--- a/packaging/setup/plugins/ovirt-engine-common/core/misc.py
+++ b/packaging/setup/plugins/ovirt-engine-common/core/misc.py
@@ -68,10 +68,6 @@
             osetupcons.CoreEnv.DEVELOPER_MODE,
             None
         )
-        self.environment.setdefault(
-            osetupcons.CoreEnv.UPGRADE_SUPPORTED_VERSIONS,
-            '3.2,3.3'
-        )
 
         if self.environment[osetupcons.CoreEnv.DEVELOPER_MODE] is None:
             self.environment[osetupcons.CoreEnv.DEVELOPER_MODE] = False
diff --git a/packaging/setup/plugins/ovirt-engine-setup/db/schema.py 
b/packaging/setup/plugins/ovirt-engine-setup/db/schema.py
index 7062ab6..d7c4206 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/db/schema.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/db/schema.py
@@ -40,45 +40,6 @@
     def __init__(self, context):
         super(Plugin, self).__init__(context=context)
 
-    def _checkSupportedVersionsPresent(self):
-        # TODO: figure out a better way to do this for the future
-        statement = database.Statement(environment=self.environment)
-        dcVersions = statement.execute(
-            statement="""
-                SELECT compatibility_version FROM storage_pool;
-            """,
-            ownConnection=True,
-            transaction=False,
-        )
-        clusterVersions = statement.execute(
-            statement="""
-                SELECT compatibility_version FROM vds_groups;;
-            """,
-            ownConnection=True,
-            transaction=False,
-        )
-
-        versions = set([
-            x['compatibility_version']
-            for x in dcVersions + clusterVersions
-        ])
-        supported = set([
-            x.strip()
-            for x in self.environment[
-                osetupcons.CoreEnv.UPGRADE_SUPPORTED_VERSIONS
-            ].split(',')
-            if x.strip()
-        ])
-
-        if versions - supported:
-            raise RuntimeError(
-                _(
-                    'Trying to upgrade from unsupported versions: {versions}'
-                ).format(
-                    versions=' '.join(versions - supported)
-                )
-            )
-
     @plugin.event(
         stage=plugin.Stages.STAGE_MISC,
         name=osetupcons.Stages.DB_SCHEMA,
@@ -147,7 +108,6 @@
         ],
     )
     def _miscUpgrade(self):
-        self._checkSupportedVersionsPresent()
         dbovirtutils = database.OvirtUtils(plugin=self)
         backupFile = dbovirtutils.backup()
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I277fa2c46f53fd3d04455aa87ce5db2852c08632
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <sbona...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to