Hello Yedidyah Bar David,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18327
to review the following change.
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.
Bug-URL: https://bugzilla.redhat.com/998921
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, 20 insertions(+), 19 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/18327/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 7944cde..1704d0d2 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):
@@ -368,15 +368,16 @@
name='OVESETUP_RPMDISTRO_REQUIRE_ROLLBACK',
note=_(
'Setup will not be able to rollback new '
- 'packages in case of a failure because '
- 'installed ones are not available in enabled
repositories. '
- 'Do you want to continue anyway? '
+ 'packages in case of a failure, because '
+ 'installed ones were not found in enabled '
+ 'repositories.\n'
+ 'Do you want to abort Setup? '
'(@VALUES@) [@DEFAULT@]: '
),
prompt=True,
true=_('Yes'),
false=_('No'),
- default=False,
+ default=True,
)
if self.environment[
--
To view, visit http://gerrit.ovirt.org/18327
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6449cf29771a6f9f6d165d6bc4dce2814fbc9a29
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches