)]}'
{"nova/api/openstack/wsgi.py":[{"author":{"_account_id":34,"name":"Todd Willey","email":"todd@ansolabs.com","username":"xtoddx"},"change_message_id":"1271decfd95217927db104cb41d381e9822876fe","unresolved":false,"context_lines":[{"line_number":573,"context_line":"            LOG.info(_(\"HTTP exception thrown: %s\"), unicode(ex))"},{"line_number":574,"context_line":"            action_result \u003d Fault(ex)"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"        if isinstance(action_result, dict) or action_result is None:"},{"line_number":577,"context_line":"            response \u003d self.serializer.serialize(request,"},{"line_number":578,"context_line":"                                                 action_result,"},{"line_number":579,"context_line":"                                                 accept,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FGA%3D","line":576,"updated":"2012-01-02 20:43:48.000000000","message":"I assume the explicit check for None is preferred over\nisinstance(action_result, (dict, types.NoneType)) ?","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"3008bb12c1eb1ecbe4de26dc722b78a99b2bea32","unresolved":false,"context_lines":[{"line_number":573,"context_line":"            LOG.info(_(\"HTTP exception thrown: %s\"), unicode(ex))"},{"line_number":574,"context_line":"            action_result \u003d Fault(ex)"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"        if isinstance(action_result, dict) or action_result is None:"},{"line_number":577,"context_line":"            response \u003d self.serializer.serialize(request,"},{"line_number":578,"context_line":"                                                 action_result,"},{"line_number":579,"context_line":"                                                 accept,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FEw%3D","line":576,"in_reply_to":"AAAADH%2F%2F%2FGA%3D","updated":"2012-01-03 00:05:19.000000000","message":"I think the types module shouldn\u0027t be imported anywhere in the code.\n\nAnd yes I think it is more clearer checking explicitly for None.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"}],"nova/rpc/impl_carrot.py":[{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"1e302aa8f8ab771ae1636daed6a72284b5a6d47c","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        try:"},{"line_number":285,"context_line":"            rval \u003d node_func(context\u003dctxt, **node_args)"},{"line_number":286,"context_line":"            # Check if the result was a generator"},{"line_number":287,"context_line":"            if inspect.isgenerator(rval):"},{"line_number":288,"context_line":"                for x in rval:"},{"line_number":289,"context_line":"                    ctxt.reply(x, None)"},{"line_number":290,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FGc%3D","line":287,"updated":"2012-01-02 15:54:57.000000000","message":"used inspect module since there are no built-in factory functions for generators.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"3008bb12c1eb1ecbe4de26dc722b78a99b2bea32","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        try:"},{"line_number":285,"context_line":"            rval \u003d node_func(context\u003dctxt, **node_args)"},{"line_number":286,"context_line":"            # Check if the result was a generator"},{"line_number":287,"context_line":"            if inspect.isgenerator(rval):"},{"line_number":288,"context_line":"                for x in rval:"},{"line_number":289,"context_line":"                    ctxt.reply(x, None)"},{"line_number":290,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FE0%3D","line":287,"in_reply_to":"AAAADH%2F%2F%2FF8%3D","updated":"2012-01-03 00:05:19.000000000","message":"If you look at the source code of inspect.py it does exactly what the original code is doing.\n\nIn my defense, I didn\u0027t want the types module to be imported anywhere in the code since it opens possibilities for direct type comparsion.\n\nAlso this is a more elegant way to do it, I think.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":34,"name":"Todd Willey","email":"todd@ansolabs.com","username":"xtoddx"},"change_message_id":"1271decfd95217927db104cb41d381e9822876fe","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        try:"},{"line_number":285,"context_line":"            rval \u003d node_func(context\u003dctxt, **node_args)"},{"line_number":286,"context_line":"            # Check if the result was a generator"},{"line_number":287,"context_line":"            if inspect.isgenerator(rval):"},{"line_number":288,"context_line":"                for x in rval:"},{"line_number":289,"context_line":"                    ctxt.reply(x, None)"},{"line_number":290,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FF8%3D","line":287,"in_reply_to":"AAAADH%2F%2F%2FGc%3D","updated":"2012-01-02 20:43:48.000000000","message":"Do we know that we want to use isgenerator instead of isgeneratorfunction?","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"e25f48b0ab552b48beb74d63ec3fc69f34e950e2","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        try:"},{"line_number":285,"context_line":"            rval \u003d node_func(context\u003dctxt, **node_args)"},{"line_number":286,"context_line":"            # Check if the result was a generator"},{"line_number":287,"context_line":"            if inspect.isgenerator(rval):"},{"line_number":288,"context_line":"                for x in rval:"},{"line_number":289,"context_line":"                    ctxt.reply(x, None)"},{"line_number":290,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAADH%2F%2F%2FDY%3D","line":287,"updated":"2012-01-03 03:29:54.000000000","message":"def isgenerator(object):\n    \"\"\"Return true if the object is a generator.\n\n    Generator objects provide these attributes:\n        __iter__        defined to support interation over container\n        close           raises a new GeneratorExit exception inside the\n                        generator to terminate the iteration\n        gi_code         code object\n        gi_frame        frame object or possibly None once the generator has\n                        been exhausted\n        gi_running      set to 1 when generator is executing, 0 otherwise\n        next            return the next item from the container\n        send            resumes the generator and \"sends\" a value that becomes\n                        the result of the current yield-expression\n        throw           used to raise an exception inside the generator\"\"\"\n    return isinstance(object, types.GeneratorType)","commit_id":"ae1654bc5910dba5f02f49bc57a49442b9a5f8d6"}],"nova/scheduler/api.py":[{"author":{"_account_id":34,"name":"Todd Willey","email":"todd@ansolabs.com","username":"xtoddx"},"change_message_id":"1271decfd95217927db104cb41d381e9822876fe","unresolved":false,"context_lines":[{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                return collection_method(*args, **kwargs)"},{"line_number":141,"context_line":"            except Exception as e:"},{"line_number":142,"context_line":"                if any([isinstance(e, x) for x in errors_to_ignore]):"},{"line_number":143,"context_line":"                    return None"},{"line_number":144,"context_line":"                raise"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FF4%3D","line":142,"updated":"2012-01-02 20:43:48.000000000","message":"We\u0027re sure there isn\u0027t a time we want to raise on a particular subclass, while ignoring a generic higher-level exception class?  I feel like being specific here would be better, but I don\u0027t know how call_zone_method is invoked.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"3008bb12c1eb1ecbe4de26dc722b78a99b2bea32","unresolved":false,"context_lines":[{"line_number":139,"context_line":"            try:"},{"line_number":140,"context_line":"                return collection_method(*args, **kwargs)"},{"line_number":141,"context_line":"            except Exception as e:"},{"line_number":142,"context_line":"                if any([isinstance(e, x) for x in errors_to_ignore]):"},{"line_number":143,"context_line":"                    return None"},{"line_number":144,"context_line":"                raise"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FEs%3D","line":142,"in_reply_to":"AAAADH%2F%2F%2FF4%3D","updated":"2012-01-03 00:05:19.000000000","message":"It isn\u0027t now but I guess this adds potential harm to the code.\n\nI\u0027ll remove this part.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"}],"nova/tests/fake_utils.py":[{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"1e302aa8f8ab771ae1636daed6a72284b5a6d47c","unresolved":false,"context_lines":[{"line_number":17,"context_line":"\"\"\"This modules stubs out functions in nova.utils.\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import re"},{"line_number":20,"context_line":"import types"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from eventlet import greenthread"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FGY%3D","side":"PARENT","line":20,"updated":"2012-01-02 15:54:57.000000000","message":"not used here","commit_id":"ea21fe69655ae441eb9660e0579046355f6db4c1"}],"nova/utils.py":[{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"1e302aa8f8ab771ae1636daed6a72284b5a6d47c","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        ignore_exit_code \u003d not check_exit_code"},{"line_number":180,"context_line":"        check_exit_code \u003d [0]"},{"line_number":181,"context_line":"    elif isinstance(check_exit_code, int):"},{"line_number":182,"context_line":"        check_exit_code \u003d [check_exit_code]"},{"line_number":183,"context_line":"    delay_on_retry \u003d kwargs.pop(\u0027delay_on_retry\u0027, True)"},{"line_number":184,"context_line":"    attempts \u003d kwargs.pop(\u0027attempts\u0027, 1)"},{"line_number":185,"context_line":"    run_as_root \u003d kwargs.pop(\u0027run_as_root\u0027, False)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FGU%3D","line":182,"updated":"2012-01-02 15:54:57.000000000","message":"This is something you should be careful.\n\nIf you check int first, it will never get to bool because bool is extended from int.\n\nAll the other types for comparison had no inheritance, except str, unicode, and basestring which is pretty much clear.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":34,"name":"Todd Willey","email":"todd@ansolabs.com","username":"xtoddx"},"change_message_id":"1271decfd95217927db104cb41d381e9822876fe","unresolved":false,"context_lines":[{"line_number":695,"context_line":"    # The try block may not be necessary after the class check above,"},{"line_number":696,"context_line":"    # but just in case ..."},{"line_number":697,"context_line":"    try:"},{"line_number":698,"context_line":"        if isinstance(value, list) or isinstance(value, tuple):"},{"line_number":699,"context_line":"            o \u003d []"},{"line_number":700,"context_line":"            for v in value:"},{"line_number":701,"context_line":"                o.append(to_primitive(v, convert_instances\u003dconvert_instances,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FF0%3D","line":698,"updated":"2012-01-02 20:43:48.000000000","message":"Can use a list as the second argument of isinstance so that you get isinstance(value, (list, tuple))","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"3008bb12c1eb1ecbe4de26dc722b78a99b2bea32","unresolved":false,"context_lines":[{"line_number":695,"context_line":"    # The try block may not be necessary after the class check above,"},{"line_number":696,"context_line":"    # but just in case ..."},{"line_number":697,"context_line":"    try:"},{"line_number":698,"context_line":"        if isinstance(value, list) or isinstance(value, tuple):"},{"line_number":699,"context_line":"            o \u003d []"},{"line_number":700,"context_line":"            for v in value:"},{"line_number":701,"context_line":"                o.append(to_primitive(v, convert_instances\u003dconvert_instances,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAADH%2F%2F%2FE4%3D","line":698,"in_reply_to":"AAAADH%2F%2F%2FF0%3D","updated":"2012-01-03 00:05:19.000000000","message":"That\u0027s right, this I ought to change.","commit_id":"c7e46859791b74ec48ba98e5c90f16b4386a01b6"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"e25f48b0ab552b48beb74d63ec3fc69f34e950e2","unresolved":false,"context_lines":[{"line_number":695,"context_line":"    # The try block may not be necessary after the class check above,"},{"line_number":696,"context_line":"    # but just in case ..."},{"line_number":697,"context_line":"    try:"},{"line_number":698,"context_line":"        if isinstance(value, (list, tuple)):"},{"line_number":699,"context_line":"            o \u003d []"},{"line_number":700,"context_line":"            for v in value:"},{"line_number":701,"context_line":"                o.append(to_primitive(v, convert_instances\u003dconvert_instances,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAADH%2F%2F%2FDU%3D","line":698,"updated":"2012-01-03 03:29:54.000000000","message":"Thank you Todd.","commit_id":"ae1654bc5910dba5f02f49bc57a49442b9a5f8d6"}]}
