def _get_available(): """Try to get list of available packages""" # FIXME: It is not safe to use two base objects in transaction hook. # Try to remove it, when dnf support getting list of available # packages during "dnf remove". with dnf.base.Base() as base: base.read_all_repos() base.fill_sack(load_system_repo=True, load_available_repos=True) available = base.sack.query().available() return available