Blob Blame History Raw
From 53f4e99c05382a003fbd42753f55707e6d16f974 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Fri, 18 Oct 2019 10:54:09 +0200
Subject: [PATCH] Reset all module when system-upgrade to f31, 32
 (RhBug:1767351)

This is a downstream hack that resolves distribution issue with missing
upgrade path between dist versions.

The module reset is not applied to offline-distrosing and
offline-upgrade commands. It will allow to users to disable automatic
reset of modules with the same functionality.

https://bugzilla.redhat.com/show_bug.cgi?id=1767351
---
 plugins/system_upgrade.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
index 0a0a0d7..402daa3 100644
--- a/plugins/system_upgrade.py
+++ b/plugins/system_upgrade.py
@@ -535,6 +535,16 @@ def run_reboot(self):
         reboot()
 
     def run_download(self):
+        #  downstream hack to narrow missing upgrade path with modules between dist versions
+        if self.opts.command not in ['offline-upgrade', 'offline-distrosync']:
+            if dnf.base.WITH_MODULES:
+                module_base = dnf.module.module_base.ModuleBase(self.base)
+                try:
+                    module_base.reset(["*"])
+                except dnf.exceptions.MarkingErrors:
+                    # When no module is available, just pass
+                    pass
+
         # Mark everything in the world for upgrade/sync
         if self.opts.distro_sync:
             self.base.distro_sync()