Blob Blame Raw
From f2f79372f1418ef433faa1251b7e17a4bcac9b16 Mon Sep 17 00:00:00 2001
From: Pavla Kratochvilova <pkratoch@redhat.com>
Date: Tue, 30 Oct 2018 07:53:22 +0100
Subject: [PATCH 2/2] [system-upgrade] Save exclude option as list to store in
 json (RhBug:1643551)

https://bugzilla.redhat.com/show_bug.cgi?id=1643551
'exclude' option from base.conf is of type VectorString, which is not JSON
serializable. Hence, saving the option as a list.

Closes: #138
Approved by: m-blaha
---
 plugins/system_upgrade.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
index d9057ea..b4090ca 100644
--- a/plugins/system_upgrade.py
+++ b/plugins/system_upgrade.py
@@ -34,6 +34,7 @@ from dnfpluginsextras import _, logger
 import dnf
 import dnf.cli
 import dnf.transaction
+import libdnf.conf
 
 
 # Translators: This string is only used in unit tests.
@@ -391,7 +392,7 @@ class SystemUpgradeCommand(dnf.cli.Command):
         self.cli.demands.allow_erasing = self.state.allow_erasing
         self.base.conf.gpgcheck = self.state.gpgcheck
         self.base.conf.best = self.state.best
-        self.base.conf.exclude = self.state.exclude
+        self.base.conf.exclude = libdnf.conf.VectorString(self.state.exclude)
         self.base.conf.install_weak_deps = self.state.install_weak_deps
         # don't try to get new metadata, 'cuz we're offline
         self.cli.demands.cacheonly = True
@@ -463,7 +464,7 @@ class SystemUpgradeCommand(dnf.cli.Command):
         with self.state as state:
             state.download_status = 'downloading'
             state.target_releasever = self.base.conf.releasever
-            state.exclude = self.base.conf.exclude
+            state.exclude = list(self.base.conf.exclude)
             state.destdir = self.base.conf.destdir
 
     def run_upgrade(self):
-- 
2.19.1