On Monday 14 January 2008, Dennis Gilmore wrote:
> the attached patch makes it configurable to send email to the owner of a
> package and person submitting the job.  This is needed for secondary arches
> so that you dont get 6 emails per build.
>
> Dennis

this patch fixes a typo in the original.

Dennis

From 61b4c4f156378d8feee9ff7af86c8d123f17725b Mon Sep 17 00:00:00 2001
From: Dennis Gilmore <[EMAIL PROTECTED]>
Date: Mon, 14 Jan 2008 22:00:43 -0600
Subject: [PATCH] make a configurable option to send email for success or not

---
 hub/httpd.conf |    1 +
 hub/kojihub.py |   16 +++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/hub/httpd.conf b/hub/httpd.conf
index e4acd64..5d3f5e1 100644
--- a/hub/httpd.conf
+++ b/hub/httpd.conf
@@ -32,6 +32,7 @@ Alias /kojihub "/usr/share/koji-hub/XMLRPC"
         # The domain name that will be appended to Koji usernames
         # when creating email notifications
         PythonOption EmailDomain example.com
+        PythonOption EmailOwner False
         # PythonOption KojiDebug On
         # PythonOption KojiTraceback "extended"
         # sending tracebacks to the client isn't very helpful for debugging xmlrpc
diff --git a/hub/kojihub.py b/hub/kojihub.py
index 9a75552..5a4cfc7 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -3551,13 +3551,15 @@ def get_notification_recipients(build, tag_id, state):
     emails = [result[0] for result in _fetchMulti(query, locals())]
 
     email_domain = context.opts['EmailDomain']
-
-    # user who submitted the build
-    emails.append('[EMAIL PROTECTED]' % (build['owner_name'], email_domain))
-
-    packages = readPackageList(pkgID=package_id, tagID=tag_id, inherit=True)
-    # owner of the package in this tag, following inheritance
-    emails.append('[EMAIL PROTECTED]' % (packages[package_id]['owner_name'], email_domain))
+    email_owner = context.opts['EmailOwner'] 
+  
+    if email_owner is True or state != koji.BUILD_STATES['COMPLETE']: 
+        # user who submitted the build
+        emails.append('[EMAIL PROTECTED]' % (build['owner_name'], email_domain))
+
+        packages = readPackageList(pkgID=package_id, tagID=tag_id, inherit=True)
+        # owner of the package in this tag, following inheritance
+        emails.append('[EMAIL PROTECTED]' % (packages[package_id]['owner_name'], email_domain))
 
     emails_uniq = dict(zip(emails, [1] * len(emails))).keys()
     return emails_uniq
-- 
1.5.3.8

--
Fedora-buildsys-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list

Reply via email to