[PATCH rhel6-branch master 1/2] Catch and display KickstartErrors coming from execute() cleanly (#603059).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 kickstart.py |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 89321e4..5bb7937 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -1132,8 +1132,17 @@ class AnacondaKSHandler(superclass):
             self._dataObjs.append(obj)
 
     def execute(self):
-        for obj in filter(lambda o: hasattr(o, "execute"), self._dataObjs):
-            obj.execute(self.anaconda)
+        try:
+            for obj in filter(lambda o: hasattr(o, "execute"), self._dataObjs):
+                obj.execute(self.anaconda)
+        except KickstartError as e:
+            if self.anaconda.intf:
+                self.anaconda.intf.kickstartErrorWindow(e.__str__())
+                sys.exit(1)
+            else:
+                stderrLog.critical(_("The following error was found while parsing the kickstart "
+                                     "configuration file:\n\n%s") % e)
+                sys.exit(1)
 
 class AnacondaPreParser(KickstartParser):
     # A subclass of KickstartParser that only looks for %pre scripts and
-- 
1.7.0.1

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux