summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-18 14:48:52 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-19 11:22:16 -0700
commit6e97d822edaafc14dc5c155caf5a18906692989d (patch)
tree3da672c7d238092afb8061f006200e790c260ec0
parent37f0c23e93a346428919da44b85d22e11c3d8fb1 (diff)
downloadchef-6e97d822edaafc14dc5c155caf5a18906692989d.tar.gz
dnf_package fixes for RHEL8
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider/package/dnf/dnf_helper.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/provider/package/dnf/dnf_helper.py b/lib/chef/provider/package/dnf/dnf_helper.py
index 501d6fceee..0859348212 100644
--- a/lib/chef/provider/package/dnf/dnf_helper.py
+++ b/lib/chef/provider/package/dnf/dnf_helper.py
@@ -14,8 +14,22 @@ def get_sack():
global base
if base is None:
base = dnf.Base()
+ conf = base.conf
+ conf.read()
+ conf.installroot = '/'
+ subst = conf.substitutions
+ subst.update_from_etc(conf.installroot)
+ try:
+ base.init_plugins()
+ base.pre_configure_plugins()
+ except AttributeError:
+ pass
base.read_all_repos()
- base.fill_sack()
+ try:
+ base.configure_plugins()
+ except AttributeError:
+ pass
+ base.fill_sack(load_system_repo='auto')
return base.sack
# FIXME: leaks memory and does not work