From 6a0466bbc435f53fefaea7350213cfd14706a12c Mon Sep 17 00:00:00 2001 From: Michal Mig Novotny Date: Mon, 30 Sep 2024 14:46:38 +0200 Subject: [PATCH] Add pre_transaction_test() hook --- dnf/base.py | 2 ++ dnf/plugin.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/dnf/base.py b/dnf/base.py index c1affc8cba..be0aba9a5e 100644 --- a/dnf/base.py +++ b/dnf/base.py @@ -991,6 +991,8 @@ def do_transaction(self, display=()): logger.info(_('Transaction check succeeded.')) + self._plugins.run_pre_transaction_test() + timer = dnf.logging.Timer('transaction test') logger.info(_('Running transaction test')) diff --git a/dnf/plugin.py b/dnf/plugin.py index 6ab71c2b30..3de5e8d0ab 100644 --- a/dnf/plugin.py +++ b/dnf/plugin.py @@ -89,6 +89,10 @@ def pre_transaction(self): # :api pass + def pre_transaction_test(self): + # :api + pass + def transaction(self): # :api pass @@ -161,6 +165,9 @@ def run_sack(self): def run_resolved(self): self._caller('resolved') + def run_pre_transaction_test(self): + self._caller('pre_transaction_test') + def run_pre_transaction(self): self._caller('pre_transaction')