)]}'
{"nova/objects/instance.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f9163f5aa1d9a7ba0dfde0ecb13f7032bc5ca5f1","unresolved":false,"context_lines":[{"line_number":581,"context_line":"            obj \u003d getattr(self, field)"},{"line_number":582,"context_line":"            if obj is not None:"},{"line_number":583,"context_line":"                value \u003d jsonutils.dumps(obj.obj_to_primitive())"},{"line_number":584,"context_line":"            else:"},{"line_number":585,"context_line":"                value \u003d None"},{"line_number":586,"context_line":"            self._extra_values_to_save[field] \u003d value"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    @base.remotable"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_943952a6","line":585,"range":{"start_line":584,"start_character":0,"end_line":585,"end_character":28},"updated":"2016-05-25 08:12:14.000000000","message":"can you do:\nvalue \u003d None\nif obj is not None:\n   value \u003d jsonutils.dumps(obj.obj_to_primitive())\nand remove the else","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d921c50b5286fda8f1f1cebfc4dcdeae4a9a4cac","unresolved":false,"context_lines":[{"line_number":581,"context_line":"            obj \u003d getattr(self, field)"},{"line_number":582,"context_line":"            if obj is not None:"},{"line_number":583,"context_line":"                value \u003d jsonutils.dumps(obj.obj_to_primitive())"},{"line_number":584,"context_line":"            else:"},{"line_number":585,"context_line":"                value \u003d None"},{"line_number":586,"context_line":"            self._extra_values_to_save[field] \u003d value"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    @base.remotable"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_a11d3768","line":585,"range":{"start_line":584,"start_character":0,"end_line":585,"end_character":28},"in_reply_to":"bab6814e_943952a6","updated":"2016-05-25 08:46:36.000000000","message":"I can do that","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f9163f5aa1d9a7ba0dfde0ecb13f7032bc5ca5f1","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                            expected_task_state,"},{"line_number":635,"context_line":"                            admin_state_reset)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        self._extra_values_to_save \u003d {}"},{"line_number":638,"context_line":"        updates \u003d {}"},{"line_number":639,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_f4253e5c","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":13},"updated":"2016-05-25 08:12:14.000000000","message":"why do you need the self? it used only in the scope of this method","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"9af700907cb848a1e94bc629d81aa561ab4fc848","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                            expected_task_state,"},{"line_number":635,"context_line":"                            admin_state_reset)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        self._extra_values_to_save \u003d {}"},{"line_number":638,"context_line":"        updates \u003d {}"},{"line_number":639,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_9a4978d3","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":13},"in_reply_to":"bab6814e_84b92118","updated":"2016-05-25 10:29:15.000000000","message":"Why would that be better? I would still need to reset it here to have fresh values since __init__ would only do so initially when the object is created, not on every save.\n\nNot sure passing it around as a parameter would simplify anything. I would then also have to pass it around to every save handler.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bf282f7bc7d166789f3e908cc8c3cf5fa9418852","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                            expected_task_state,"},{"line_number":635,"context_line":"                            admin_state_reset)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        self._extra_values_to_save \u003d {}"},{"line_number":638,"context_line":"        updates \u003d {}"},{"line_number":639,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_70477a77","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":13},"in_reply_to":"bab6814e_9a4978d3","updated":"2016-05-25 16:09:17.000000000","message":"Yep, the way it is here is fine, IMHO.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"9e3434ce70300568465773d8db11f31f6a577598","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                            expected_task_state,"},{"line_number":635,"context_line":"                            admin_state_reset)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        self._extra_values_to_save \u003d {}"},{"line_number":638,"context_line":"        updates \u003d {}"},{"line_number":639,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_84b92118","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":13},"in_reply_to":"bab6814e_a1e7f73e","updated":"2016-05-25 09:02:51.000000000","message":"In that case I think is it better to defined it in the __init__ or pass the _extra_values_to_save to be updated in the _save_extra_generic","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d921c50b5286fda8f1f1cebfc4dcdeae4a9a4cac","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                            expected_task_state,"},{"line_number":635,"context_line":"                            admin_state_reset)"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"        self._extra_values_to_save \u003d {}"},{"line_number":638,"context_line":"        updates \u003d {}"},{"line_number":639,"context_line":"        changes \u003d self.obj_what_changed()"},{"line_number":640,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_a1e7f73e","line":637,"range":{"start_line":637,"start_character":8,"end_line":637,"end_character":13},"in_reply_to":"bab6814e_f4253e5c","updated":"2016-05-25 08:46:36.000000000","message":"It gets used in _save_flavor() and _save_extra_generic()","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f9163f5aa1d9a7ba0dfde0ecb13f7032bc5ca5f1","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                try:"},{"line_number":647,"context_line":"                    getattr(self, \u0027_save_%s\u0027 % field)(context)"},{"line_number":648,"context_line":"                except AttributeError:"},{"line_number":649,"context_line":"                    if field in _INSTANCE_EXTRA_FIELDS:"},{"line_number":650,"context_line":"                        self._save_extra_generic(context, field)"},{"line_number":651,"context_line":"                        continue"},{"line_number":652,"context_line":"                    LOG.exception(_LE(\u0027No save handler for %s\u0027), field,"},{"line_number":653,"context_line":"                                  instance\u003dself)"},{"line_number":654,"context_line":"                except db_exc.DBReferenceError as exp:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_54ed2ab6","line":651,"range":{"start_line":649,"start_character":0,"end_line":651,"end_character":32},"updated":"2016-05-25 08:12:14.000000000","message":"this is a bit awkward to let it raise exception and check if it in the extra field. why not keeping the  _save_numa_topology and other and in them call to the \n_save_extra_generic","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d921c50b5286fda8f1f1cebfc4dcdeae4a9a4cac","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                try:"},{"line_number":647,"context_line":"                    getattr(self, \u0027_save_%s\u0027 % field)(context)"},{"line_number":648,"context_line":"                except AttributeError:"},{"line_number":649,"context_line":"                    if field in _INSTANCE_EXTRA_FIELDS:"},{"line_number":650,"context_line":"                        self._save_extra_generic(context, field)"},{"line_number":651,"context_line":"                        continue"},{"line_number":652,"context_line":"                    LOG.exception(_LE(\u0027No save handler for %s\u0027), field,"},{"line_number":653,"context_line":"                                  instance\u003dself)"},{"line_number":654,"context_line":"                except db_exc.DBReferenceError as exp:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_e1873f10","line":651,"range":{"start_line":649,"start_character":0,"end_line":651,"end_character":32},"in_reply_to":"bab6814e_54ed2ab6","updated":"2016-05-25 08:46:36.000000000","message":"I was trying to avoid having the need for separate save handlers for every extras field except those needing any special handling. Let me see if I can do it differently.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"}],"nova/objects/instance_numa_topology.py":[{"author":{"_account_id":18602,"name":"Gábor Antal","email":"antal@inf.u-szeged.hu","username":"antal"},"change_message_id":"b716ef61d43314371e9ee06914d4a1e382d8701e","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        return obj_topology"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    # TODO(ndipanov) Remove this method on the major version bump to 2.0"},{"line_number":179,"context_line":"    @base.remotable"},{"line_number":180,"context_line":"    def create(self):"},{"line_number":181,"context_line":"        values \u003d {\u0027numa_topology\u0027: self._to_json()}"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_d67d861d","line":178,"range":{"start_line":178,"start_character":4,"end_line":178,"end_character":72},"updated":"2016-05-19 17:22:42.000000000","message":"Is this really needed here? As the method has been replaced.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"9103cb008b7b14d877e949fd7dc7c864b0f4bc27","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        return obj_topology"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    # TODO(ndipanov) Remove this method on the major version bump to 2.0"},{"line_number":179,"context_line":"    @base.remotable"},{"line_number":180,"context_line":"    def create(self):"},{"line_number":181,"context_line":"        values \u003d {\u0027numa_topology\u0027: self._to_json()}"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_b9ca756c","line":178,"range":{"start_line":178,"start_character":4,"end_line":178,"end_character":72},"in_reply_to":"bab6814e_d67d861d","updated":"2016-05-19 17:28:35.000000000","message":"The create() method that the comment references is still there, so yes it is still needed.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"}],"nova/tests/unit/compute/test_tracker.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f9163f5aa1d9a7ba0dfde0ecb13f7032bc5ca5f1","unresolved":false,"context_lines":[{"line_number":1742,"context_line":"        inst_save_mock.assert_called_once_with()"},{"line_number":1743,"context_line":"        self.assertNotEqual(expected, self.rt.compute_node)"},{"line_number":1744,"context_line":""},{"line_number":1745,"context_line":"        claim.instance.migration_context \u003d mig_context_obj"},{"line_number":1746,"context_line":"        with mock.patch.object(claim.instance,"},{"line_number":1747,"context_line":"                               \u0027drop_migration_context\u0027) as drop_mig_ctxt:"},{"line_number":1748,"context_line":"            claim.abort()"},{"line_number":1749,"context_line":"            self.assertTrue(obj_base.obj_equal_prims(expected,"},{"line_number":1750,"context_line":"                                                     self.rt.compute_node))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_54e08a96","line":1747,"range":{"start_line":1745,"start_character":0,"end_line":1747,"end_character":74},"updated":"2016-05-25 08:12:14.000000000","message":"It is better to check that you call the istance_extra_update_by_uuid to remove the migration context","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"9e3434ce70300568465773d8db11f31f6a577598","unresolved":false,"context_lines":[{"line_number":1742,"context_line":"        inst_save_mock.assert_called_once_with()"},{"line_number":1743,"context_line":"        self.assertNotEqual(expected, self.rt.compute_node)"},{"line_number":1744,"context_line":""},{"line_number":1745,"context_line":"        claim.instance.migration_context \u003d mig_context_obj"},{"line_number":1746,"context_line":"        with mock.patch.object(claim.instance,"},{"line_number":1747,"context_line":"                               \u0027drop_migration_context\u0027) as drop_mig_ctxt:"},{"line_number":1748,"context_line":"            claim.abort()"},{"line_number":1749,"context_line":"            self.assertTrue(obj_base.obj_equal_prims(expected,"},{"line_number":1750,"context_line":"                                                     self.rt.compute_node))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_647cfd20","line":1747,"range":{"start_line":1745,"start_character":0,"end_line":1747,"end_character":74},"in_reply_to":"bab6814e_4f72b712","updated":"2016-05-25 09:02:51.000000000","message":"ok but the drop_migration_context  is not tested in the test_migration_context.py as far as I can see","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d921c50b5286fda8f1f1cebfc4dcdeae4a9a4cac","unresolved":false,"context_lines":[{"line_number":1742,"context_line":"        inst_save_mock.assert_called_once_with()"},{"line_number":1743,"context_line":"        self.assertNotEqual(expected, self.rt.compute_node)"},{"line_number":1744,"context_line":""},{"line_number":1745,"context_line":"        claim.instance.migration_context \u003d mig_context_obj"},{"line_number":1746,"context_line":"        with mock.patch.object(claim.instance,"},{"line_number":1747,"context_line":"                               \u0027drop_migration_context\u0027) as drop_mig_ctxt:"},{"line_number":1748,"context_line":"            claim.abort()"},{"line_number":1749,"context_line":"            self.assertTrue(obj_base.obj_equal_prims(expected,"},{"line_number":1750,"context_line":"                                                     self.rt.compute_node))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_4f72b712","line":1747,"range":{"start_line":1745,"start_character":0,"end_line":1747,"end_character":74},"in_reply_to":"bab6814e_54e08a96","updated":"2016-05-25 08:46:36.000000000","message":"I don\u0027t think so. The internals of drop_migration_context should be tested seperately to keep to the principles of unit testing.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"9af700907cb848a1e94bc629d81aa561ab4fc848","unresolved":false,"context_lines":[{"line_number":1742,"context_line":"        inst_save_mock.assert_called_once_with()"},{"line_number":1743,"context_line":"        self.assertNotEqual(expected, self.rt.compute_node)"},{"line_number":1744,"context_line":""},{"line_number":1745,"context_line":"        claim.instance.migration_context \u003d mig_context_obj"},{"line_number":1746,"context_line":"        with mock.patch.object(claim.instance,"},{"line_number":1747,"context_line":"                               \u0027drop_migration_context\u0027) as drop_mig_ctxt:"},{"line_number":1748,"context_line":"            claim.abort()"},{"line_number":1749,"context_line":"            self.assertTrue(obj_base.obj_equal_prims(expected,"},{"line_number":1750,"context_line":"                                                     self.rt.compute_node))"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_ba39dca5","line":1747,"range":{"start_line":1745,"start_character":0,"end_line":1747,"end_character":74},"in_reply_to":"bab6814e_647cfd20","updated":"2016-05-25 10:29:15.000000000","message":"There is a test_drop_migration_context test in nova/tests/unit/objects/test_instance.py","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"}],"nova/tests/unit/objects/test_instance.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f9163f5aa1d9a7ba0dfde0ecb13f7032bc5ca5f1","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        inst.vcpu_model \u003d test_vcpu_model.fake_vcpumodel"},{"line_number":603,"context_line":"        inst.save()"},{"line_number":604,"context_line":"        mock_update.assert_called_once_with("},{"line_number":605,"context_line":"            self.context, inst.uuid, mock.ANY)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    @mock.patch.object(notifications, \u0027send_update\u0027)"},{"line_number":608,"context_line":"    @mock.patch.object(cells_rpcapi.CellsAPI, \u0027instance_update_from_api\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_74930efb","line":605,"range":{"start_line":605,"start_character":37,"end_line":605,"end_character":45},"updated":"2016-05-25 08:12:14.000000000","message":"can  you check you are passing the correct values for the \ninstance_extra_update_by_uuid?","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d921c50b5286fda8f1f1cebfc4dcdeae4a9a4cac","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        inst.vcpu_model \u003d test_vcpu_model.fake_vcpumodel"},{"line_number":603,"context_line":"        inst.save()"},{"line_number":604,"context_line":"        mock_update.assert_called_once_with("},{"line_number":605,"context_line":"            self.context, inst.uuid, mock.ANY)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    @mock.patch.object(notifications, \u0027send_update\u0027)"},{"line_number":608,"context_line":"    @mock.patch.object(cells_rpcapi.CellsAPI, \u0027instance_update_from_api\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_cf14e74e","line":605,"range":{"start_line":605,"start_character":37,"end_line":605,"end_character":45},"in_reply_to":"bab6814e_74930efb","updated":"2016-05-25 08:46:36.000000000","message":"There are existing tests for each of the extras above. My aim for this test was just to make sure we only save once.","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"9af700907cb848a1e94bc629d81aa561ab4fc848","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        inst.vcpu_model \u003d test_vcpu_model.fake_vcpumodel"},{"line_number":603,"context_line":"        inst.save()"},{"line_number":604,"context_line":"        mock_update.assert_called_once_with("},{"line_number":605,"context_line":"            self.context, inst.uuid, mock.ANY)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    @mock.patch.object(notifications, \u0027send_update\u0027)"},{"line_number":608,"context_line":"    @mock.patch.object(cells_rpcapi.CellsAPI, \u0027instance_update_from_api\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_ab4cf09d","line":605,"range":{"start_line":605,"start_character":37,"end_line":605,"end_character":45},"in_reply_to":"bab6814e_c497a9e9","updated":"2016-05-25 10:29:15.000000000","message":"Done","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"9e3434ce70300568465773d8db11f31f6a577598","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        inst.vcpu_model \u003d test_vcpu_model.fake_vcpumodel"},{"line_number":603,"context_line":"        inst.save()"},{"line_number":604,"context_line":"        mock_update.assert_called_once_with("},{"line_number":605,"context_line":"            self.context, inst.uuid, mock.ANY)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    @mock.patch.object(notifications, \u0027send_update\u0027)"},{"line_number":608,"context_line":"    @mock.patch.object(cells_rpcapi.CellsAPI, \u0027instance_update_from_api\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_c497a9e9","line":605,"range":{"start_line":605,"start_character":37,"end_line":605,"end_character":45},"in_reply_to":"bab6814e_cf14e74e","updated":"2016-05-25 09:02:51.000000000","message":"ok but you need to verify that you are passing the correct values as well. let say you have a bug and that you only save the add the numa_topology to you _extra_values_to_save the this test will pass but the values  are incorrect","commit_id":"fa6359108dc559cbf4c9097892f67cc23f8e6897"}]}
