Created
January 4, 2024 14:12
-
-
Save r0x0d/a4263c2c79aba16e3332681f77b47875 to your computer and use it in GitHub Desktop.
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
import yum | |
from convert2rhel.pkgmanager.handlers.yum.callback import PackageDownloadCallback, TransactionDisplayCallback | |
base = yum.YumBase() | |
base.conf.yumvar["releasever"] = "7Server" | |
base.repos.disableRepo("*") | |
base.repos.enableRepo("rhel-7-server-rpms") | |
base.repos.setProgressBar(PackageDownloadCallback()) | |
can_update = base.update(pattern="httpd") | |
print(can_update) | |
# In test mode to not override the system | |
base.conf.tsflags.append("test") | |
# Process transaction and see what happens | |
base.processTransaction(rpmDisplay=TransactionDisplayCallback()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment