[svn-commits] mnicholson: testsuite/asterisk/trunk r2778 - /asterisk/trunk/runtests.py

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 15 16:20:53 CST 2011


Author: mnicholson
Date: Tue Nov 15 16:20:52 2011
New Revision: 2778

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2778
Log:
always attempt to archive backtraces

Modified:
    asterisk/trunk/runtests.py

Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=2778&r1=2777&r2=2778
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Tue Nov 15 16:20:52 2011
@@ -92,30 +92,19 @@
                 print "Unknown exception occurred while executing %s" % cmd
                 return
 
-            if not os.path.exists(dest_dir):
+            try:
+                if not os.path.exists(dest_dir):
+                    os.makedirs(dest_dir)
+                os.link("./backtrace.txt", dest_dir + "/backtrace.txt")
+            except OSError, ose:
+                """ Different partitions can cause this to fail """
+                print "OSError occurred while copying %s ([%d]: %s)" % ("backtrace.txt", ose.errno, ose.strerror)
+                print "Attempting copy"
                 try:
-                    os.makedirs(dest_dir)
-                    os.link("./backtrace.txt", dest_dir + "/backtrace.txt")
-                except OSError, ose:
-                    """ Different partitions can cause this to fail """
-                    print "OSError occurred while copying %s ([%d]: %s)" % ("backtrace.txt", ose.errno, ose.strerror)
-                    print "Attempting copy"
-                    try:
-                        shutil.copy("./backtrace.txt", dest_dir + "/backtrace.txt")
-                    except shutil.Error, err:
-                        for e in err:
-                            print "Exception occurred while archiving backtrace from %s to %s: %s" % (e[0], e[1], e[2])
-                    except IOError, io:
-                        """ Don't let an IOError blow out the whole test run """
-                        print "IOError Exception occured while copying backtrace"
-                        try:
-                            (code, message) = io
-                        except:
-                            code = 0
-                            message = io
-                        print "ErrNo: %d - %s" % (code, message)
-                    except:
-                        print "Unknown exception occurred while attempting to copy backtrace"
+                    shutil.copy("./backtrace.txt", dest_dir + "/backtrace.txt")
+                except shutil.Error, err:
+                    for e in err:
+                        print "Exception occurred while archiving backtrace from %s to %s: %s" % (e[0], e[1], e[2])
                 except IOError, io:
                     """ Don't let an IOError blow out the whole test run """
                     print "IOError Exception occured while copying backtrace"
@@ -127,6 +116,17 @@
                     print "ErrNo: %d - %s" % (code, message)
                 except:
                     print "Unknown exception occurred while attempting to copy backtrace"
+            except IOError, io:
+                """ Don't let an IOError blow out the whole test run """
+                print "IOError Exception occured while copying backtrace"
+                try:
+                    (code, message) = io
+                except:
+                    code = 0
+                    message = io
+                print "ErrNo: %d - %s" % (code, message)
+            except:
+                print "Unknown exception occurred while attempting to copy backtrace"
 
     def __archive_ast_logs(self):
         ast_directories = "%s/%s" % (Asterisk.test_suite_root, self.test_name.lstrip("tests/"))




More information about the svn-commits mailing list