[yocto] [[AUH] PATCHv2 11/13] upgradehelper.py: Only send email to Maintainer when upgrade succeed.

Aníbal Limón anibal.limon at linux.intel.com
Wed Nov 11 14:34:27 PST 2015


Change the policy for send emails to only send when upgrade succeed
to avoid waste time of the Maintainers when upgrade process fails
because the failure patch generated isn't useful.

Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
---
 upgradehelper.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/upgradehelper.py b/upgradehelper.py
index a3ca373..c2bf506 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -353,8 +353,6 @@ class Updater(object):
             self.git.reset_hard(1)
             self.git.clean_untracked()
 
-        # only send email to Maintainer when patch file exist
-        if self.send_email and self.patch_file:
             mail_header = \
                 "Hello,\n\nYou are receiving this email because you are the maintainer\n" \
                 "of *%s* recipe and this is to let you know that the automatic attempt\n" \
@@ -414,6 +412,8 @@ class Updater(object):
                 if os.path.isfile(attachment_fullpath):
                     attachments.append(attachment_fullpath)
 
+        # Only send email to Maintainer when recipe upgrade succeed.
+        if self.send_email and not err:
             self.email_handler.send_email(to_addr, subject, msg_body, attachments, cc_addr=cc_addr)
 
     def _commit_changes(self):
-- 
2.1.4




More information about the yocto mailing list