summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-05-13 16:41:32 +0300
committerTzafrir Cohen <tzafrir@debian.org>2014-12-24 19:17:50 +0200
commit71c17b0e66477ca36fc67b9d87445d312e334361 (patch)
treee34b47b10fc1e55e0e02f916516811a228043c30 /gbp
parente79f2ca2aa4da6cf65a9c5bbeee4e0a3b4b4dd06 (diff)
notifications: make notify() more generic
In order to be able to re-use it in other tools than git-buildpackage. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rw-r--r--gbp/notifications.py5
-rwxr-xr-xgbp/scripts/buildpackage.py11
2 files changed, 8 insertions, 8 deletions
diff --git a/gbp/notifications.py b/gbp/notifications.py
index 9d9071a..d628b26 100644
--- a/gbp/notifications.py
+++ b/gbp/notifications.py
@@ -53,7 +53,7 @@ def send_notification(summary, msg):
return True
-def notify(cp, success, notify_opt):
+def notify(summary, message, notify_opt):
"""
Send a notifications
@return: False on error
@@ -66,6 +66,5 @@ def notify(cp, success, notify_opt):
if not enable:
return [True, False][notify_opt.is_on()]
- summary, msg = build_msg(cp, success)
- return notify_opt.do(send_notification, summary, msg)
+ return notify_opt.do(send_notification, summary, message)
diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py
index 49432e3..0d910e8 100755
--- a/gbp/scripts/buildpackage.py
+++ b/gbp/scripts/buildpackage.py
@@ -635,11 +635,12 @@ def main(argv):
if options.export_dir and options.purge and not retval:
RemoveTree(export_dir)()
- if source and not gbp.notifications.notify(source.changelog,
- not retval,
- options.notify):
- gbp.log.err("Failed to send notification")
- retval = 1
+ if source:
+ summary, msg = gbp.notifications.build_msg(source.changelog,
+ not retval)
+ if not gbp.notifications.notify(summary, msg, options.notify):
+ gbp.log.err("Failed to send notification")
+ retval = 1
return retval