)]}'
{"nova/compute/api.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"3d2f81afe6bc7cb35ab2bf7d56daea62999304b2","unresolved":false,"context_lines":[{"line_number":2647,"context_line":"                overs \u003d exc.kwargs[\u0027overs\u0027]"},{"line_number":2648,"context_line":"                usages \u003d exc.kwargs[\u0027usages\u0027]"},{"line_number":2649,"context_line":"                headroom \u003d self._get_headroom(quotas, usages, deltas)"},{"line_number":2650,"context_line":"                reqs \u003d []"},{"line_number":2651,"context_line":"                useds \u003d []"},{"line_number":2652,"context_line":"                total_alloweds \u003d []"},{"line_number":2653,"context_line":"                resources \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_47b5837b","line":2650,"updated":"2015-08-21 02:00:39.000000000","message":"seems there are codes duplicated with line 435, can we make a private function such as _get_over_quota_detail(overs, headroom)\nto reduce codes?","commit_id":"600a22c9cace9625ed3896cd511a7d7844f14db9"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"bdf386eda4caba784ab36ea138b2fa6442475be8","unresolved":false,"context_lines":[{"line_number":2647,"context_line":"                overs \u003d exc.kwargs[\u0027overs\u0027]"},{"line_number":2648,"context_line":"                usages \u003d exc.kwargs[\u0027usages\u0027]"},{"line_number":2649,"context_line":"                headroom \u003d self._get_headroom(quotas, usages, deltas)"},{"line_number":2650,"context_line":"                reqs \u003d []"},{"line_number":2651,"context_line":"                useds \u003d []"},{"line_number":2652,"context_line":"                total_alloweds \u003d []"},{"line_number":2653,"context_line":"                resources \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_208875c4","line":2650,"in_reply_to":"fa1b9901_47b5837b","updated":"2015-08-21 03:33:21.000000000","message":"Done","commit_id":"600a22c9cace9625ed3896cd511a7d7844f14db9"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"56db81a3a6afddb9402fa1417d0274277aa6919b","unresolved":false,"context_lines":[{"line_number":466,"context_line":"            reqs.append(str(requested[resource]))"},{"line_number":467,"context_line":"            useds.append(str(quotas[resource] - headroom[resource]))"},{"line_number":468,"context_line":"            total_alloweds.append(str(quotas[resource]))"},{"line_number":469,"context_line":"            resources.append(resource)"},{"line_number":470,"context_line":"        (overs, reqs, useds, total_alloweds, resources) \u003d map(\u0027,\u0027.join, ("},{"line_number":471,"context_line":"            overs, reqs, useds, total_alloweds, resources))"},{"line_number":472,"context_line":"        return overs, reqs, resources, total_alloweds, useds"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_28d2fcd2","line":469,"updated":"2015-08-28 15:48:43.000000000","message":"resources and overs will always be the same thing in this code; I advise dropping it entirely and just using the final value of overs.","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"63011ddeb50e95cb2c9da6e720a87b6a01b226fd","unresolved":false,"context_lines":[{"line_number":466,"context_line":"            reqs.append(str(requested[resource]))"},{"line_number":467,"context_line":"            useds.append(str(quotas[resource] - headroom[resource]))"},{"line_number":468,"context_line":"            total_alloweds.append(str(quotas[resource]))"},{"line_number":469,"context_line":"            resources.append(resource)"},{"line_number":470,"context_line":"        (overs, reqs, useds, total_alloweds, resources) \u003d map(\u0027,\u0027.join, ("},{"line_number":471,"context_line":"            overs, reqs, useds, total_alloweds, resources))"},{"line_number":472,"context_line":"        return overs, reqs, resources, total_alloweds, useds"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_0cea91db","line":469,"in_reply_to":"da20952f_28d2fcd2","updated":"2015-08-29 08:43:03.000000000","message":"Done","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"56db81a3a6afddb9402fa1417d0274277aa6919b","unresolved":false,"context_lines":[{"line_number":468,"context_line":"            total_alloweds.append(str(quotas[resource]))"},{"line_number":469,"context_line":"            resources.append(resource)"},{"line_number":470,"context_line":"        (overs, reqs, useds, total_alloweds, resources) \u003d map(\u0027,\u0027.join, ("},{"line_number":471,"context_line":"            overs, reqs, useds, total_alloweds, resources))"},{"line_number":472,"context_line":"        return overs, reqs, resources, total_alloweds, useds"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def _check_metadata_properties_quota(self, context, metadata\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_0337dbe3","line":471,"updated":"2015-08-28 15:48:43.000000000","message":"This is a clever use of map.  My English-pedantic mind would like the join to be on \u0027, \u0027 (space after the comma), but what\u0027s actually going on here is we\u0027re shoehorning a list of things into an error string that\u0027s really only intended to report one thing.  Given that, this is probably an acceptable compromise.\n\nOn the other hand, given that this file contains both existing \u0027raise\u0027s of this exception outside of the test suite, you may want to consider rewriting the message instead; but I don\u0027t really have a good idea of what such a rewrite should look like.","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"63011ddeb50e95cb2c9da6e720a87b6a01b226fd","unresolved":false,"context_lines":[{"line_number":468,"context_line":"            total_alloweds.append(str(quotas[resource]))"},{"line_number":469,"context_line":"            resources.append(resource)"},{"line_number":470,"context_line":"        (overs, reqs, useds, total_alloweds, resources) \u003d map(\u0027,\u0027.join, ("},{"line_number":471,"context_line":"            overs, reqs, useds, total_alloweds, resources))"},{"line_number":472,"context_line":"        return overs, reqs, resources, total_alloweds, useds"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def _check_metadata_properties_quota(self, context, metadata\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_2c267515","line":471,"in_reply_to":"da20952f_0337dbe3","updated":"2015-08-29 08:43:03.000000000","message":"Yes, I update the existing test cases to suit the new format exception, and add 2 new test cases to cover the multiple type quota overflow scenario.","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"528e2506b9b748d9c512e4968e9b7da92d105268","unresolved":false,"context_lines":[{"line_number":468,"context_line":"            total_alloweds.append(str(quotas[resource]))"},{"line_number":469,"context_line":"            resources.append(resource)"},{"line_number":470,"context_line":"        (overs, reqs, useds, total_alloweds, resources) \u003d map(\u0027,\u0027.join, ("},{"line_number":471,"context_line":"            overs, reqs, useds, total_alloweds, resources))"},{"line_number":472,"context_line":"        return overs, reqs, resources, total_alloweds, useds"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def _check_metadata_properties_quota(self, context, metadata\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_e48e1f2d","line":471,"in_reply_to":"da20952f_2c267515","updated":"2015-08-31 16:29:29.000000000","message":"It\u0027s possible I wasn\u0027t clear in what I was suggesting.  I was suggesting that the message template in exception.py could be rewritten…if that\u0027s what you understood me to have written, though, that\u0027s fine :)","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"}],"nova/tests/unit/api/openstack/fakes.py":[{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"81f4a623b2d795abe663b6c551b2283068d72fe6","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            usages \u003d dict(instances\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":172,"context_line":"                          cores\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa1b9901_8e75e464","line":174,"updated":"2015-08-21 09:43:55.000000000","message":"Why do we need it?","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"528e2506b9b748d9c512e4968e9b7da92d105268","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            usages \u003d dict(instances\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":172,"context_line":"                          cores\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_a45ca77d","line":174,"in_reply_to":"da20952f_8cd2215b","updated":"2015-08-31 16:29:29.000000000","message":"Ah, now I see; yes, this OK, but it may be helpful to know the background here: when I wrote this test, I was looking to split between the quota and the reserved; the specific numbers didn\u0027t matter, so I just multiplied by a scaling factor.  However, I still have to point out that, in Python 2.7, the type of \"x * 9 / 10\" is an integer, while in Python 3, the type of \"x * 9 / 10\" is float, regardless of the fact that all the operands are integers.  Here you may want to use the integer division operator, \"//\", which will always return an integer.","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6dfcc3debf2b890f6d35ab5e6e9da03ecd080cc0","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            usages \u003d dict(instances\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":172,"context_line":"                          cores\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_cfc8b8aa","line":174,"in_reply_to":"da20952f_a45ca77d","updated":"2015-09-01 06:29:14.000000000","message":"Thank you for clarification. I will follow your suggestion to use \"//\" instead of \"/\" in next patch.\n\n:)","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"63011ddeb50e95cb2c9da6e720a87b6a01b226fd","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            usages \u003d dict(instances\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":172,"context_line":"                          cores\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_8cd2215b","line":174,"in_reply_to":"da20952f_e36987bf","updated":"2015-08-29 08:43:03.000000000","message":"Because I convert the quota output from int to string in _get_over_quota_detail(), in order to avoid some output like: 10.0 and 1.0 cause the following test cases failed, \u0027test_create_instance_above_quota_instances\u0027, \u0027test_create_instance_above_quota_ram\u0027, \u0027test_create_instance_above_quota_cores\u0027, the exception output is asserted to expected string exactly in these test cases.\n\nAnd I think the quota couldn\u0027t be a float value, it\u0027s only happen in test case, so I do this trick to workaround it.\n\nhttps://review.openstack.org/#/c/197460/5/nova/compute/api.py  Line#467","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"56db81a3a6afddb9402fa1417d0274277aa6919b","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            usages \u003d dict(instances\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":172,"context_line":"                          cores\u003ddict(in_use\u003d0, reserved\u003d0),"},{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_e36987bf","line":174,"in_reply_to":"fa1b9901_8e75e464","updated":"2015-08-28 15:48:43.000000000","message":"Yeah, this change is a no-op and is going to lead to a difference in behavior in Python2 vs. Python 3.  I specifically intended for this to be a float value…","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"528e2506b9b748d9c512e4968e9b7da92d105268","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"},{"line_number":178,"context_line":"                                usages\u003dusages)"},{"line_number":179,"context_line":"    stubs.Set(QUOTAS, \u0027reserve\u0027, fake_reserve)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_c4cafb1a","line":176,"updated":"2015-08-31 16:29:29.000000000","message":"You can eliminate the multiply by 1 here, e.g.:\n\n    usages[resource][\u0027reserved\u0027] \u003d quotas[resource] / 10","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6dfcc3debf2b890f6d35ab5e6e9da03ecd080cc0","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                          ram\u003ddict(in_use\u003d0, reserved\u003d0))"},{"line_number":174,"context_line":"            usages[resource][\u0027in_use\u0027] \u003d (quotas[resource] * 9 / 10 -"},{"line_number":175,"context_line":"                                          allowed)"},{"line_number":176,"context_line":"            usages[resource][\u0027reserved\u0027] \u003d quotas[resource] * 1 / 10"},{"line_number":177,"context_line":"            raise exc.OverQuota(overs\u003d[resource], quotas\u003dquotas,"},{"line_number":178,"context_line":"                                usages\u003dusages)"},{"line_number":179,"context_line":"    stubs.Set(QUOTAS, \u0027reserve\u0027, fake_reserve)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_0fec7028","line":176,"in_reply_to":"da20952f_c4cafb1a","updated":"2015-09-01 06:29:14.000000000","message":"Done","commit_id":"009320aa227ffc3cb16fb8eeb4bf49ab6196a17f"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"f07016f053593f88ca7217350acd24f4ad1e8fee","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        @mock.patch.object(flavors, \u0027get_flavor_by_flavor_id\u0027,"},{"line_number":1616,"context_line":"                           return_value\u003dfake_flavor)"},{"line_number":1617,"context_line":"        @mock.patch.object(objects.Quotas, \u0027reserve\u0027, side_effect\u003de)"},{"line_number":1618,"context_line":"        def do_test(mock_reserve, mock_get_flavor):"},{"line_number":1619,"context_line":"            try:"},{"line_number":1620,"context_line":"                self.compute_api.resize(self.context, fake_inst,"},{"line_number":1621,"context_line":"                                        \u0027fake_flavor_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_0203cb77","line":1618,"updated":"2015-09-01 16:00:23.000000000","message":"Ugh, I\u0027d like you to not use an inner function like this.  Put the mocks at the top level and set the return_value/side_effect appropriately, e.g.:\n\n    @mock.patch.object(flavors, \u0027get_flavor_by_flavor_id\u0027)\n    @mock.patch.object(objects.Quotas, \u0027reserve\u0027)\n    def test_resize_instance_quota_exceeds_with_multiple_resources(\n            self, mock_reserve, mock_get_flavor_by_flavor_id):\n        …\n        fake_inst \u003d self._create_instance_obj()\n        mock_reserve.side_effect \u003d exception.OverQuota(**over_quota_args)\n        mock_get_flavor_by_flavor_id.return_value \u003d self._create_flavor(\n            id\u003d333, vcpus\u003d3, memory_mb\u003d1536)\n\n        try:\n            self.compute_api.resize(self.context, fake_inst,\n                                    \u0027fake_flavor_id\u0027)\n        …","commit_id":"c1e27c4fa34be7fc18540359c27c1260f99d199d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"efde4d7d688b5ef08450d36a2277bdfac7866cdb","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        @mock.patch.object(flavors, \u0027get_flavor_by_flavor_id\u0027,"},{"line_number":1616,"context_line":"                           return_value\u003dfake_flavor)"},{"line_number":1617,"context_line":"        @mock.patch.object(objects.Quotas, \u0027reserve\u0027, side_effect\u003de)"},{"line_number":1618,"context_line":"        def do_test(mock_reserve, mock_get_flavor):"},{"line_number":1619,"context_line":"            try:"},{"line_number":1620,"context_line":"                self.compute_api.resize(self.context, fake_inst,"},{"line_number":1621,"context_line":"                                        \u0027fake_flavor_id\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_c4b8642d","line":1618,"in_reply_to":"da20952f_0203cb77","updated":"2015-09-02 03:46:01.000000000","message":"Done","commit_id":"c1e27c4fa34be7fc18540359c27c1260f99d199d"}]}
