Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: fix yum rollbackability check
......................................................................

packaging: setup: fix yum rollbackability check

The check to see if currently-installed packages will be able to be
reinstalled if we need to rollback wasn't always working.

Needs http://gerrit.ovirt.org/18310 (in otopi) to actually be able
to know if these packages are available for reinstallation.

Change-Id: I6449cf29771a6f9f6d165d6bc4dce2814fbc9a29
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-setup/distro-rpm/packages.py
1 file changed, 16 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/11/18311/1

diff --git a/packaging/setup/plugins/ovirt-engine-setup/distro-rpm/packages.py 
b/packaging/setup/plugins/ovirt-engine-setup/distro-rpm/packages.py
index 71089e2..3440139 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/distro-rpm/packages.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/distro-rpm/packages.py
@@ -226,25 +226,25 @@
 
                 # Verify all installed packages available in yum
                 for package in myum.queryTransaction():
+                    installed = False
+                    reinstall_available = False
                     for query in myum.queryPackages(
-                        patterns=(package['name'],)
+                        patterns=(package['name'],),
+                        showdups=True,
                     ):
-                        if query['operation'] == 'installed':
-                            self.logger.debug(
-                                'Checking package %s',
+                        self.logger.debug(
+                            'dupes: operation [%s] package %s' % (
+                                query['operation'],
                                 query['display_name'],
                             )
-                            if not myum.queryPackages(
-                                patterns=(query['display_name'],),
-                                showdups=True,
-                            ):
-                                self.logger.debug(
-                                    'package %s not available in cache' % (
-                                        query['display_name']
-                                    )
-                                )
-                                haveRollback = False
-
+                        )
+                        if query['operation'] == 'installed':
+                            installed = True
+                        if query['operation'] == 'reinstall_available':
+                            reinstall_available = True
+                    if installed and not reinstall_available:
+                        haveRollback = False
+                        break
         return (upgradeAvailable, haveRollback)
 
     def __init__(self, context):
@@ -378,7 +378,7 @@
                             default=False,
                         )
 
-                    if self.environment[
+                    if not self.environment[
                         osetupcons.RPMDistroEnv.REQUIRE_ROLLBACK
                     ]:
                         raise RuntimeError(


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6449cf29771a6f9f6d165d6bc4dce2814fbc9a29
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