[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

extras-buildsys/server BuildJob.py, 1.3, 1.4 CONFIG.py, 1.9, 1.10 UserInterface.py, 1.2, 1.3



Author: dcbw

Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23564/server

Modified Files:
	BuildJob.py CONFIG.py UserInterface.py 
Log Message:
2005-06-15  Dan Williams <dcbw redhat com>

    * server/BuildJob.py
        - Fix up build failure email to include status on each sub-job
        - Fix email_result since we use email addresses as usernames

    * server/UserInterface.py
        - Fix email_result since we use email addresses as usernames




Index: BuildJob.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/BuildJob.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BuildJob.py	15 Jun 2005 04:10:07 -0000	1.3
+++ BuildJob.py	15 Jun 2005 04:49:08 -0000	1.4
@@ -81,6 +81,7 @@
         self.starttime = time.time()
         self.endtime = None
         self.package = package
+        self.name = None
         self.target = target
         self.buildarches = []
         self.sub_jobs = {}
@@ -395,7 +396,7 @@
         if self.failed or (have_jobs == True and jobs_running == False):
             self.curstage = 'finished'
 
-        time.sleep(5)
+        time.sleep(3)
 
     def _cleanup(self):
         self.curstage = 'cleanup'
@@ -414,15 +415,22 @@
         self.curstage = 'failed'
 
         resultstring = """
-    %s (%s): %s on %s failed to complete on one or more archs.
+   %s (%s): %s on %s failed to complete on one or more archs.
 """ % (self.uid, self.package, self.cvs_tag, self.target)
+        resultstring = resultstring + "\n"
 
+        # Add each arch job and its result:
+        for job in self.sub_jobs.values():
+            if job.client_result != 'killed':
+                resultstring = resultstring + "     " + "%s - %s: %s" % (job.arch, job.jobid, job.client_result) + "\n"
+
+        resultstring = resultstring + "\n"
         self.email_result(resultstring)
         
     def _succeeded(self):
         self.curstage = 'needsign'
 
-        # Copy completed RPMs to repo dir here
+        # Copy completed RPMs to repo dir
         for job in self.sub_jobs.values():
             file_list = job.get_files()
             for f in file_list:
@@ -444,15 +452,15 @@
     def email_result(self, resultstring, subject=None):
         """send 'resultstring' to self.email from self.email_from"""
         
-        print "%s (%s): Result: '%s'" % (self.uid, self.package, resultstring)
-        return
         msg = MIMEText(resultstring)
         if not subject:
-            subject = 'Build Result: %s on %s' % (self.name, self.target)
+            name = self.name
+            if not name:
+                name = self.package
+            subject = 'Build Result: %d - %s on %s' % (self.uid, name, self.target)
         msg['Subject'] = subject
         msg['From'] = CONFIG.get('email_from')
-        email_to = '%s %s' % (self.username, CONFIG.get('email_to_domain'))
-        msg['To'] = email_to
+        msg['To'] = self.username
         s = smtplib.SMTP()
         s.connect()
         s.sendmail(CONFIG.get('email_from'), [email_to], msg.as_string())


Index: CONFIG.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/CONFIG.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- CONFIG.py	15 Jun 2005 04:10:07 -0000	1.9
+++ CONFIG.py	15 Jun 2005 04:49:08 -0000	1.10
@@ -1,7 +1,6 @@
 # Configuration file for build system server
 
 config_opts = {}
-config_opts['email_to_domain'] = "redhat.com"
 config_opts['email_from'] = "buildsys fedoraproject org"
 config_opts['pkg_cvs_root'] = ":pserver:anonymous cvs fedora redhat com:/cvs/dist"
 config_opts['pkg_cvs_rsh'] = ""


Index: UserInterface.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/UserInterface.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- UserInterface.py	15 Jun 2005 04:10:08 -0000	1.2
+++ UserInterface.py	15 Jun 2005 04:49:08 -0000	1.3
@@ -33,8 +33,7 @@
         subject = 'Build Result: %s' % cvs_tag
     msg['Subject'] = subject
     msg['From'] = CONFIG.get('email_from')
-    email_to = '%s %s' % (username, CONFIG.get('email_to_domain'))
-    msg['To'] = email_to
+    msg['To'] = email
     s = smtplib.SMTP()
     s.connect()
     s.sendmail(CONFIG.get('email_from'), [email_to], msg.as_string())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]