[llvm-commits] [zorg] r99273 - in /zorg/trunk/lnt/lnt/util: ImportData.py NTEmailReport.py

Daniel Dunbar daniel at zuster.org
Tue Mar 23 02:59:26 PDT 2010


Author: ddunbar
Date: Tue Mar 23 04:59:26 2010
New Revision: 99273

URL: http://llvm.org/viewvc/llvm-project?rev=99273&view=rev
Log:
LNT: Don't send emails on non nightlytest tagged runs.

Modified:
    zorg/trunk/lnt/lnt/util/ImportData.py
    zorg/trunk/lnt/lnt/util/NTEmailReport.py

Modified: zorg/trunk/lnt/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/util/ImportData.py?rev=99273&r1=99272&r2=99273&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/util/ImportData.py (original)
+++ zorg/trunk/lnt/lnt/util/ImportData.py Tue Mar 23 04:59:26 2010
@@ -27,25 +27,32 @@
     except KeyboardInterrupt:
         raise
     except:
+        import traceback
         print >>log, 'ERROR: %r: load failed' % file
+        print >>log, traceback.format_exc()
         return (False, None)
     print >>log, '  LOAD TIME: %.2fs' % (time.time() - startTime,)
 
+    # Check if this is a nightlytest run.
+    tag = data.get('Run',{}).get('Info',{}).get('tag',None)
+    is_nt = tag is None or tag == 'nightlytest'
+
     # Find the email address for this machine's results.
     toAddress = None
-    if isinstance(config.ntEmailTo, str):
-        toAddress = config.ntEmailTo
-    else:
-        # Find the machine name.
-        machineName = str(data.get('Machine',{}).get('Name'))
-        for pattern,addr in config.ntEmailTo:
-            if re.match(pattern, machineName):
-                toAddress = addr
-                break
+    if is_nt and config.ntEmailEnabled:
+        if isinstance(config.ntEmailTo, str):
+            toAddress = config.ntEmailTo
         else:
-            print >>log,("ERROR: unable to match machine name "
-                         "for test results email address!")
-            return (False, None)
+            # Find the machine name.
+            machineName = str(data.get('Machine',{}).get('Name'))
+            for pattern,addr in config.ntEmailTo:
+                if re.match(pattern, machineName):
+                    toAddress = addr
+                    break
+            else:
+                print >>log,("ERROR: unable to match machine name "
+                             "for test results email address!")
+                return (False, None)
 
     importStartTime = time.time()
     try:
@@ -53,7 +60,9 @@
     except KeyboardInterrupt:
         raise
     except:
+        import traceback
         print >>log, 'ERROR: %r: import failed' % file
+        print >>log, traceback.format_exc()
         return (False, None)
 
     print >>log, '  IMPORT TIME: %.2fs' % (time.time() - importStartTime,)
@@ -65,7 +74,7 @@
         for ri in run.info.values():
             print >>log, "    INFO   : %r = %r" % (ri.key, ri.value)
 
-    if not disable_email and config.ntEmailEnabled:
+    if not disable_email and toAddress is not None:
         print >>log, "\nMAILING RESULTS TO: %r\n" % toAddress
         NTEmailReport.emailReport(db, run,
                                   "%s/db_%s/nightlytest/" % (config.zorgURL,

Modified: zorg/trunk/lnt/lnt/util/NTEmailReport.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/util/NTEmailReport.py?rev=99273&r1=99272&r2=99273&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/util/NTEmailReport.py (original)
+++ zorg/trunk/lnt/lnt/util/NTEmailReport.py Tue Mar 23 04:59:26 2010
@@ -174,8 +174,9 @@
     if baseurl[-1] == '/':
         baseurl = baseurl[:-1]
     print >>report, """%s/%d/""" % (baseurl, run.id)
-    print >>report, """Name: %s""" % (machine.info['name'].value,)
     print >>report, """Nickname: %s:%d""" % (machine.name, machine.number)
+    if 'name' in machine.info:
+        print >>report, """Name: %s""" % (machine.info['name'].value,)
     print >>report
     print >>report, """Run: %d, Start Time: %s, End Time: %s""" % (
         run.id, run.start_time, run.end_time)





More information about the llvm-commits mailing list