)]}'
{"oslo/messaging/notify/log_handler.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"8cce5aabe247e3cf87a3973f6c1480b670e4cd50","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":22,"context_line":"    def emit(self, record):"},{"line_number":23,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":24,"context_line":"            return"},{"line_number":25,"context_line":"        transport \u003d messaging.get_transport(CONF)"},{"line_number":26,"context_line":"        _notifier \u003d messaging.Notifier(transport,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2BlGs%3D","line":23,"updated":"2014-02-20 12:01:27.000000000","message":"this could use a comment, or even document this behavior in a docstr","commit_id":"a5627a7d82dc5b9231ee5dc811770b909e7af336"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"0e79fb7292998c695b31fc5e6ba1c2472d9a689e","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":22,"context_line":"    def emit(self, record):"},{"line_number":23,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":24,"context_line":"            return"},{"line_number":25,"context_line":"        transport \u003d messaging.get_transport(CONF)"},{"line_number":26,"context_line":"        _notifier \u003d messaging.Notifier(transport,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2BipE%3D","line":23,"in_reply_to":"AAAAUX%2F%2BiuA%3D","updated":"2014-02-20 16:18:45.000000000","message":"bnemec answered my question in -dev. Comment included in the next patch set.","commit_id":"a5627a7d82dc5b9231ee5dc811770b909e7af336"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fff96711acabfdee8ef7b426cfe739887387469d","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":22,"context_line":"    def emit(self, record):"},{"line_number":23,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":24,"context_line":"            return"},{"line_number":25,"context_line":"        transport \u003d messaging.get_transport(CONF)"},{"line_number":26,"context_line":"        _notifier \u003d messaging.Notifier(transport,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2BiuA%3D","line":23,"in_reply_to":"AAAAUX%2F%2BlGs%3D","updated":"2014-02-20 16:12:20.000000000","message":"I agree, I did some digging to see if I could find the exact purpose for this in a previous commit/review but didn\u0027t find anything that stuck out. https://review.openstack.org/#/c/8585/\n\nOne of the Oslo guys probably have a better idea. I believe dims was the one who pulled this out the of log.py code, but afaict this behavior was established when log.py was introduced to oslo-incubator, which at the time was pretty much Nova\u0027s logging code.","commit_id":"a5627a7d82dc5b9231ee5dc811770b909e7af336"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"5cd00d32324a40f68756447658ca8c1b4458d1c5","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":20,"context_line":"    def emit(self, record):"},{"line_number":21,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":22,"context_line":"            # NOTE(lbragstad): If we detect that log is one of the"},{"line_number":23,"context_line":"            # notification drivers, then return. This protects from infinite"},{"line_number":24,"context_line":"            # recursion where something bad happens, it gets logged, the log"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BfkU%3D","line":21,"updated":"2014-02-20 21:37:20.000000000","message":"Accessing a config option from a module where it isn\u0027t defined and registered introduces an import order dependency. We need to either pass a notification driver explicitly to the handler when it is created, or use import_opt() to ensure that the option is registered before using it here.","commit_id":"a145ed11f8d18cdbaf77706278dbd548b4deb4e5"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"91b031a3f4bbcf0f5078a5edd48355faa69aa294","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":20,"context_line":"    def emit(self, record):"},{"line_number":21,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":22,"context_line":"            # NOTE(lbragstad): If we detect that log is one of the"},{"line_number":23,"context_line":"            # notification drivers, then return. This protects from infinite"},{"line_number":24,"context_line":"            # recursion where something bad happens, it gets logged, the log"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BUp4%3D","line":21,"in_reply_to":"AAAAUX%2F%2BUus%3D","updated":"2014-02-21 21:38:38.000000000","message":"Yeah, I think that doesn\u0027t work because notifier doesn\u0027t actually register the options at import time.  There\u0027s probably some way to do it, but I think it would require referencing the private Opts list in that module and I don\u0027t know that we want to do that.\n\nMy fix isn\u0027t ideal either because it means we create the Notifier every time regardless of whether we\u0027re sending a notification, so I\u0027m open to other options.\n\nHmm, come to think of it, we\u0027re creating the Notifier the exact same way on every call to this function.  We should just do that in the constructor for this class and use it here.  Let me push a new patch set with that behavior.","commit_id":"a145ed11f8d18cdbaf77706278dbd548b4deb4e5"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7a9a283fe7908e68877c0ab9cea9c3e863cde5d7","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":20,"context_line":"    def emit(self, record):"},{"line_number":21,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":22,"context_line":"            # NOTE(lbragstad): If we detect that log is one of the"},{"line_number":23,"context_line":"            # notification drivers, then return. This protects from infinite"},{"line_number":24,"context_line":"            # recursion where something bad happens, it gets logged, the log"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BUus%3D","line":21,"in_reply_to":"AAAAUX%2F%2BVOY%3D","updated":"2014-02-21 21:26:49.000000000","message":"Thanks Ben I was trying to fix with the import_opt way but my tests were failing when I was doing: \n\n    cfg.CONF.import_opt(\u0027notification_driver\u0027,\n                    \u0027oslo.messaging.notify.notifier\u0027)\n\n\nresulting in http://paste.openstack.org/show/68136/ when I ran the tests","commit_id":"a145ed11f8d18cdbaf77706278dbd548b4deb4e5"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"2053df7fd04584d624d310c57a193d6bdb8d4eb3","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class PublishErrorsHandler(logging.Handler):"},{"line_number":20,"context_line":"    def emit(self, record):"},{"line_number":21,"context_line":"        if (\u0027log\u0027 in cfg.CONF.notification_driver):"},{"line_number":22,"context_line":"            # NOTE(lbragstad): If we detect that log is one of the"},{"line_number":23,"context_line":"            # notification drivers, then return. This protects from infinite"},{"line_number":24,"context_line":"            # recursion where something bad happens, it gets logged, the log"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUX%2F%2BVOY%3D","line":21,"in_reply_to":"AAAAUX%2F%2BfkU%3D","updated":"2014-02-21 20:13:49.000000000","message":"Ah, good point.  I\u0027ll push a fix for that problem.","commit_id":"a145ed11f8d18cdbaf77706278dbd548b4deb4e5"}],"tests/test_log_handler.py":[{"author":{"_account_id":4,"name":"Dolph Mathews","email":"dolph.mathews@gmail.com","username":"dolph"},"change_message_id":"8cce5aabe247e3cf87a3973f6c1480b670e4cd50","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.stubs.Set(notifier, \u0027error\u0027, fake_notifier)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        logrecord \u003d logging.LogRecord(\u0027name\u0027, \u0027WARN\u0027, \u0027/tmp\u0027, 1,"},{"line_number":44,"context_line":"                                      \u0027Message\u0027, None, None)"},{"line_number":45,"context_line":"        self.publisherrorshandler.emit(logrecord)"},{"line_number":46,"context_line":"        self.assertTrue(self.stub_flg)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2BlFQ%3D","line":44,"updated":"2014-02-20 12:01:27.000000000","message":"kwargs would be nice to have for the fourth argument (1), onward","commit_id":"a5627a7d82dc5b9231ee5dc811770b909e7af336"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"fff96711acabfdee8ef7b426cfe739887387469d","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.stubs.Set(notifier, \u0027error\u0027, fake_notifier)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        logrecord \u003d logging.LogRecord(\u0027name\u0027, \u0027WARN\u0027, \u0027/tmp\u0027, 1,"},{"line_number":44,"context_line":"                                      \u0027Message\u0027, None, None)"},{"line_number":45,"context_line":"        self.publisherrorshandler.emit(logrecord)"},{"line_number":46,"context_line":"        self.assertTrue(self.stub_flg)"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUX%2F%2Bi4I%3D","line":44,"in_reply_to":"AAAAUX%2F%2BlFQ%3D","updated":"2014-02-20 16:12:20.000000000","message":"added kwargs for all arguments for clarity. Done in next patch set. Thanks!","commit_id":"a5627a7d82dc5b9231ee5dc811770b909e7af336"}]}
