FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-10-2010, 07:38 PM
Chris Lumens
 
Default pykickstart now raises KickstartError instead of IOError.

---
pyanaconda/kickstart.py | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4bafb27..85ceec8 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -1239,15 +1239,7 @@ def preScriptPass(anaconda, file):

try:
ksparser.readKickstart(file)
- except IOError, e:
- if anaconda.intf:
- anaconda.intf.kickstartErrorWindow("Could not open kickstart file or included file named %s" % e.filename)
- sys.exit(1)
- else:
- stderrLog.critical(_("The following error was found while parsing the kickstart "
- "configuration file:

%s") % e)
- sys.exit(1)
- except KickstartError, e:
+ except (KickstartValueError, KickstartParseError) as e:
if anaconda.intf:
anaconda.intf.kickstartErrorWindow(e.__str__())
sys.exit(1)
@@ -1255,6 +1247,14 @@ def preScriptPass(anaconda, file):
stderrLog.critical(_("The following error was found while parsing the kickstart "
"configuration file:

%s") % e)
sys.exit(1)
+ except KickstartError as e:
+ if anaconda.intf:
+ anaconda.intf.kickstartErrorWindow("Could not open kickstart file or included file named %s" % file)
+ sys.exit(1)
+ else:
+ stderrLog.critical(_("The following error was found while parsing the kickstart "
+ "configuration file:

%s") % e)
+ sys.exit(1)

# run %pre scripts
runPreScripts(anaconda, ksparser.handler.scripts)
@@ -1283,19 +1283,19 @@ def parseKickstart(anaconda, file):

try:
ksparser.readKickstart(file)
- except IOError, e:
- # We may not have an intf now, but we can do better than just raising
- # the exception.
+ except (KickstartValueError, KickstartParseError) as e:
if anaconda.intf:
- anaconda.intf.kickstartErrorWindow("Could not open kickstart file or included file named %s" % e.filename)
+ anaconda.intf.kickstartErrorWindow(e.__str__())
sys.exit(1)
else:
stderrLog.critical(_("The following error was found while parsing the kickstart "
"configuration file:

%s") % e)
sys.exit(1)
- except KickstartError, e:
+ except KickstartError as e:
+ # We may not have an intf now, but we can do better than just raising
+ # the exception.
if anaconda.intf:
- anaconda.intf.kickstartErrorWindow(e.__str__())
+ anaconda.intf.kickstartErrorWindow("Could not open kickstart file or included file named %s" % file)
sys.exit(1)
else:
stderrLog.critical(_("The following error was found while parsing the kickstart "
--
1.7.1.1

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

Thread Tools




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

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org