[auh] upgrade-helper.py: handle unassigned recipes correctly

Submitted by Alexander Kanavin on Dec. 21, 2020, 7:45 p.m. | Patch ID: 179043

Details

Message ID 20201221194541.2484-1-alex.kanavin@gmail.com
State New
Headers show

Commit Message

Alexander Kanavin Dec. 21, 2020, 7:45 p.m.
Attempting to send to unassigned@yoctoproject.org bounces immediately,
which means the CC recipients (such as oe-core list) won't get the email
either.

Instead, send to cc directly.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 upgrade-helper.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/upgrade-helper.py b/upgrade-helper.py
index 7ed7af4..eb3935e 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -320,7 +320,10 @@  class Updater(object):
 
         cc_addr = None
         if "cc_recipients" in settings:
-            cc_addr = settings["cc_recipients"].split()
+            if 'unassigned' in to_addr:
+                to_addr = settings["cc_recipients"].split()
+            else:
+                cc_addr = settings["cc_recipients"].split()
 
         newversion = pkg_ctx['NPV'] if not pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV']
         subject = "[AUH] " + pkg_ctx['PN'] + ": upgrading to " + newversion