Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   Fix displaying error messages on cleanup/remove callback problems (#572893). (http://www.linux-archive.org/gentoo-development/340569-fix-displaying-error-messages-cleanup-remove-callback-problems-572893-a.html)

Chris Lumens 03-12-2010 02:42 PM

Fix displaying error messages on cleanup/remove callback problems (#572893).
 
The following patch should likely be applied to all branches as well, since
it's good to not traceback when displaying error messages.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Chris Lumens 03-12-2010 02:42 PM

Fix displaying error messages on cleanup/remove callback problems (#572893).
 
---
yuminstall.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index d9c621d..3bd01e5 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -238,6 +238,12 @@ class AnacondaCallback:

(hdr, rpmloc) = h

+ # If this is a cleanup/remove, then hdr is a string not a header.
+ if isinstance(hdr, rpm.hdr):
+ name = hdr['name']
+ else:
+ name = hdr
+
# Script errors store whether or not they're fatal in "total". So,
# we should only error out for fatal script errors or the cpio and
# unpack problems.
@@ -246,7 +252,7 @@ class AnacondaCallback:
_("A fatal error occurred when installing the %s "
"package. This could indicate errors when reading "
"the installation media. Installation cannot "
- "continue.") % hdr['name'],
+ "continue.") % name,
type="custom", custom_icon="error",
custom_buttons=[_("_Exit installer")])
sys.exit(1)
--
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Hans de Goede 03-12-2010 02:56 PM

Fix displaying error messages on cleanup/remove callback problems (#572893).
 
Ack.

On 03/12/2010 04:42 PM, Chris Lumens wrote:

---
yuminstall.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index d9c621d..3bd01e5 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -238,6 +238,12 @@ class AnacondaCallback:

(hdr, rpmloc) = h

+ # If this is a cleanup/remove, then hdr is a string not a header.
+ if isinstance(hdr, rpm.hdr):
+ name = hdr['name']
+ else:
+ name = hdr
+
# Script errors store whether or not they're fatal in "total". So,
# we should only error out for fatal script errors or the cpio and
# unpack problems.
@@ -246,7 +252,7 @@ class AnacondaCallback:
_("A fatal error occurred when installing the %s "
"package. This could indicate errors when reading "
"the installation media. Installation cannot "
- "continue.") % hdr['name'],
+ "continue.") % name,
type="custom", custom_icon="error",
custom_buttons=[_("_Exit installer")])
sys.exit(1)


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 08:23 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.