From cb2448f1abd56cbc15ab83561930e2ef384d82e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret?= Date: Sun, 24 Sep 2017 12:20:12 +0200 Subject: [PATCH] dnf-qubes-hooks: handle newer DNF >= 2.x --- misc/dnf-qubes-hooks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/dnf-qubes-hooks.py b/misc/dnf-qubes-hooks.py index 3b8054d..e9e8664 100644 --- a/misc/dnf-qubes-hooks.py +++ b/misc/dnf-qubes-hooks.py @@ -20,8 +20,10 @@ # from __future__ import absolute_import +from distutils.version import LooseVersion import logging import dnf +import dnf.const import subprocess PLUGIN_CONF = 'qubes-hooks' @@ -35,7 +37,10 @@ class QubesHooks(dnf.Plugin): self.log = logging.getLogger('dnf') def transaction(self): - config = self.read_config(self.base.conf, PLUGIN_CONF) + if LooseVersion(dnf.const.VERSION) < '2.0.0': + config = self.read_config(self.base.conf, PLUGIN_CONF) + else: + config = self.read_config(self.base.conf) if config.getboolean('main', 'notify-updates'): # Get all updates available _before_ this transaction