)]}'
{"neutron/common/utils.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"4d4deacf52b618a022063481f04d49c24935cc92","unresolved":false,"context_lines":[{"line_number":304,"context_line":"def spawn_except_log_wrapper(is_logging\u003dTrue, logger\u003dNone,"},{"line_number":305,"context_line":"                             exception_result\u003dNone, exception_handler\u003dNone):"},{"line_number":306,"context_line":"    if logger is None:"},{"line_number":307,"context_line":"        LOG \u003d logging.getLogger(__name__)"},{"line_number":308,"context_line":"        logger \u003d LOG.exception"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def decorator(func):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_50a7c90a","line":307,"updated":"2014-07-14 14:13:42.000000000","message":"it\u0027s better to use the logger instance for the module which the wrapped method belongs to, not utils module.\n\ncf. https://review.openstack.org/#/c/106399/","commit_id":"d422b04f538449f2c0ba2a14ed8ae90289411adf"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a68b0ed2c305415e0546a18d42063982c8366143","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        return 1"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"class spawn_except_log_wrapper(object):"},{"line_number":305,"context_line":"    def __init__(self, is_logging\u003dTrue, logger\u003dNone,"},{"line_number":306,"context_line":"                 exception_result\u003dNone, exception_handler\u003dNone):"},{"line_number":307,"context_line":"        self.is_logging \u003d is_logging"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_65324af3","line":304,"range":{"start_line":304,"start_character":6,"end_line":304,"end_character":12},"updated":"2014-07-14 16:19:49.000000000","message":"nothing this class does seems spawn specific.  how about renaming to more generic name?","commit_id":"3e528558a2b9b31eb710637fbd75cd6004f4420d"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c4742f71ad8186df3b552ade741d3080fcc4d027","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        return 1"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"class spawn_except_log_wrapper(object):"},{"line_number":305,"context_line":"    def __init__(self, is_logging\u003dTrue, logger\u003dNone,"},{"line_number":306,"context_line":"                 exception_result\u003dNone, exception_handler\u003dNone):"},{"line_number":307,"context_line":"        self.is_logging \u003d is_logging"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_729d8a09","line":304,"in_reply_to":"baada198_65324af3","updated":"2014-07-15 12:24:06.000000000","message":"+1\n\nSince this will be a public utility, it would be nice to include a docstring with the description and usage spelled out.","commit_id":"3e528558a2b9b31eb710637fbd75cd6004f4420d"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c4742f71ad8186df3b552ade741d3080fcc4d027","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"class spawn_except_log_wrapper(object):"},{"line_number":305,"context_line":"    def __init__(self, is_logging\u003dTrue, logger\u003dNone,"},{"line_number":306,"context_line":"                 exception_result\u003dNone, exception_handler\u003dNone):"},{"line_number":307,"context_line":"        self.is_logging \u003d is_logging"},{"line_number":308,"context_line":"        self.logger \u003d logger"},{"line_number":309,"context_line":"        self.exception_result \u003d exception_result"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_f290baee","line":306,"updated":"2014-07-15 12:24:06.000000000","message":"UTs with the exeception_result and exception_handler used?","commit_id":"3e528558a2b9b31eb710637fbd75cd6004f4420d"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a661c2e6a4a9282892973fdb286c788c1783e617","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        return 1"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"class exception_logger(object):"},{"line_number":305,"context_line":"    def __init__(self, is_logging\u003dTrue, logger\u003dNone,"},{"line_number":306,"context_line":"                 exception_result\u003dNone, exception_handler\u003dNone):"},{"line_number":307,"context_line":"        self.is_logging \u003d is_logging"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_60f01b92","line":304,"updated":"2014-07-16 15:12:14.000000000","message":"i agree Paul about docs.","commit_id":"08b152de883c30d96c9cf3133d30f295a298ba30"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0c6ec5d6a0dc4da2b31a2b3a9088bf84c90575f0","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                    # re-raise the exception, affects nothing when called by"},{"line_number":342,"context_line":"                    # spawn(_n), the exception will be simply discarded."},{"line_number":343,"context_line":"                    # keep the same behavior if doesn\u0027t call by spawn(_n)"},{"line_number":344,"context_line":"                    raise"},{"line_number":345,"context_line":"        return call"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b8b46af1","line":344,"updated":"2014-07-22 04:17:56.000000000","message":"Please use save_and_reraise_exception from excutils.\nLogging may trigger eventlet context switch.","commit_id":"6fe5b3c12ea8d4188b4e2f0d4e379514bb8909c3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"92d04a13342f9b0ec99eb7a4fbbc3d40197ca0bc","unresolved":false,"context_lines":[{"line_number":314,"context_line":"class exception_logger(object):"},{"line_number":315,"context_line":"    \"\"\"Wrap a function and log raised exception"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    :param is_logging: whether log the exception"},{"line_number":318,"context_line":"    :param logger: the logger to log the exception default is LOG.exception"},{"line_number":319,"context_line":"    :param exception_result: override the return value if any exception has"},{"line_number":320,"context_line":"                             been catched"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_7b16f04a","line":317,"updated":"2014-07-23 10:36:05.000000000","message":"I thought the purpose of this class were to log the exception? Why is this optional?\nSince you are using excutils.save_and_reraise_exception , it will log the original exception anyway if a second one is thrown. So I think it\u0027s better to remove this boolean.","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"},{"author":{"_account_id":7170,"name":"Zang MingJie","email":"zealot0630@gmail.com","username":"zealot"},"change_message_id":"e30a36f5d660270bea9e5d6a173e76cfe64fe9a5","unresolved":false,"context_lines":[{"line_number":314,"context_line":"class exception_logger(object):"},{"line_number":315,"context_line":"    \"\"\"Wrap a function and log raised exception"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    :param is_logging: whether log the exception"},{"line_number":318,"context_line":"    :param logger: the logger to log the exception default is LOG.exception"},{"line_number":319,"context_line":"    :param exception_result: override the return value if any exception has"},{"line_number":320,"context_line":"                             been catched"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_e410715b","line":317,"in_reply_to":"baada198_7b16f04a","updated":"2014-07-24 13:21:33.000000000","message":"Done","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"92d04a13342f9b0ec99eb7a4fbbc3d40197ca0bc","unresolved":false,"context_lines":[{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    :param is_logging: whether log the exception"},{"line_number":318,"context_line":"    :param logger: the logger to log the exception default is LOG.exception"},{"line_number":319,"context_line":"    :param exception_result: override the return value if any exception has"},{"line_number":320,"context_line":"                             been catched"},{"line_number":321,"context_line":"    :param exception_handler: the function to handle the exception"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_1be5f409","line":319,"updated":"2014-07-23 10:36:05.000000000","message":"what\u0027s the use case you imagined when you decided to add exception_result and exception_handler? I think it\u0027s confusing to pass those as parameters, this would make the code harder to debug since they modify the code path. An exception is thrown, is logged but then the result is overwritten in this function. In the original function there\u0027s no \"except block\" but just the decorator with a parameter...it\u0027s not so straightforward","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"},{"author":{"_account_id":7170,"name":"Zang MingJie","email":"zealot0630@gmail.com","username":"zealot"},"change_message_id":"e30a36f5d660270bea9e5d6a173e76cfe64fe9a5","unresolved":false,"context_lines":[{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    :param is_logging: whether log the exception"},{"line_number":318,"context_line":"    :param logger: the logger to log the exception default is LOG.exception"},{"line_number":319,"context_line":"    :param exception_result: override the return value if any exception has"},{"line_number":320,"context_line":"                             been catched"},{"line_number":321,"context_line":"    :param exception_handler: the function to handle the exception"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_c419ad88","line":319,"in_reply_to":"baada198_1be5f409","updated":"2014-07-24 13:21:33.000000000","message":"Done","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"92d04a13342f9b0ec99eb7a4fbbc3d40197ca0bc","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            except Exception as e:"},{"line_number":344,"context_line":"                # explicit reraise for clarify, the exception will be raised if"},{"line_number":345,"context_line":"                # not handled"},{"line_number":346,"context_line":"                with excutils.save_and_reraise_exception(reraise\u003dTrue) as ctxt:"},{"line_number":347,"context_line":"                    if self.is_logging:"},{"line_number":348,"context_line":"                        self.logger(e)"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_809353ff","line":346,"updated":"2014-07-23 10:36:05.000000000","message":"Is there an extra benefit using this new class exception_logger, instead of using excutils.save_and_reraise_exception directly in a function under an \"except\" block?\nIt seems to me that it\u0027s equivalent","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"},{"author":{"_account_id":7170,"name":"Zang MingJie","email":"zealot0630@gmail.com","username":"zealot"},"change_message_id":"e30a36f5d660270bea9e5d6a173e76cfe64fe9a5","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            except Exception as e:"},{"line_number":344,"context_line":"                # explicit reraise for clarify, the exception will be raised if"},{"line_number":345,"context_line":"                # not handled"},{"line_number":346,"context_line":"                with excutils.save_and_reraise_exception(reraise\u003dTrue) as ctxt:"},{"line_number":347,"context_line":"                    if self.is_logging:"},{"line_number":348,"context_line":"                        self.logger(e)"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_ff21da9e","line":346,"in_reply_to":"baada198_809353ff","updated":"2014-07-24 13:21:33.000000000","message":"It helps the function focusing on logic instead of dealing with exceptions","commit_id":"5a2e2648dfb23f53f912b0f1ef19f44d48fa2aa2"}],"neutron/tests/unit/test_common_utils.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"da9f99642f763d8473b93bdcf70b4b54cf53b5b9","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        result \u003d \"Result\""},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        def result(e):"},{"line_number":419,"context_line":"            return result"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        @utils.exception_logger(exception_handler\u003dresult)"},{"line_number":422,"context_line":"        def func():"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_07d94bf4","line":419,"updated":"2014-07-16 07:54:56.000000000","message":"this means a function which returns itself.\ni guess it isn\u0027t what you meant.","commit_id":"33be80607310265d5434e51a7ff360b0c4292211"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"51d4f898a04455f67fa0f29a2915950dbebaf35e","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        result \u003d \"Result\""},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"        def result(e):"},{"line_number":419,"context_line":"            return result"},{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        @utils.exception_logger(exception_handler\u003dresult)"},{"line_number":422,"context_line":"        def func():"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_14ba506e","line":419,"updated":"2014-07-16 10:07:58.000000000","message":"same as the previous patch set.","commit_id":"5562e340efdccb35dac301732e9c99ff420dd9eb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a661c2e6a4a9282892973fdb286c788c1783e617","unresolved":false,"context_lines":[{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        @utils.exception_logger(exception_result\u003dresult)"},{"line_number":410,"context_line":"        def func():"},{"line_number":411,"context_line":"            raise RuntimeError(result)"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"        self.assertEqual(result, func())"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_207aa325","line":411,"range":{"start_line":411,"start_character":31,"end_line":411,"end_character":37},"updated":"2014-07-16 15:12:14.000000000","message":"it\u0027s better to use a different value","commit_id":"08b152de883c30d96c9cf3133d30f295a298ba30"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a661c2e6a4a9282892973fdb286c788c1783e617","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        @utils.exception_logger(exception_handler\u003dexception_handler)"},{"line_number":422,"context_line":"        def func():"},{"line_number":423,"context_line":"            raise RuntimeError(result)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"        self.assertEqual(result, func())"},{"line_number":426,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_a08dd32c","line":423,"range":{"start_line":423,"start_character":31,"end_line":423,"end_character":37},"updated":"2014-07-16 15:12:14.000000000","message":"ditto","commit_id":"08b152de883c30d96c9cf3133d30f295a298ba30"}]}
