]> git.proxmox.com Git - mirror_linux-firmware.git/commitdiff
Fix the robot email script
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 19 Oct 2023 17:16:32 +0000 (12:16 -0500)
committerMario Limonciello <mario.limonciello@amd.com>
Thu, 19 Oct 2023 17:16:32 +0000 (12:16 -0500)
```
Traceback (most recent call last):
  File "~/linux-firmware-robot/./contrib/process_linux_firmware.py", line 339, in <module>
    process_database(conn, remote)
  File "~/linux-firmware-robot/./contrib/process_linux_firmware.py", line 276, in process_database
    reply_email(mbox, branch)
  File "~/linux-firmware-robot/./contrib/process_linux_firmware.py", line 86, in reply_email
    reply["To"] += email.utils.formataddr(target)
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
```

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
contrib/process_linux_firmware.py

index 4ef0aa760692f6fe6c4051b6d210cbf54215ef8d..2b7c7f8d5fc3fc17abe6ed35f8ee65da5b55f02d 100755 (executable)
@@ -79,11 +79,12 @@ def reply_email(content, branch):
     reply = email.message.EmailMessage()
 
     orig = email.message_from_string(content)
-    targets = email.utils.getaddresses(
-        orig.get_all("to", []) + orig.get_all("cc", []) + orig.get_all("from", [])
+    reply["To"] = ", ".join(
+        email.utils.formataddr(t)
+        for t in email.utils.getaddresses(
+            orig.get_all("from", []) + orig.get_all("to", []) + orig.get_all("cc", [])
+        )
     )
-    for target in targets:
-        reply["To"] += email.utils.formataddr(target)
 
     reply["From"] = "linux-firmware@kernel.org"
     reply["Subject"] = "Re: {}".format(orig["Subject"])