)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e716411ba6afd7c5acf61a744825148ff06492a2","unresolved":false,"context_lines":[{"line_number":480,"context_line":"            # If we got here, we require instance_type and if we do not have"},{"line_number":481,"context_line":"            # one consider it a programming error."},{"line_number":482,"context_line":"            if instance_type is None:"},{"line_number":483,"context_line":"                raise RuntimeError(\u0027Unable to update resource tracker usage \u0027"},{"line_number":484,"context_line":"                                   \u0027without a flavor for instance: %s\u0027 %"},{"line_number":485,"context_line":"                                   instance.uuid)"},{"line_number":486,"context_line":"            numa_topology \u003d self._get_migration_context_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_f25b472b","line":483,"updated":"2019-03-07 21:29:35.000000000","message":"Ah, instance.flavor is optional. Well that sucks.","commit_id":"3248ea0095743f61f395a16547f48d5747eea3ba"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1a1643db03f1085b373b8a1598c7e2cf146334f2","unresolved":false,"context_lines":[{"line_number":480,"context_line":"            # If we got here, we require instance_type and if we do not have"},{"line_number":481,"context_line":"            # one consider it a programming error."},{"line_number":482,"context_line":"            if instance_type is None:"},{"line_number":483,"context_line":"                raise RuntimeError(\u0027Unable to update resource tracker usage \u0027"},{"line_number":484,"context_line":"                                   \u0027without a flavor for instance: %s\u0027 %"},{"line_number":485,"context_line":"                                   instance.uuid)"},{"line_number":486,"context_line":"            numa_topology \u003d self._get_migration_context_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_0dd3523a","line":483,"in_reply_to":"5fc1f717_7218b71c","updated":"2019-03-07 22:23:15.000000000","message":"Well, I guess I missed something in the revert_resize flow depending on when periodics are run because some functional tests are failing on this during revert_resize, presumably because revert_resize calls drop_move_claim without an instance_type and the instance is not in tracked_migrations but it is in tracked_instances (on the dest), so instance_type is None and then we blow up here. So yeah I guess this needs to just be based on if instance_type is passed in.","commit_id":"3248ea0095743f61f395a16547f48d5747eea3ba"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d79048d35125cc50e4a8b5fef474d5fe32add88b","unresolved":false,"context_lines":[{"line_number":480,"context_line":"            # If we got here, we require instance_type and if we do not have"},{"line_number":481,"context_line":"            # one consider it a programming error."},{"line_number":482,"context_line":"            if instance_type is None:"},{"line_number":483,"context_line":"                raise RuntimeError(\u0027Unable to update resource tracker usage \u0027"},{"line_number":484,"context_line":"                                   \u0027without a flavor for instance: %s\u0027 %"},{"line_number":485,"context_line":"                                   instance.uuid)"},{"line_number":486,"context_line":"            numa_topology \u003d self._get_migration_context_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_7218b71c","line":483,"in_reply_to":"5fc1f717_f25b472b","updated":"2019-03-07 21:38:39.000000000","message":"Well, it\u0027s dumb, the interface is tightly coupled to who is calling it and when. revert_resize calls it from the dest and drops the new_flavor, which at the time it calls it the instance is in tracked_migrations and instance.flavor \u003d\u003d instance.new_flavor, so it doesn\u0027t pass in instance_type and it\u0027s handled automagically albeit brittle.\n\nWhen called from confirm_resize, instance_type is passed in as the old_flavor and the instance might not be in tracked_migrations (hence the bug I\u0027m fixing). But yeah in the latter case here for confirm_resize, instance_type *must* be passed in. We could guess and do something like:\n\ninstance_type \u003d getattr(instance, \u0027%flavor\u0027 % prefix)\nif instance_type is None:\n    instance_type \u003d instance.flavor\n\nBut that\u0027s also gross, so I just went with being explicit here.\n\nLong-term we could probably just make instance_type a required parameter and avoid the tomfoolery.","commit_id":"3248ea0095743f61f395a16547f48d5747eea3ba"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7c4a8b91befd43fdc06cf3c82dfb766d6471bfab","unresolved":false,"context_lines":[{"line_number":7200,"context_line":"            mock_save.assert_called_with(expected_task_state\u003d"},{"line_number":7201,"context_line":"                                         [None, task_states.DELETING,"},{"line_number":7202,"context_line":"                                         task_states.SOFT_DELETING])"},{"line_number":7203,"context_line":""},{"line_number":7204,"context_line":"        do_confirm_resize()"},{"line_number":7205,"context_line":""},{"line_number":7206,"context_line":"    @mock.patch(\u0027nova.objects.MigrationContext.get_pci_mapping_for_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bfb3d3c7_dce33433","line":7203,"updated":"2019-05-29 06:42:04.000000000","message":"We could assert that mock_drop is still called at the end.","commit_id":"674617e212623e9c1eb1a27411921b60671afa0d"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e716411ba6afd7c5acf61a744825148ff06492a2","unresolved":false,"context_lines":[{"line_number":2500,"context_line":"        # usage and the instance should be in tracked_migrations from when"},{"line_number":2501,"context_line":"        # the resize_claim was made on the dest during prep_resize."},{"line_number":2502,"context_line":"        self.rt.tracked_migrations \u003d {"},{"line_number":2503,"context_line":"            instance.uuid: objects.Migration(migration_type\u003d\u0027resize\u0027)}"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"        # not using mock.sentinel.ctx because drop_move_claim calls elevated"},{"line_number":2506,"context_line":"        ctx \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_d27deb6e","line":2503,"updated":"2019-03-07 21:29:35.000000000","message":"Shouldn\u0027t we still test that _update_usage is called if the instance is in tracked_instances?","commit_id":"3248ea0095743f61f395a16547f48d5747eea3ba"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d79048d35125cc50e4a8b5fef474d5fe32add88b","unresolved":false,"context_lines":[{"line_number":2500,"context_line":"        # usage and the instance should be in tracked_migrations from when"},{"line_number":2501,"context_line":"        # the resize_claim was made on the dest during prep_resize."},{"line_number":2502,"context_line":"        self.rt.tracked_migrations \u003d {"},{"line_number":2503,"context_line":"            instance.uuid: objects.Migration(migration_type\u003d\u0027resize\u0027)}"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"        # not using mock.sentinel.ctx because drop_move_claim calls elevated"},{"line_number":2506,"context_line":"        ctx \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_12d3733a","line":2503,"in_reply_to":"5fc1f717_d27deb6e","updated":"2019-03-07 21:38:39.000000000","message":"My functional test is doing that.","commit_id":"3248ea0095743f61f395a16547f48d5747eea3ba"}]}
