)]}'
{"monasca_notification/types/email_notifier.py":[{"author":{"_account_id":2419,"name":"Roland Hochmuth","email":"roland.hochmuth@hpe.com","username":"roland-hochmuth-s"},"change_message_id":"a6df87fdb93fb22093740b0ffc8d041ded78b8b5","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        except smtplib.SMTPServerDisconnected:"},{"line_number":64,"context_line":"            self._log.warn(\u0027SMTP server disconnected. \u0027"},{"line_number":65,"context_line":"                           \u0027Will reconnect and retry message.\u0027)"},{"line_number":66,"context_line":"            self._smtp_connect()"},{"line_number":67,"context_line":"        except smtplib.SMTPException:"},{"line_number":68,"context_line":"            self._email_error(notification)"},{"line_number":69,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_506e0201","line":66,"updated":"2015-02-19 04:19:55.000000000","message":"So, if you\u0027ve been disconnected you invoke _smtp_connect, but what if _smtp_connect fails. \n\nShould this except block return True or False.\n\nAlso, if _smtp_connect passes, don\u0027t you want to try and send the email?","commit_id":"a17ecfb6037676aa2f4a352ca6af2ce2a690627d"},{"author":{"_account_id":14273,"name":"Joe Keen","email":"joe.keen@hpe.com","username":"jkeen"},"change_message_id":"d6eddab53ad92c60ff4d9b9aff8b111f8daaa7a3","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        except smtplib.SMTPServerDisconnected:"},{"line_number":64,"context_line":"            self._log.warn(\u0027SMTP server disconnected. \u0027"},{"line_number":65,"context_line":"                           \u0027Will reconnect and retry message.\u0027)"},{"line_number":66,"context_line":"            self._smtp_connect()"},{"line_number":67,"context_line":"        except smtplib.SMTPException:"},{"line_number":68,"context_line":"            self._email_error(notification)"},{"line_number":69,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_bda29cab","line":66,"in_reply_to":"da86d52c_506e0201","updated":"2015-02-19 17:13:07.000000000","message":"At this point if _smtp_connect fails we\u0027ll still have a valid _smtp object so we\u0027ll fall through to the self._sendmail down at line 72 which should generate an SMTPException.  Even if it generates an unexpected exception that\u0027s still caught at a higher level and the notification is bounced onto the retry queue.  The real problem here was that an initial failure never caused us to try and reconnect because we were never generating an SMTPServerDisconnected exception.\n\nThe reason this wasn\u0027t an issue before was that the processes would shut down if it wasn\u0027t able to connect to an smtp server when the object was constructed.","commit_id":"a17ecfb6037676aa2f4a352ca6af2ce2a690627d"}],"tests/test_email_notification.py":[{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"91473828ff5d6126a917cd2453a9620cf82fa6c6","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        notification \u003d Notification(\u0027email\u0027, 0, 1, \u0027email notification\u0027, \u0027me@here.com\u0027, 0, alarm_dict)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        email_result \u003d email.send_notification(notification)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        self.assertFalse(email_result)"},{"line_number":224,"context_line":"        self.assertIn(\"Connecting to Email Server {}\""}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_24e5d4db","line":221,"updated":"2015-02-19 00:59:17.000000000","message":"Would it be possible to call this again and have it return True the second time? That would ensure the retry of the connect happens","commit_id":"a17ecfb6037676aa2f4a352ca6af2ce2a690627d"}]}
