diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-08-31 19:02:04 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-08-31 19:02:04 +0000 |
commit | 2fb414157258ed0eb537bde8314feef2b952db2b (patch) | |
tree | 78f90bc6456a9013c0cf2b3c7ce5f337b74a1376 /src | |
parent | 362c894c2679f365d2905fa6357a9ba2419a1d84 (diff) | |
download | bcfg2-2fb414157258ed0eb537bde8314feef2b952db2b.tar.gz bcfg2-2fb414157258ed0eb537bde8314feef2b952db2b.tar.bz2 bcfg2-2fb414157258ed0eb537bde8314feef2b952db2b.zip |
add error handling
(Logical change 1.50)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@292 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/sbin/bcfg2 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 8ed4bbbc3..1741e748b 100644 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -1,9 +1,10 @@ #!/usr/bin/env python from getopt import getopt, GetoptError from os import popen, chmod, unlink -from sys import argv, exit +from sys import argv, exit, exc_info from string import join from tempfile import mktemp +from traceback import extract_tb from elementtree.ElementTree import Element, XML, tostring @@ -117,7 +118,16 @@ if __name__ == '__main__': for entry in [k for (k,v) in entrystate.iteritems() if not v]: method = getattr(toolset, "Install%s"%(entry.tag)) - entrystate[entry] = method(entry) + try: + entrystate[entry] = method(entry) + except: + print "Install failed for %s"%(tostring(entry)) + (t,v,tb) = exc_info() + print "Unexpected failure in Install:" + for line in extract_tb(tb): + print "File %s, line %i, in %s\n %s\n"%(line) + print "%s: %s\n"%(t,v) + del t,v,tb for structure in structurestate.keys(): if structurestate[structure]: |