chantra / rpms / dnf

Forked from rpms/dnf 2 years ago
Clone

Blame SOURCES/0009-Prevent-printing-empty-Error-Summary-RhBug-1690414.patch

1f580a
From 60a8f5e3f0500720077b200ce3be46772db4f093 Mon Sep 17 00:00:00 2001
1f580a
From: Aleš Matěj <amatej@redhat.com>
1f580a
Date: Mon, 24 Jun 2019 16:13:28 +0200
1f580a
Subject: [PATCH] Prevent printing empty Error Summary (RhBug: 1690414)
1f580a
1f580a
When test transaction fails we generate Error Summary but it contains
1f580a
information only if the error happened because of lacking disk space
1f580a
otherwise we get the headline "Error Summary" without any text this
1f580a
commit prevents this.
1f580a
---
1f580a
 dnf/base.py | 11 +++++++++--
1f580a
 1 file changed, 9 insertions(+), 2 deletions(-)
1f580a
1f580a
diff --git a/dnf/base.py b/dnf/base.py
1f580a
index 2c5d17e..0f8b77e 100644
1f580a
--- a/dnf/base.py
1f580a
+++ b/dnf/base.py
1f580a
@@ -858,8 +858,12 @@ class Base(object):
1f580a
                 for descr in tserrors:
1f580a
                     errstring += '  %s\n' % ucd(descr)
1f580a
 
1f580a
-                raise dnf.exceptions.Error(errstring + '\n' +
1f580a
-                                        self._trans_error_summary(errstring))
1f580a
+                summary = self._trans_error_summary(errstring)
1f580a
+                if summary:
1f580a
+                    errstring += '\n' + summary
1f580a
+
1f580a
+                raise dnf.exceptions.Error(errstring)
1f580a
+
1f580a
 
1f580a
             logger.info(_('Transaction test succeeded.'))
1f580a
             timer()
1f580a
@@ -911,6 +915,9 @@ class Base(object):
1f580a
                     'At least %dMB more space needed on the %s filesystem.',
1f580a
                     disk[k]) % (disk[k], k) + '\n'
1f580a
 
1f580a
+        if not summary:
1f580a
+            return None
1f580a
+
1f580a
         summary = _('Error Summary') + '\n-------------\n' + summary
1f580a
 
1f580a
         return summary
1f580a
--
1f580a
libgit2 0.28.2
1f580a