)]}'
{"zaqar/common/configs.py":[{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"90d97e15a40cf471866ee358d3f81e89204fdaa5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                      \u0027catalogue/control plane data is kept.\u0027),"},{"line_number":31,"context_line":"                deprecated_opts\u003d[cfg.DeprecatedOpt(\u0027sharding\u0027)]),"},{"line_number":32,"context_line":"    cfg.BoolOpt(\u0027unreliable\u0027, default\u003dNone,"},{"line_number":33,"context_line":"                help\u003d\u0027Disable all reliability constrains.\u0027),"},{"line_number":34,"context_line":")"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"_DRIVER_OPTIONS \u003d ("}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_6360decf","line":33,"updated":"2015-08-20 12:49:36.000000000","message":"You\u0027re reintroducing the typo here.","commit_id":"3447c86151c25618a05923be16bf84f883c9df60"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"6dc4e789aedbe71a41eeeeca1c5ea1a9aa6310bd","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"_NOTIFICATION_OPTIONS \u003d ("},{"line_number":58,"context_line":"    cfg.ListOpt(\u0027smtp_command\u0027, default\u003d[\u0027/usr/sbin/sendmail\u0027, \u0027-t\u0027, \u0027-oi\u0027],"},{"line_number":59,"context_line":"                help\u003d(\u0027The command of smpt to send email. The format is \u0027"},{"line_number":60,"context_line":"                      \u0027[\"command_name\", \"arg1\", \"arg2\"].\u0027)),"},{"line_number":61,"context_line":")"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_471483e7","line":58,"updated":"2015-09-01 11:50:26.000000000","message":"mind using MultiStrOpt or Str? We should split in Zaqar","commit_id":"5d191ea0ac96b7bac737f3567244d394e3c1256a"}],"zaqar/notification/notifier.py":[{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"90d97e15a40cf471866ee358d3f81e89204fdaa5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                                                            project)"},{"line_number":43,"context_line":"            data_driver \u003d self.subscription_controller.driver"},{"line_number":44,"context_line":"            conf \u003d (getattr(data_driver, \u0027conf\u0027, None) or"},{"line_number":45,"context_line":"                    getattr(data_driver, \u0027_conf\u0027))"},{"line_number":46,"context_line":"            for sub in next(subscribers):"},{"line_number":47,"context_line":"                s_type \u003d urllib_parse.urlparse(sub[\u0027subscriber\u0027]).scheme"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_83189276","line":45,"updated":"2015-08-20 12:49:36.000000000","message":"Maybe you can simply access it with cfg.CONF?","commit_id":"3447c86151c25618a05923be16bf84f883c9df60"},{"author":{"_account_id":17456,"name":"Juan Manuel Santos","email":"vicariousdm@gmail.com","username":"godlike"},"change_message_id":"1968a28f794013710a1c87bcb4de3da054dd8ca7","unresolved":false,"context_lines":[{"line_number":55,"context_line":""},{"line_number":56,"context_line":"            for sub in next(subscribers):"},{"line_number":57,"context_line":"                import pdb"},{"line_number":58,"context_line":"                pdb.set_trace()"},{"line_number":59,"context_line":"                s_type \u003d urllib_parse.urlparse(sub[\u0027subscriber\u0027]).scheme"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"                mgr \u003d driver.DriverManager(\u0027zaqar.notification.tasks\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_b8c9f0ae","line":58,"updated":"2015-08-26 18:54:15.000000000","message":"I think you missed these :)","commit_id":"36fc81214510ee14ec1cd533e3c9ef88d10a20e0"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1b6a872b5270ece505ee207e25b21a36f121aea6","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"_NOTIFICATION_OPTIONS \u003d ("},{"line_number":26,"context_line":"    cfg.StrOpt(\u0027sendmail_path\u0027, default\u003d\u0027/usr/sbin/sendmail\u0027,"},{"line_number":27,"context_line":"               help\u003d(\u0027The location of sendmail command.\u0027)),"},{"line_number":28,"context_line":")"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_647398b2","line":26,"updated":"2015-08-27 08:00:03.000000000","message":"Shouldn\u0027t this be `smtp_command` or something like that? What if I want to use something that\u0027s not sendmail ?\n\nI think this should be something like:\n\n  smtp_cmd \u003d /usr/bin/sendmail -t -oi\n\nthat way I could change the command and use `msmtp` instead if I want","commit_id":"1edc8db9544ba18030353eac241d6f94c155298c"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1b6a872b5270ece505ee207e25b21a36f121aea6","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                                           s_type,"},{"line_number":61,"context_line":"                                           invoke_on_load\u003dTrue)"},{"line_number":62,"context_line":"                self.executor.submit(mgr.driver.execute, sub, messages,"},{"line_number":63,"context_line":"                                     conf\u003dCONF)"},{"line_number":64,"context_line":"        else:"},{"line_number":65,"context_line":"            LOG.error(\u0027Failed to get subscription controller.\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da20952f_a42bf081","line":63,"updated":"2015-08-27 08:00:03.000000000","message":"I saw that Thomas suggested this in a previous PS. Please, use local config instances. We\u0027ve tried hard to structure the code in a way that you won\u0027t need to access the global `CONF` object. Mind reverting this change?\n\nIf you want to avoid having to access either `_conf` or `conf` - which looks like a bug - then pls, rename the `_conf` to `conf` in the DataDriver that has it as a private argument.","commit_id":"1edc8db9544ba18030353eac241d6f94c155298c"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"9551cc6256d855fa47dfc01473abec9953bd2a9a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            subscribers \u003d self.subscription_controller.list(queue_name,"},{"line_number":42,"context_line":"                                                            project)"},{"line_number":43,"context_line":"            sub_list \u003d list(next(subscribers))"},{"line_number":44,"context_line":"            for sub in sub_list:"},{"line_number":45,"context_line":"                s_type \u003d urllib_parse.urlparse(sub[\u0027subscriber\u0027]).scheme"},{"line_number":46,"context_line":"                data_driver \u003d self.subscription_controller.driver"},{"line_number":47,"context_line":"                conf \u003d (getattr(data_driver, \u0027conf\u0027, None) or"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_ace05b97","line":44,"updated":"2015-08-28 17:25:20.000000000","message":"I think just \"next(subscribers)\" would do here - no need for the extra assignment.","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"effcdd79e25d5c2455cdf80a69e2eef65fb9e6b4","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            subscribers \u003d self.subscription_controller.list(queue_name,"},{"line_number":42,"context_line":"                                                            project)"},{"line_number":43,"context_line":"            sub_list \u003d list(next(subscribers))"},{"line_number":44,"context_line":"            for sub in sub_list:"},{"line_number":45,"context_line":"                s_type \u003d urllib_parse.urlparse(sub[\u0027subscriber\u0027]).scheme"},{"line_number":46,"context_line":"                data_driver \u003d self.subscription_controller.driver"},{"line_number":47,"context_line":"                conf \u003d (getattr(data_driver, \u0027conf\u0027, None) or"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_c3531a38","line":44,"in_reply_to":"da20952f_ace05b97","updated":"2015-08-31 05:01:45.000000000","message":"Oh, yep,  I was doing a test and forget to change it back.","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"6dc4e789aedbe71a41eeeeca1c5ea1a9aa6310bd","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                s_type \u003d urllib_parse.urlparse(sub[\u0027subscriber\u0027]).scheme"},{"line_number":46,"context_line":"                data_driver \u003d self.subscription_controller.driver"},{"line_number":47,"context_line":"                conf \u003d (getattr(data_driver, \u0027conf\u0027, None) or"},{"line_number":48,"context_line":"                        getattr(data_driver, \u0027_conf\u0027))"},{"line_number":49,"context_line":"                mgr \u003d driver.DriverManager(\u0027zaqar.notification.tasks\u0027,"},{"line_number":50,"context_line":"                                           s_type,"},{"line_number":51,"context_line":"                                           invoke_on_load\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_07320ba7","line":48,"updated":"2015-09-01 11:50:26.000000000","message":"since you\u0027re going to submit a new PS, mind adding a TODO here? We should standardize this `_conf`/`conf` thing","commit_id":"5d191ea0ac96b7bac737f3567244d394e3c1256a"}],"zaqar/notification/task/email.py":[{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"595063526051813af40ea5f3aafaff45249f3e9d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                                        subscription[\u0027options\u0027].get(\u0027subject\u0027,"},{"line_number":42,"context_line":"                                                                    \u0027\u0027))"},{"line_number":43,"context_line":"            "},{"line_number":44,"context_line":"            p \u003d Popen([\"/usr/sbin/sendmail\", \"-t\", \"-oi\"], stdin\u003dPIPE)"},{"line_number":45,"context_line":"            p.communicate(msg.as_string())"},{"line_number":46,"context_line":"        except Exception as e:"},{"line_number":47,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_2c98631b","line":44,"updated":"2015-07-16 03:47:00.000000000","message":"oh, don\u0027t do this. use python email module instead?","commit_id":"845bc26602d9719a744974f042a4f73f111a50ea"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"4a8632a2937fe53d4d559a2febe659eee86ee9bc","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                                        subscription[\u0027options\u0027].get(\u0027subject\u0027,"},{"line_number":42,"context_line":"                                                                    \u0027\u0027))"},{"line_number":43,"context_line":"            "},{"line_number":44,"context_line":"            p \u003d Popen([\"/usr/sbin/sendmail\", \"-t\", \"-oi\"], stdin\u003dPIPE)"},{"line_number":45,"context_line":"            p.communicate(msg.as_string())"},{"line_number":46,"context_line":"        except Exception as e:"},{"line_number":47,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a41bdd9_40ed3a24","line":44,"in_reply_to":"9a41bdd9_2c98631b","updated":"2015-07-23 21:29:03.000000000","message":"Thanks for the review, Qiming. May I know why? We have discussed this at here, see https://review.openstack.org/188662","commit_id":"845bc26602d9719a744974f042a4f73f111a50ea"}],"zaqar/notification/task/mailto.py":[{"author":{"_account_id":17456,"name":"Juan Manuel Santos","email":"vicariousdm@gmail.com","username":"godlike"},"change_message_id":"6d990cea60b038b6c56af5970851479e2b365987","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# TODO(flwang): Make the sendmail path configurable"},{"line_number":29,"context_line":"SENDMAIL_CMD \u003d [\"/usr/sbin/sendmail\", \"-t\", \"-oi\"]"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class MailtoTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_14ec53c6","line":29,"updated":"2015-08-17 22:06:17.000000000","message":"Is there any particular reason to use the sendmail binary (which nowadays is provided as a backwards compatibility thing) instead of directly using Python\u0027s SMTP implementation? Sounds to me that if we have the sendmail binary installed locally, we should have an SMTP server listening locally.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"06b1d8831002ea02f2ea4da71f40945ae6cb3660","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# TODO(flwang): Make the sendmail path configurable"},{"line_number":29,"context_line":"SENDMAIL_CMD \u003d [\"/usr/sbin/sendmail\", \"-t\", \"-oi\"]"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class MailtoTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_7777c708","line":29,"updated":"2015-08-14 12:01:48.000000000","message":"can we make this configurable right away?\n\nI guess one option with the full command should be enough.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"0a46c25e552cd95bf83d3ff5ea1a9fc958379d41","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# TODO(flwang): Make the sendmail path configurable"},{"line_number":29,"context_line":"SENDMAIL_CMD \u003d [\"/usr/sbin/sendmail\", \"-t\", \"-oi\"]"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class MailtoTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_fdc38336","line":29,"in_reply_to":"1a4dcd0f_7777c708","updated":"2015-08-19 03:56:51.000000000","message":"Yep, no problem. I just want to see a confirmation if we want to add a new configuration now :)","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"da0f3681304055a6692fb58cb6a5d571294e9497","unresolved":false,"context_lines":[{"line_number":26,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"# TODO(flwang): Make the sendmail path configurable"},{"line_number":29,"context_line":"SENDMAIL_CMD \u003d [\"/usr/sbin/sendmail\", \"-t\", \"-oi\"]"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class MailtoTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_b676cc3c","line":29,"in_reply_to":"fa1b9901_14ec53c6","updated":"2015-08-17 22:30:58.000000000","message":"Can you provide proof that it is provided as a \"backward compatibility thing\"?: I do not agree with this. There are plenty of systems where there\u0027s a sendmail that works, but no port 25 listener on localhost, or in fact anywhere in the network.\n\nThe reason to use sendmail is because it should universally respect the way in which the system owner has set up email sending. There are well established patterns for configuring your MTA to send through smart hosts, or not at all, or to aliases locally. It is a universal email delivery paradigm. SMTP, however, will have all of that, plus will require the MTA to be setup in an \"accept\" mode, and that is an extra level of complexity that is unnecessary (make it listen on localhost only, make it relay for certain hosts, or with auth, etc. etc).\n\nIt\u0027s possible this is one of those religious disagreements and both methods will be desired depending on the environment. I wouldn\u0027t mind seeing that handled by pushing email into a layer of abstraction so that Zaqar doesn\u0027t have to encode exactly what to do, much like logging.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"06b1d8831002ea02f2ea4da71f40945ae6cb3660","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            p \u003d subprocess.Popen(SENDMAIL_CMD, stdin\u003dsubprocess.PIPE)"},{"line_number":43,"context_line":"            for message in messages:"},{"line_number":44,"context_line":"                try:"},{"line_number":45,"context_line":"                    msg \u003d text.MIMEText(json.dumps(message))"},{"line_number":46,"context_line":"                    msg[\"to\"] \u003d subscriber.path"},{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_17d763c0","line":45,"updated":"2015-08-14 12:01:48.000000000","message":"later on, we should allow ppl to format their messages rather than dumping raw json in the email body.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"0a46c25e552cd95bf83d3ff5ea1a9fc958379d41","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            p \u003d subprocess.Popen(SENDMAIL_CMD, stdin\u003dsubprocess.PIPE)"},{"line_number":43,"context_line":"            for message in messages:"},{"line_number":44,"context_line":"                try:"},{"line_number":45,"context_line":"                    msg \u003d text.MIMEText(json.dumps(message))"},{"line_number":46,"context_line":"                    msg[\"to\"] \u003d subscriber.path"},{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_1dbf4fab","line":45,"in_reply_to":"1a4dcd0f_17d763c0","updated":"2015-08-19 03:56:51.000000000","message":"Yep, I was thinking if we can support a template in options of subscription. But how about we do that in a separate patch? How do you think?","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"672d9629582d03c3b4185d76b40124550612f0a3","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            p \u003d subprocess.Popen(SENDMAIL_CMD, stdin\u003dsubprocess.PIPE)"},{"line_number":43,"context_line":"            for message in messages:"},{"line_number":44,"context_line":"                try:"},{"line_number":45,"context_line":"                    msg \u003d text.MIMEText(json.dumps(message))"},{"line_number":46,"context_line":"                    msg[\"to\"] \u003d subscriber.path"},{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_28221053","line":45,"in_reply_to":"1a4dcd0f_1dbf4fab","updated":"2015-08-19 07:54:56.000000000","message":"Oh totally, I didn\u0027t mean to imply that should happen in this one.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"06b1d8831002ea02f2ea4da71f40945ae6cb3660","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"},{"line_number":49,"context_line":"                    msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":50,"context_line":"                    p.communicate(msg.as_string())"},{"line_number":51,"context_line":"                except Exception as e:"},{"line_number":52,"context_line":"                    LOG.exception(e)"},{"line_number":53,"context_line":"        except OSError as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a4dcd0f_37585f8a","line":50,"updated":"2015-08-14 12:01:48.000000000","message":"I\u0027ve a couple of questions:\n\n1) Is this call blocking? or does it add the email to `sendmail`\u0027s queue?\n\n2) Is there a way to send a bulk of emails to `sendmail` rather than calling it once for every message?","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":17456,"name":"Juan Manuel Santos","email":"vicariousdm@gmail.com","username":"godlike"},"change_message_id":"6d990cea60b038b6c56af5970851479e2b365987","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"},{"line_number":49,"context_line":"                    msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":50,"context_line":"                    p.communicate(msg.as_string())"},{"line_number":51,"context_line":"                except Exception as e:"},{"line_number":52,"context_line":"                    LOG.exception(e)"},{"line_number":53,"context_line":"        except OSError as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_74fcaf3e","line":50,"in_reply_to":"1a4dcd0f_37585f8a","updated":"2015-08-17 22:06:17.000000000","message":"1) It is blocking until the command returns. The sendmail binary when called locally should submit the mail to the local SMTP server (which should be pretty quick and errorless unless something is really wrong with the SMTP server).\n\n2) You can send the same message to multiple recipients, but if you wish to bulking messages up I think this needs to be change to \u0027cache\u0027 those messages before sending them.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"da0f3681304055a6692fb58cb6a5d571294e9497","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"},{"line_number":49,"context_line":"                    msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":50,"context_line":"                    p.communicate(msg.as_string())"},{"line_number":51,"context_line":"                except Exception as e:"},{"line_number":52,"context_line":"                    LOG.exception(e)"},{"line_number":53,"context_line":"        except OSError as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_b649ecd2","line":50,"in_reply_to":"fa1b9901_74fcaf3e","updated":"2015-08-17 22:30:58.000000000","message":"Actually the sendmail command with most MTA\u0027s (postfix, exim, sendmail, qmail) will add the message directly to the local MTA\u0027s mail queue and return immediately. This is generally a very cheap operation. What happens next happens in the background, which may or may not be SMTP forwarding the message elsewhere.","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"42ff63d54326928dc4dee5962b2b7f5195b154cc","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                    msg[\"from\"] \u003d subscription[\u0027options\u0027].get(\u0027from\u0027, \u0027\u0027)"},{"line_number":48,"context_line":"                    subject_opt \u003d subscription[\u0027options\u0027].get(\u0027subject\u0027, \u0027\u0027)"},{"line_number":49,"context_line":"                    msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":50,"context_line":"                    p.communicate(msg.as_string())"},{"line_number":51,"context_line":"                except Exception as e:"},{"line_number":52,"context_line":"                    LOG.exception(e)"},{"line_number":53,"context_line":"        except OSError as e:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa1b9901_a7dbe91a","line":50,"in_reply_to":"fa1b9901_b649ecd2","updated":"2015-08-18 06:47:52.000000000","message":"If it\u0027s cheap, I\u0027m good with that :D","commit_id":"afaa1efddb5f4d22b5c571159fc6c02f9cb51ed6"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"9551cc6256d855fa47dfc01473abec9953bd2a9a","unresolved":false,"context_lines":[{"line_number":28,"context_line":"class MailtoTask(object):"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def execute(self, subscription, messages, **kwargs):"},{"line_number":31,"context_line":"        try:"},{"line_number":32,"context_line":"            subscriber \u003d urllib_parse.urlparse(subscription[\u0027subscriber\u0027])"},{"line_number":33,"context_line":"            params \u003d urllib_parse.parse_qs(subscriber.query)"},{"line_number":34,"context_line":"            params \u003d dict((k.lower(), v) for k, v in params.items())"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_ccdd8fe1","line":31,"updated":"2015-08-28 17:25:20.000000000","message":"I\u0027d really rather there be less code in this `try` block, ideally just the contents of the \"for\" loop here, so one failure won\u0027t stop the rest of the messages from being sent.","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"effcdd79e25d5c2455cdf80a69e2eef65fb9e6b4","unresolved":false,"context_lines":[{"line_number":28,"context_line":"class MailtoTask(object):"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def execute(self, subscription, messages, **kwargs):"},{"line_number":31,"context_line":"        try:"},{"line_number":32,"context_line":"            subscriber \u003d urllib_parse.urlparse(subscription[\u0027subscriber\u0027])"},{"line_number":33,"context_line":"            params \u003d urllib_parse.parse_qs(subscriber.query)"},{"line_number":34,"context_line":"            params \u003d dict((k.lower(), v) for k, v in params.items())"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_b6795cca","line":31,"in_reply_to":"da20952f_ccdd8fe1","updated":"2015-08-31 05:01:45.000000000","message":"It makes sense for me. The reason I put all the code under try/except is because I just wanna make sure it won\u0027t break the zaqar service.\n\nI don\u0027t mind moving some of code out :)","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"9551cc6256d855fa47dfc01473abec9953bd2a9a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_ecdad3e7","line":46,"updated":"2015-08-28 17:25:20.000000000","message":"There are lots of different OSErrors, can you include error specifics in the log please?","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"0e03cd42b486925d3a5ab25013e6033f8a0d40de","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_7798751c","line":46,"in_reply_to":"da20952f_408820c5","updated":"2015-08-31 22:35:41.000000000","message":"Got it, thanks for the clarification. Will do.","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"9309553a2179e6cf2a001b178bfb7a083ecfe72e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_408820c5","line":46,"in_reply_to":"da20952f_563800ef","updated":"2015-08-31 14:10:38.000000000","message":"I mean \"lots of\" in that there are many different error numbers within OSError, for example, errno 13, EACCESS which indicates that you don\u0027t have the proper permissions. For a full listing, see https://docs.python.org/2/library/errno.html\n\nIf you only log \"failed to create process\" without the specifics of the OSError that was raised, debugging will become very hard for operators and other developers.","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"effcdd79e25d5c2455cdf80a69e2eef65fb9e6b4","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                msg[\"subject\"] \u003d params.get(\u0027subject\u0027, subject_opt)"},{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_563800ef","line":46,"in_reply_to":"da20952f_ecdad3e7","updated":"2015-08-31 05:01:45.000000000","message":"What did you mean \u0027losts of\u0027 OSError? AFAIK, there are two subclass of OSError, but they\u0027re not the case. For this scenario, if there is no sendmail command, then subprocess.Popen will raise an OSError. That\u0027s why I put it at here.\n\n\n      |    +-- EnvironmentError\n      |    |    +-- IOError\n      |    |    +-- OSError\n      |    |         +-- WindowsError (Windows)\n      |    |         +-- VMSError (VMS)","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"9551cc6256d855fa47dfc01473abec9953bd2a9a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_8ce317a4","line":48,"updated":"2015-08-28 17:25:20.000000000","message":"Can you give this log message more context?","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"effcdd79e25d5c2455cdf80a69e2eef65fb9e6b4","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_(\u0027Failed to create process for sendmail.\u0027))"},{"line_number":47,"context_line":"        except Exception as e:"},{"line_number":48,"context_line":"            LOG.error(e)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_39845d5c","line":48,"in_reply_to":"da20952f_8ce317a4","updated":"2015-08-31 05:01:45.000000000","message":"I will put a message like \"Failed to send email\".","commit_id":"706ab432197f47af92c97770f50a36c408d53cfb"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"ea04b67d83f5133c68764d5756201b0cc1f45b08","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        params \u003d urllib_parse.parse_qs(subscriber.query)"},{"line_number":33,"context_line":"        params \u003d dict((k.lower(), v) for k, v in params.items())"},{"line_number":34,"context_line":"        conf \u003d kwargs.get(\u0027conf\u0027)"},{"line_number":35,"context_line":"        try:"},{"line_number":36,"context_line":"            for message in messages:"},{"line_number":37,"context_line":"                p \u003d subprocess.Popen(conf.notification.smtp_command,"},{"line_number":38,"context_line":"                                     stdin\u003dsubprocess.PIPE)"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_1ab82229","line":35,"updated":"2015-09-01 12:04:14.000000000","message":"I think khis try/except should probably be inside the loop. \n\nSay 5 messages are going to be sent, and message 3 experiences a transient failure, it shouldn\u0027t stop the program from attempting to send messages 4 and 5.","commit_id":"5d191ea0ac96b7bac737f3567244d394e3c1256a"},{"author":{"_account_id":12321,"name":"Ryan Brown","email":"rybrown@redhat.com","username":"ryansb"},"change_message_id":"ea04b67d83f5133c68764d5756201b0cc1f45b08","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                   \u0027 because {0}\u0027.format(e.strerror))"},{"line_number":48,"context_line":"            LOG.error(_LE(msg))"},{"line_number":49,"context_line":"        except Exception:"},{"line_number":50,"context_line":"            LOG.error(_LE(\u0027Failed to send email\u0027))"}],"source_content_type":"text/x-python","patch_set":12,"id":"da20952f_daeb8a11","line":50,"updated":"2015-09-01 12:04:14.000000000","message":"When you move these messages inside the loop, please also include the message ID in these failure messages, and ideally the destination email address.","commit_id":"5d191ea0ac96b7bac737f3567244d394e3c1256a"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"393534dee3a6a7eb921558ec3f5f67eee53ca7e7","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_LE(\u0027Failed to create process for sendmail, \u0027"},{"line_number":47,"context_line":"                          \u0027because %{error}s\u0027), {\u0027error\u0027: e.strerror})"},{"line_number":48,"context_line":"        except Exception:"},{"line_number":49,"context_line":"            LOG.error(_LE(\u0027Failed to send email\u0027))"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_69007634","line":47,"updated":"2015-09-01 13:39:07.000000000","message":"I think you want `%` here rather than `,`","commit_id":"0025c14ce16995c2845b6848ffe5e4fd33b94d85"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"73fe4151148020a0c0d78535ef937709e3a96e6b","unresolved":false,"context_lines":[{"line_number":44,"context_line":"                p.communicate(msg.as_string())"},{"line_number":45,"context_line":"        except OSError as e:"},{"line_number":46,"context_line":"            LOG.error(_LE(\u0027Failed to create process for sendmail, \u0027"},{"line_number":47,"context_line":"                          \u0027because %{error}s\u0027), {\u0027error\u0027: e.strerror})"},{"line_number":48,"context_line":"        except Exception:"},{"line_number":49,"context_line":"            LOG.error(_LE(\u0027Failed to send email\u0027))"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_1c80198b","line":47,"in_reply_to":"da20952f_69007634","updated":"2015-09-01 15:17:17.000000000","message":"em.. \u0027,\u0027 is preferred to \u0027%\u0027 in a LOG call as I can recollect.","commit_id":"0025c14ce16995c2845b6848ffe5e4fd33b94d85"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"393534dee3a6a7eb921558ec3f5f67eee53ca7e7","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            LOG.error(_LE(\u0027Failed to create process for sendmail, \u0027"},{"line_number":47,"context_line":"                          \u0027because %{error}s\u0027), {\u0027error\u0027: e.strerror})"},{"line_number":48,"context_line":"        except Exception:"},{"line_number":49,"context_line":"            LOG.error(_LE(\u0027Failed to send email\u0027))"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_899dca0b","line":49,"updated":"2015-09-01 13:39:07.000000000","message":"could you add a `LOG.exception(exc)` here?","commit_id":"0025c14ce16995c2845b6848ffe5e4fd33b94d85"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"73fe4151148020a0c0d78535ef937709e3a96e6b","unresolved":false,"context_lines":[{"line_number":46,"context_line":"            LOG.error(_LE(\u0027Failed to create process for sendmail, \u0027"},{"line_number":47,"context_line":"                          \u0027because %{error}s\u0027), {\u0027error\u0027: e.strerror})"},{"line_number":48,"context_line":"        except Exception:"},{"line_number":49,"context_line":"            LOG.error(_LE(\u0027Failed to send email\u0027))"}],"source_content_type":"text/x-python","patch_set":14,"id":"da20952f_5c0bf12b","line":49,"in_reply_to":"da20952f_899dca0b","updated":"2015-09-01 15:17:17.000000000","message":"agree. an exception will help diagnose what\u0027s going wrong.","commit_id":"0025c14ce16995c2845b6848ffe5e4fd33b94d85"}]}
