)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"71412419c625df22eeb3c1b3401158fd02282c5e","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"fix bug: 1067254"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"If argument \u0027instance\u0027 stay in *args not in **kwargs."},{"line_number":12,"context_line":"we will get a KeyError exception which cover the real"},{"line_number":13,"context_line":"exception. So update **kwargs with *args first, then"},{"line_number":14,"context_line":"we can get \u0027instance\u0027 from kwargs easily."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAALH%2F%2FG3g%3D","line":11,"updated":"2012-10-18 15:08:36.000000000","message":"See my suggestion on the comment in compute.py…","commit_id":"6136a7f3afef75b9881f8945a8794ebf7cba37e6"}],"nova/compute/manager.py":[{"author":{"_account_id":1528,"name":"Stanislaw Pitucha","email":"viraptor@gmail.com","username":"stanislaw-pitucha"},"change_message_id":"084e610daf06e478f52a622e816b1016ed92c67f","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            # NOTE(gtt): argument \u0027instance\u0027 maybe in args rather than kwargs."},{"line_number":198,"context_line":"            # So update kwargs with args first, then we can get it from kwargs."},{"line_number":199,"context_line":"            # co_varnames[0] is self, co_varnames[1] is context."},{"line_number":200,"context_line":"            kwargs.update(dict(zip(function.func_code.co_varnames[2:], args)))"},{"line_number":201,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":202,"context_line":"                compute_utils.add_instance_fault_from_exc(context,"},{"line_number":203,"context_line":"                        kwargs[\u0027instance\u0027][\u0027uuid\u0027], e, sys.exc_info())"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FHK4%3D","line":200,"updated":"2012-10-17 16:03:03.000000000","message":"this seems to require a bit of explanation... can it be done more explicitly?\n\n# instance may be in kwargs, or args\ninstance \u003d kwargs.get(\u0027instance\u0027) or dict(zip(function.func_code.co_varnames[2:], args))[\u0027instance\u0027]\n...\n...add_instance_fault_from_exc(...instance[\u0027uuid\u0027]...)\n\nAlso does this mean there can never be a decorator taking *args below \"wrap_instance_fault\"? This could lead to silent breakage...","commit_id":"971b869f8accd2ffb7115e9503795af923b1249a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"71412419c625df22eeb3c1b3401158fd02282c5e","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        except exception.InstanceNotFound:"},{"line_number":195,"context_line":"            raise"},{"line_number":196,"context_line":"        except Exception, e:"},{"line_number":197,"context_line":"            # NOTE(gtt): If argument \u0027instance\u0027 stay in *args not in **kwargs,"},{"line_number":198,"context_line":"            # we will get a KeyError exception which cover the real exception."},{"line_number":199,"context_line":"            # So update **kwargs with *args first, then we can get"},{"line_number":200,"context_line":"            # \u0027instance\u0027 from kwargs easily."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FG3s%3D","line":197,"updated":"2012-10-18 15:08:36.000000000","message":"Little English suggestion: This should probably read, \"If argument \u0027instance\u0027 is in args rather than kwargs, we will get a KeyError exception which will cover up the real exception.  So, we update kwargs with the values from args first; then, we can get \u0027instance\u0027 from kwargs easily.\"","commit_id":"6136a7f3afef75b9881f8945a8794ebf7cba37e6"},{"author":{"_account_id":1678,"name":"Tiantian Gao","email":"gtt116@gmail.com","username":"gtt116"},"change_message_id":"34fbce8e0c43569626264a47d7b2b88dd6f5b425","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        except exception.InstanceNotFound:"},{"line_number":195,"context_line":"            raise"},{"line_number":196,"context_line":"        except Exception, e:"},{"line_number":197,"context_line":"            # NOTE(gtt): If argument \u0027instance\u0027 stay in *args not in **kwargs,"},{"line_number":198,"context_line":"            # we will get a KeyError exception which cover the real exception."},{"line_number":199,"context_line":"            # So update **kwargs with *args first, then we can get"},{"line_number":200,"context_line":"            # \u0027instance\u0027 from kwargs easily."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FGpU%3D","line":197,"in_reply_to":"AAAALH%2F%2FG3s%3D","updated":"2012-10-19 01:41:03.000000000","message":"ok, thanks for your suggestion!","commit_id":"6136a7f3afef75b9881f8945a8794ebf7cba37e6"}],"nova/tests/compute/test_compute.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"cabc019f2085bf77b69c528c50c8f068538b661c","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # NOTE(gtt): test argument \u0027instance\u0027 in args rather than kwargs."},{"line_number":229,"context_line":"        self.assertRaises(NotImplementedError, failer,"},{"line_number":230,"context_line":"                          self.compute, self.context, inst)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        self.assertTrue(called[\u0027fault_added\u0027])"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FHLc%3D","line":230,"updated":"2012-10-17 15:12:26.000000000","message":"I\u0027d rather you break this out and create a second test method covering just the instance-in-args case.  My reasoning is the check on called[\u0027fault_added\u0027]: here you\u0027re essentially setting it twice, but testing it only once.  We want to make sure that called[\u0027fault_added\u0027] gets set in both cases independently.","commit_id":"971b869f8accd2ffb7115e9503795af923b1249a"}]}
