def _get_installed_pkg_objects_yum(name): yum_base = pkgmanager.YumBase() # Disable plugins (when kept enabled yum outputs useless text every call) yum_base.doConfigSetup(init_plugins=False) if name: return yum_base.rpmdb.returnPackages(patterns=[name]) return yum_base.rpmdb.returnPackages()
def _get_packages_to_update_yum(): """Query all the packages with yum that has an update pending on the system.""" base = pkgmanager.YumBase() packages = base.doPackageLists(pkgnarrow="updates") all_packages = [] for package in packages.updates: all_packages.append(package.name) return all_packages