summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/patchtest-send-results39
1 files changed, 21 insertions, 18 deletions
diff --git a/scripts/patchtest-send-results b/scripts/patchtest-send-results
index 01b071159b..1df81f943a 100755
--- a/scripts/patchtest-send-results
+++ b/scripts/patchtest-send-results
@@ -59,7 +59,16 @@ subject_line = f"Patchtest results for {mbox_subject}"
59 59
60# extract the submitter email address and use it as the reply address 60# extract the submitter email address and use it as the reply address
61# for the results 61# for the results
62reply_address = re.findall("<(.*)>", mbox[0]['from']) 62reply_address = re.findall("<(.*)>", mbox[0]['from'])[0]
63
64# extract the message ID and use that as the in-reply-to address
65in_reply_to = re.findall("<(.*)>", mbox[0]['Message-ID'])[0]
66
67# the address the results email is sent from
68from_address = "patchtest@automation.yoctoproject.org"
69
70# mailing list to CC
71cc_address = "openembedded-core@lists.openembedded.org"
63 72
64if "FAIL" in testresult: 73if "FAIL" in testresult:
65 reply_contents = None 74 reply_contents = None
@@ -70,24 +79,18 @@ if "FAIL" in testresult:
70 reply_contents = greeting + testresult + suggestions 79 reply_contents = greeting + testresult + suggestions
71 80
72 ses_client = boto3.client('ses', region_name='us-west-2') 81 ses_client = boto3.client('ses', region_name='us-west-2')
73 response = ses_client.send_email( 82 raw_data = 'From: ' + from_address + '\nTo: ' + reply_address + \
74 Source='patchtest@automation.yoctoproject.org', 83 '\nCC: ' + cc_address + '\nSubject:' + subject_line + \
75 Destination={ 84 '\nIn-Reply-To:' + in_reply_to + \
76 'CcAddresses': ['openembedded-core@lists.openembedded.org'], 85 '\nMIME-Version: 1.0" + \
86 "\nContent-type: Multipart/Mixed;boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\n' + \
87 reply_contents + '\n\n--NextPart'
88 response = ses_client.send_raw_email(
89 Source="patchtest@automation.yoctoproject.org",
90 RawMessage={
91 "Data": raw_data,
77 }, 92 },
78 ReplyToAddresses=reply_address,
79 Message={
80 'Subject': {
81 'Data': subject_line,
82 'Charset': 'utf-8'
83 },
84 'Body': {
85 'Text': {
86 'Data': reply_contents,
87 'Charset': 'utf-8'
88 }
89 }
90 }
91 ) 93 )
94
92else: 95else:
93 print(f"No failures identified for {args.patch}.") 96 print(f"No failures identified for {args.patch}.")