Fix exception handling to remove extraneous prints of None
authorEric Edgar <rocket@gentoo.org>
Wed, 27 Apr 2005 21:04:02 +0000 (21:04 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 27 Apr 2005 21:04:02 +0000 (21:04 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@630 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
catalyst
modules/catalyst_support.py

index ae44b14d82a141c023432db462c07a1a0db63722..600d262bb38f4ccd3c57654f748f7398810b2070 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.242 2005/04/27 17:59:35 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.243 2005/04/27 21:04:01 rocket Exp $
+
+  27 Apr 2005; Eric Edgar <rocket@gentoo.org> catalyst,
+  modules/catalyst_support.py:
+  Fix exception handling to remove extraneous prints of None
 
   27 Apr 2005; Eric Edgar <rocket@gentoo.org> modules/stage4_target.py:
   Remove iso creation code from stage4
index 33cfb06affdf5ef3ad1986efc2bf2de1943bc029..851502df2f31159ac5e1ea2b6d6f184484b9665c 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.76 2005/04/26 18:30:50 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.77 2005/04/27 21:04:02 rocket Exp $
 
 # Maintained in full by:
 # Eric Edgar <rocket@gentoo.org>
@@ -195,6 +195,7 @@ def build_target(addlargs, targetmap):
                mytarget.run()
 
        except CatalystError:
+               mytarget.mount_safety_check()
                sys.exit(1)
        
 if __name__ == "__main__":
@@ -342,5 +343,8 @@ if __name__ == "__main__":
                raise CatalystError,"Could not complete build"
                sys.exit(2)
        except KeyboardInterrupt:
-               print "\nCatalyst build aborted due to user interrupt"
+               print "\nCatalyst build aborted due to user interrupt ( Ctrl-C )"
+               sys.exit(2)
+       except:
+               print "Catalyst aborting ...."
                sys.exit(2)
index 47af6accbf98e43c790fdccc368e2a1f10d7be94..a710ce76553a48e37122c9713954ed8421352a0e 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.44 2005/04/27 17:44:58 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.45 2005/04/27 21:04:02 rocket Exp $
 
 import sys,string,os,types,re,signal,traceback,md5,time
 # a function to turn a string of non-printable characters into a string of
@@ -142,11 +142,12 @@ def spawn(mystring,debug=0,fd_pipes=None):
                else:
                        return ((retval & 0xff) << 8) # interrupted by signal
        
-       except:
+       except: 
                os.kill(mypid,signal.SIGTERM)
                if os.waitpid(mypid,os.WNOHANG)[1] == 0:
                # feisty bugger, still alive.
                        os.kill(mypid,signal.SIGKILL)
+               raise
 
 
 def cmd(mycmd,myexc=""):
@@ -154,8 +155,8 @@ def cmd(mycmd,myexc=""):
                retval=spawn(mycmd)
                if retval != 0:
                        raise CatalystError,myexc
-       except KeyboardInterrupt:
-               raise CatalystError,"Caught SIGINT, aborting."
+       except:
+               raise
 
 
 def file_locate(settings,filelist,expand=1):