-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RHELC-576, RHELC-596] Merge yum transactions into a single one #528
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
40e59b2
Merge yum transactions into a single transaction
r0x0d 80cb0c3
Add unit_test for the new yum transactions
r0x0d 6331901
Add cases to handle resolve_dependency test
r0x0d bf37be9
Move pkgmanager to be a python package instead of a one-file module
abadger aee677e
Refactor the way we handle the yum/dnf transaction.
r0x0d 19f8e90
Delete the yum base class after the transaction
r0x0d 89522fa
Backup packages in case of removal before PONR.
r0x0d 2556414
Add pkgmanager folder to MANIFEST.in
r0x0d c2127cb
Add integration tests
r0x0d 82dfd00
Raise SystemExit instead of boolean return.
r0x0d 8b32609
Workaround for yum i18n startup
r0x0d 82aea9f
Resolve conflicts from main
r0x0d 84edbb2
Fix unit_tests on RHEL6
r0x0d 7276a1b
Try to keep cache after transaction to prevent internet issues
r0x0d dd187e5
Move setup_locale to initialize instead of utils
r0x0d ca5df6f
Apply suggestions from code review
r0x0d ec44dc1
Change logger output to make it more clear for the user
r0x0d 908d0c5
Fix code to call repo.disable()
abadger dd9ee50
Catch both ReinstallInstallError and ReinstallRemoveError when runnin…
abadger 0b9e2fb
Change the way we create the transaction_handler object
r0x0d e1555bf
Fix integration tests assertations
r0x0d 48d2f0f
Remove epoch from yum NEVRA before removing pkg
bocekm b947b39
Fix unit and integration tests
bocekm d43dae2
Test: Remove oldest kernel to prevent conflict
bocekm 5da50e5
Fix sub-man installation when json-c.i686 installed
bocekm d13612b
Remove shim-x64 on Oracle Linux 7
bocekm 134d450
Fix leftovers from 5abeb3611b3e4d82138318ea0be00d8ed691541f
r0x0d 8c38207
Apply suggestions from code review
r0x0d 8ae0f37
Fix unit_tests
r0x0d fddf849
Modify the function to get packages list
r0x0d File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright(C) 2022 Red Hat, Inc. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
|
||
|
||
def set_locale(): | ||
"""Set the C locale, also known as the POSIX locale, for the main process as well as the child processes. | ||
|
||
The reason is to get predictable output from the executables we call, not | ||
influenced by non-default locale. We need to be setting not only LC_ALL but | ||
LANG as well because subscription-manager considers LANG to have priority | ||
over LC_ALL even though it goes against POSIX which specifies that LC_ALL | ||
overrides LANG. | ||
|
||
.. note:: | ||
Since we introduced a new way to interact with packages that is not | ||
through the `yum` cli calls, but with the Python API, we had to move | ||
this function to a new module to initialize all the settings in | ||
Convert2RHEL before-hand as this was causing problems related to the | ||
locales. The main problem that this function solves by being here is by | ||
overriding any user set locale in their machine, to actually being the | ||
ones we require during the process execution. | ||
""" | ||
os.environ.update({"LC_ALL": "C", "LANG": "C"}) | ||
|
||
|
||
def run(): | ||
"""Wrapper around the main function. | ||
|
||
This function is intended to initialize all early code and function calls | ||
before any other main imports. | ||
""" | ||
# prepare environment | ||
set_locale() | ||
|
||
from convert2rhel import main | ||
|
||
sys.exit(main.main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's interesting that git thinks that
pkgmanager.py
was renamed toinitialize.py
when in reality it would be better git history ifpkgmanager.py
was seen as renamed topkgmanager/__init__.py
. Maybe not worthhile to spend a lot of time trying to fix it but maybe if you think it's a quick change to git history to correct it, it may help when someone is looking through git history.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abadger I tried a lot to fix this, but, no luck :(
Maybe we could tackle this together in an 1:1 session of ours? I would really like to fix that reference, but I'm worried that I will not be able to do this alone.