)]}'
{"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"52c646b1b2045bb2153dc9e033fdbbc7ccdd8105","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"        fake_mig.save().WithSideEffects(_check_mig)"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        if self.cell_type:"},{"line_number":1404,"context_line":"            quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1405,"context_line":"                                user_id\u003dNone)"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        self.compute_api._record_action_start(self.context, fake_inst,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_99f2376e","line":1404,"updated":"2016-04-18 21:17:38.000000000","message":"The mox stub above makes sense to me, but I\u0027m not sure why this change was made. This is what gets called anyways from fake_quotas.commit() so why not just leave that in place?","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6e480998662a9431ee27f5414aecb69c62bb32a8","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"        fake_mig.save().WithSideEffects(_check_mig)"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        if self.cell_type:"},{"line_number":1404,"context_line":"            quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1405,"context_line":"                                user_id\u003dNone)"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        self.compute_api._record_action_start(self.context, fake_inst,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_51eb2f13","line":1404,"in_reply_to":"1a122d0e_1ea72850","updated":"2016-04-19 15:19:37.000000000","message":"I tracked down what\u0027s happening. fake_quotas.commit() commits the quotas and then sets self.reservations on the object to None. Then when compute_api.revert_resize runs below and calls quotas.commit() that code skips the quota.QUOTAS.commit() execution because self.reservations is now None.  http://git.openstack.org/cgit/openstack/nova/tree/nova/objects/quotas.py#n100 you can see that commit is only meant to be run once without updating reservations.\n\nSo my take on this is that if it\u0027s important to test quotas here then what you have is good. If they\u0027re incidental to the test it might be better to mock out at the level of objects.Quota.commit and not worry about the details of the quota.QUOTAS.commit call.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"f1fe7bb351c41725beb31f238c1b13105ce02958","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"        fake_mig.save().WithSideEffects(_check_mig)"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        if self.cell_type:"},{"line_number":1404,"context_line":"            quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1405,"context_line":"                                user_id\u003dNone)"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        self.compute_api._record_action_start(self.context, fake_inst,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_553e7a8c","line":1404,"in_reply_to":"1a122d0e_51eb2f13","updated":"2016-04-19 15:38:01.000000000","message":"Yup, that\u0027s correct. I elaborated below in the rollback case which is the same. My apologies for not being clearer here too.\n\nThe revert_resize asserts rely on the logic in objects.Quota.commit which is part of why I stubbed quota.QUOTAS.commit instead.\n\n    [] if self.cell_type else fake_quotas.reservations","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"8292d776be486ee49da9349f2d6ce28303a083d4","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"        fake_mig.save().WithSideEffects(_check_mig)"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        if self.cell_type:"},{"line_number":1404,"context_line":"            quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1405,"context_line":"                                user_id\u003dNone)"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        self.compute_api._record_action_start(self.context, fake_inst,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_b47a9aef","line":1404,"in_reply_to":"1a122d0e_99f2376e","updated":"2016-04-18 22:29:04.000000000","message":"Here\u0027s what happens otherwise (\"Expected methods never called\"):\n\nhttp://paste.openstack.org/show/494522/\n\nQuotas.commit and QuotaEngine.commit weren\u0027t stubbed or otherwise tracked by mox for assertions during replay before, so you can\u0027t really consider them equal.\n\nYou could, for example, just delete this line entirely in the old test, and the tests would still pass. You would still have the \u0027oslo_db state\u0027 warnings, but the test would otherwise continue passing.\n\n    fake_quotas.commit()","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"5ee83cb8dee63a0cc8ff799a639d9657455b1a3e","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"        fake_mig.save().WithSideEffects(_check_mig)"},{"line_number":1402,"context_line":""},{"line_number":1403,"context_line":"        if self.cell_type:"},{"line_number":1404,"context_line":"            quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1405,"context_line":"                                user_id\u003dNone)"},{"line_number":1406,"context_line":""},{"line_number":1407,"context_line":"        self.compute_api._record_action_start(self.context, fake_inst,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_1ea72850","line":1404,"in_reply_to":"1a122d0e_b47a9aef","updated":"2016-04-18 23:35:08.000000000","message":"It looks like some of the relevant history can be found here:\n\nhttps://github.com/openstack/nova/commit/5ebc60c48d4a8b6c7bac96d923626df9ae67a2b2\n\nNote the removal of the commit/rollback stubs.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"52c646b1b2045bb2153dc9e033fdbbc7ccdd8105","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"            expected\u003d{\u0027task_state\u0027: [None]})"},{"line_number":1453,"context_line":"        fake_inst.save(expected_task_state\u003d[None]).AndRaise(exc)"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"        quota.QUOTAS.rollback(self.context, resvs, project_id\u003dNone,"},{"line_number":1456,"context_line":"                              user_id\u003dNone)"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_3904c348","line":1455,"updated":"2016-04-18 21:17:38.000000000","message":"Same question as above.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"8292d776be486ee49da9349f2d6ce28303a083d4","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"            expected\u003d{\u0027task_state\u0027: [None]})"},{"line_number":1453,"context_line":"        fake_inst.save(expected_task_state\u003d[None]).AndRaise(exc)"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"        quota.QUOTAS.rollback(self.context, resvs, project_id\u003dNone,"},{"line_number":1456,"context_line":"                              user_id\u003dNone)"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_b4961aee","line":1455,"in_reply_to":"1a122d0e_3904c348","updated":"2016-04-18 22:29:04.000000000","message":"Same error otherwise (\"Expected methods never called\"):\n\nhttp://paste.openstack.org/show/494525/","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"ff2e8d636039f62f5e7bdb030e0621085fa9edf4","unresolved":false,"context_lines":[{"line_number":1452,"context_line":"            expected\u003d{\u0027task_state\u0027: [None]})"},{"line_number":1453,"context_line":"        fake_inst.save(expected_task_state\u003d[None]).AndRaise(exc)"},{"line_number":1454,"context_line":""},{"line_number":1455,"context_line":"        quota.QUOTAS.rollback(self.context, resvs, project_id\u003dNone,"},{"line_number":1456,"context_line":"                              user_id\u003dNone)"},{"line_number":1457,"context_line":""},{"line_number":1458,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_3c7e6cae","line":1455,"in_reply_to":"1a122d0e_b4961aee","updated":"2016-04-19 00:53:01.000000000","message":"Sorry, I should have elaborated.\n\nWhen you use fake_quotas.rollback() during the mox\u0027s \"record\" phase here, it hits this code path (calls quota.QUOTAS.rollback, and then sets self.reservations to None):\n\nhttps://github.com/openstack/nova/blob/807bc5660f5c2d842c617310043600a1d3b92fd6/nova/objects/quotas.py#L116\n\nBut then when fake_quotas gets returned by reserve_quota_delta in mox\u0027s \"replay\" mode, it hits this path (doesn\u0027t call quota.QUOTAS.rollback because self.reservations was set to None already in \"record\" mode).\n\nhttps://github.com/openstack/nova/blob/807bc5660f5c2d842c617310043600a1d3b92fd6/nova/objects/quotas.py#L112\n\nI hope that helps clear things up.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"52c646b1b2045bb2153dc9e033fdbbc7ccdd8105","unresolved":false,"context_lines":[{"line_number":1533,"context_line":"            else:"},{"line_number":1534,"context_line":"                expected_reservations \u003d []"},{"line_number":1535,"context_line":"            if self.cell_type \u003d\u003d \u0027api\u0027:"},{"line_number":1536,"context_line":"                if flavor_id_passed:"},{"line_number":1537,"context_line":"                    quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1538,"context_line":"                                        user_id\u003dNone)"},{"line_number":1539,"context_line":"                expected_reservations \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_198627b9","line":1536,"updated":"2016-04-18 21:17:38.000000000","message":"What changed so that this if statement is needed?","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"8292d776be486ee49da9349f2d6ce28303a083d4","unresolved":false,"context_lines":[{"line_number":1533,"context_line":"            else:"},{"line_number":1534,"context_line":"                expected_reservations \u003d []"},{"line_number":1535,"context_line":"            if self.cell_type \u003d\u003d \u0027api\u0027:"},{"line_number":1536,"context_line":"                if flavor_id_passed:"},{"line_number":1537,"context_line":"                    quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1538,"context_line":"                                        user_id\u003dNone)"},{"line_number":1539,"context_line":"                expected_reservations \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_f43c12e4","line":1536,"in_reply_to":"1a122d0e_198627b9","updated":"2016-04-18 22:29:04.000000000","message":"It (\"commit\") wasn\u0027t stubbed before using StubOutWithMock at either the object or quota engine layer, so there was no assertion during replay mode before. Now that there is an assertion, it needs to reflect reality.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6e480998662a9431ee27f5414aecb69c62bb32a8","unresolved":false,"context_lines":[{"line_number":1533,"context_line":"            else:"},{"line_number":1534,"context_line":"                expected_reservations \u003d []"},{"line_number":1535,"context_line":"            if self.cell_type \u003d\u003d \u0027api\u0027:"},{"line_number":1536,"context_line":"                if flavor_id_passed:"},{"line_number":1537,"context_line":"                    quota.QUOTAS.commit(self.context, resvs, project_id\u003dNone,"},{"line_number":1538,"context_line":"                                        user_id\u003dNone)"},{"line_number":1539,"context_line":"                expected_reservations \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_71f62bfa","line":1536,"in_reply_to":"1a122d0e_f43c12e4","updated":"2016-04-19 15:19:37.000000000","message":"Gotcha, thanks.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4d03aed61b64672a92b85f414e2d018fdcc44382","unresolved":false,"context_lines":[{"line_number":2285,"context_line":""},{"line_number":2286,"context_line":"        @classmethod"},{"line_number":2287,"context_line":"        def fake_bdm_list_get_by_instance_uuid(cls, context, instance_uuid):"},{"line_number":2288,"context_line":"            db_list \u003d copy.deepcopy(instance_bdms)"},{"line_number":2289,"context_line":"            item_cls \u003d objects.BlockDeviceMapping"},{"line_number":2290,"context_line":"            return obj_base.obj_make_list(context, cls(), item_cls, db_list)"},{"line_number":2291,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_3974c366","line":2288,"range":{"start_line":2288,"start_character":36,"end_line":2288,"end_character":49},"updated":"2016-04-18 21:05:51.000000000","message":"Hmm, when is instance_bdms not an empty list? I must be missing it here.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"8292d776be486ee49da9349f2d6ce28303a083d4","unresolved":false,"context_lines":[{"line_number":2285,"context_line":""},{"line_number":2286,"context_line":"        @classmethod"},{"line_number":2287,"context_line":"        def fake_bdm_list_get_by_instance_uuid(cls, context, instance_uuid):"},{"line_number":2288,"context_line":"            db_list \u003d copy.deepcopy(instance_bdms)"},{"line_number":2289,"context_line":"            item_cls \u003d objects.BlockDeviceMapping"},{"line_number":2290,"context_line":"            return obj_base.obj_make_list(context, cls(), item_cls, db_list)"},{"line_number":2291,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_882782b5","line":2288,"range":{"start_line":2288,"start_character":36,"end_line":2288,"end_character":49},"in_reply_to":"1a122d0e_3974c366","updated":"2016-04-18 22:29:04.000000000","message":"Look for \u0027instance_bdms.append(bdm)\u0027 in this method. I think that\u0027ll clear things up.","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fb5e0dc7745f6b75c23aefa5a86b181f960c007b","unresolved":false,"context_lines":[{"line_number":2285,"context_line":""},{"line_number":2286,"context_line":"        @classmethod"},{"line_number":2287,"context_line":"        def fake_bdm_list_get_by_instance_uuid(cls, context, instance_uuid):"},{"line_number":2288,"context_line":"            db_list \u003d copy.deepcopy(instance_bdms)"},{"line_number":2289,"context_line":"            item_cls \u003d objects.BlockDeviceMapping"},{"line_number":2290,"context_line":"            return obj_base.obj_make_list(context, cls(), item_cls, db_list)"},{"line_number":2291,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_c19af562","line":2288,"range":{"start_line":2288,"start_character":36,"end_line":2288,"end_character":49},"in_reply_to":"1a122d0e_882782b5","updated":"2016-04-19 00:02:05.000000000","message":"Yeah, sorry, gerrit search failed me.\n\nAnyway, I think you can avoid the deepcopy now since you\u0027re making objects out of these right?","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"06646da4dec6999781f01aa05510aa4645ae2587","unresolved":false,"context_lines":[{"line_number":2285,"context_line":""},{"line_number":2286,"context_line":"        @classmethod"},{"line_number":2287,"context_line":"        def fake_bdm_list_get_by_instance_uuid(cls, context, instance_uuid):"},{"line_number":2288,"context_line":"            db_list \u003d copy.deepcopy(instance_bdms)"},{"line_number":2289,"context_line":"            item_cls \u003d objects.BlockDeviceMapping"},{"line_number":2290,"context_line":"            return obj_base.obj_make_list(context, cls(), item_cls, db_list)"},{"line_number":2291,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_77091fdd","line":2288,"range":{"start_line":2288,"start_character":36,"end_line":2288,"end_character":49},"in_reply_to":"1a122d0e_c19af562","updated":"2016-04-19 01:11:03.000000000","message":"Done, thanks!","commit_id":"86ddc4f6642721c453156a5226a9076714b0532e"}]}
