failed to send email when smtp_mode is configured to third_part:
2023-08-02 16:27:27.077 7 INFO zaqar.notification.notifier [req-1fbf1274-6793-489c-93da-58cb18a5f782 05c9cff054934f67b3e856644c4d3592 26d7292e19774975896562ae389b876b - default default] [project_id:26d7292e19774975896562ae389b876b] Begin to send mailto confirm/unsubscribe notification. The request body is {'WSGISubscribeURL': 'http://10.0.6.30:8888/v2/queues/notice/subscriptions/0df1ccb1-daff-4436-b5d7-0b94da0adcd4/confirm', 'Message_Type': 'SubscriptionConfirmation', 'Message': 'You have chosen to subscribe to the queue: notice', 'URL-Signature': 'bb38609b0b281988a038821ae127edc7d6de072f2d4df8326edbc2b7792aa316', 'URL-Methods': 'PUT', 'URL-Paths': '/v2/queues/notice/subscriptions/0df1ccb1-daff-4436-b5d7-0b94da0adcd4/confirm', 'X-Project-ID': '26d7292e19774975896562ae389b876b', 'URL-Expires': '2023-08-02T09:27:26', 'SubscribeBody': {'confirmed': True}, 'UnsubscribeBody': {'confirmed': False}}
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto [-] Failed to send email because a bytes-like object is required, not 'str'.: TypeError: a bytes-like object is required, not 'str'
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto Traceback (most recent call last):
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto File "/usr/lib/python3.9/site-packages/zaqar/notification/tasks/mailto.py", line 103, in execute
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto p.communicate(msg.as_string())
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto File "/usr/lib64/python3.9/subprocess.py", line 1119, in communicate
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto self._stdin_write(input)
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto File "/usr/lib64/python3.9/subprocess.py", line 1068, in _stdin_write
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto self.stdin.write(input)
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto TypeError: a bytes-like object is required, not 'str'
2023-08-02 16:27:27.085 7 ERROR zaqar.notification.tasks.mailto
2023-08-02 16:28:28.804 7 INFO zaqar.notification.notifier [req-4d6dae0c-179c-485e-b0d8-e0a1cfe6b7d9 05c9cff054934f67b3e856644c4d3592 26d7292e19774975896562ae389b876b - default default] [project_id:26d7292e19774975896562ae389b876b] Begin to send mailto confirm/unsubscribe notification. The request body is {'WSGISubscribeURL': 'http://10.0.6.30:8888/v2/queues/notice/subscriptions/810bd1bd-7aee-4d20-aefb-be21c65f7a07/confirm', 'Message_Type': 'SubscriptionConfirmation', 'Message': 'You have chosen to subscribe to the queue: notice', 'URL-Signature': 'fb61950f063e6c80ce5982a8c226142048f65b877703cbd55536254ff2c18795', 'URL-Methods': 'PUT', 'URL-Paths': '/v2/queues/notice/subscriptions/810bd1bd-7aee-4d20-aefb-be21c65f7a07/confirm', 'X-Project-ID': '26d7292e19774975896562ae389b876b', 'URL-Expires': '2023-08-02T09:28:28', 'SubscribeBody': {'confirmed': True}, 'UnsubscribeBody': {'confirmed': False}}
Reviewed: https:/ /review. opendev. org/c/openstack /zaqar/ +/890347 /opendev. org/openstack/ zaqar/commit/ e0937b1f097f722 38033ccc7182c88 ab870bc23f
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit e0937b1f097f722 38033ccc7182c88 ab870bc23f
Author: Xing Zhang <email address hidden>
Date: Thu Aug 3 00:06:44 2023 +0800
Use processutils to fix TypeError in subprocess
Calling processutils. execute( ) other than subprocess to
fix bytes-like and str issue in python3.
Closes-bug: #2029392 53951c9ad27bca1 4033194651a
Change-Id: I16436aa19da2cf