)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"34b34b1790eb2d676cd0226b85a0fd6529be232a","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            m, _ \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if not m or migration.updated_at \u003e\u003d m.updated_at:"},{"line_number":775,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_cced79f1","line":773,"updated":"2015-09-11 11:34:25.000000000","message":"Nit: if we\u0027re changing this line, we should probably update the name of the variable away from \u0027m\u0027 to something more meaningful. But that\u0027s just my preference.","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            m, _ \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if not m or migration.updated_at \u003e\u003d m.updated_at:"},{"line_number":775,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_1aee3522","line":773,"in_reply_to":"da20952f_2ee3bf35","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"950afe7e83f83d944199a468cb162aeebfcea542","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            m, _ \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if not m or migration.updated_at \u003e\u003d m.updated_at:"},{"line_number":775,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_2ee3bf35","line":773,"in_reply_to":"da20952f_cced79f1","updated":"2015-09-11 16:00:23.000000000","message":"Also, I have to take exception to the use of \u0027_\u0027 as the throw-away variable here, as \u0027_\u0027 is bound to gettext.  While it shouldn\u0027t cause any problems within this method at present, we should discourage its redefinition this way to avoid confusing other developers.  For throw-aways, we usually use a name prefixed by \u0027_\u0027 to indicate it won\u0027t be used, e.g.:\n\n    recent_migration, _recent_instance \u003d filtered.get(uuid, [None, None])\n\n(Note that I\u0027ve not analyzed this code closely enough to know whether my suggested names are appropriate, so feel free to adjust as you see fit.)","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            m, _ \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if not m or migration.updated_at \u003e\u003d m.updated_at:"},{"line_number":775,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_fae82118","line":773,"in_reply_to":"da20952f_cced79f1","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d7790731491d4408db2b332c9b2a3c9b09750a83","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_ba07096f","line":773,"updated":"2015-09-11 18:10:38.000000000","message":"Why not use instance, which we already have in scope from line 758? We\u0027re looking for other migrations for the same instance, so we should be good there, right?","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"87a2f1cda5a2ce2e097f9daa390effd9695a6cde","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_8e1be66e","line":773,"in_reply_to":"da20952f_1a1dd572","updated":"2015-09-11 18:20:02.000000000","message":"No, I meant, no need to pull it out of the dict.. Just use the one already in scope -- no need to overwrite it.","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"86f21af7dfa46f10a80a36512492790ebc2087fb","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_1a1dd572","line":773,"in_reply_to":"da20952f_ba07096f","updated":"2015-09-11 18:18:34.000000000","message":"I did have \u0027instance\u0027 originally, but I worried someone would call me on it (for overriding the one already in scope). It will indeed be the same instance. I\u0027ll change it to \u0027instance\u0027 like I originally had. Thx!","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"648072b5c71b34cb65e95c9c6fa7600f06c7c492","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration, instance in filtered.values():"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_9a924556","line":775,"updated":"2015-09-11 18:00:38.000000000","message":"femtonit: it would be good to indent the second line of the condition another four spaces to visually separate it from the code, e.g.:\n\n    if (not other_migration or\n            migration.updated_at \u003e\u003d other_migration.updated_at):\n        filtered[uuid] \u003d [migration, instance]","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d7790731491d4408db2b332c9b2a3c9b09750a83","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration, instance in filtered.values():"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_da351d45","line":775,"in_reply_to":"da20952f_9a924556","updated":"2015-09-11 18:10:38.000000000","message":"Agreed, I think this will fail our pep8 test, no?","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"86f21af7dfa46f10a80a36512492790ebc2087fb","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration, instance in filtered.values():"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_da5afd81","line":775,"in_reply_to":"da20952f_9a924556","updated":"2015-09-11 18:18:34.000000000","message":"nope, passes pep8. fixed though. thx!","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"87a2f1cda5a2ce2e097f9daa390effd9695a6cde","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, _instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration, instance in filtered.values():"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_6e3772e3","line":775,"in_reply_to":"da20952f_da5afd81","updated":"2015-09-11 18:20:02.000000000","message":"Our pep8 test? Well, I think it *used to* would have failed at least :)","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3a62b74c6255725afd2c932d0214989d3b8ebc17","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                    migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_0e47d64c","line":773,"range":{"start_line":773,"start_character":27,"end_line":773,"end_character":37},"updated":"2015-09-11 18:21:34.000000000","message":"Still think we don\u0027t need this...","commit_id":"e7ecb1a7471f4b4bc2551e07e30bba202737e723"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"1177ce8053b227b670086016f80598d796617527","unresolved":false,"context_lines":[{"line_number":770,"context_line":"                continue"},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration, instance \u003d filtered.get(uuid, [None, None])"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                    migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d [migration, instance]"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_aeab4a87","line":773,"in_reply_to":"da20952f_0e47d64c","updated":"2015-09-11 18:34:03.000000000","message":"Changed - I think I understand what you\u0027re getting at now ;)","commit_id":"e7ecb1a7471f4b4bc2551e07e30bba202737e723"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b87e44df8961317a2fdbf4f65334fdb1f41b9e9f","unresolved":false,"context_lines":[{"line_number":748,"context_line":"    def _update_usage_from_migrations(self, context, migrations):"},{"line_number":749,"context_line":"        filtered \u003d {}"},{"line_number":750,"context_line":"        instances \u003d {}"},{"line_number":751,"context_line":"        self.tracked_migrations.clear()"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"        # do some defensive filtering against bad migrations records in the"},{"line_number":754,"context_line":"        # database:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_91530bde","line":751,"updated":"2015-09-11 19:02:53.000000000","message":"yoctonit: Would prefer you not arbitrarily move this line :)","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b87e44df8961317a2fdbf4f65334fdb1f41b9e9f","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration \u003d filtered.get(uuid, None)"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                    migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d migration"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration in filtered.values():"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_11685b87","line":775,"updated":"2015-09-11 19:02:53.000000000","message":"Same here, this is rather arbitrary renaming of the variable, which makes it look like you changed something functional, even though you didn\u0027t.","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"a91aa458439530e327ae7ac9b635c29cca63afce","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration \u003d filtered.get(uuid, None)"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                    migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d migration"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration in filtered.values():"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_71e4370c","line":775,"in_reply_to":"da20952f_11685b87","updated":"2015-09-11 19:05:10.000000000","message":"A different code review asked me to change it. Two people asked ;)","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"29ed2ce066954e3b7d68515a74552c5d81cfed0a","unresolved":false,"context_lines":[{"line_number":772,"context_line":"            # filter to most recently updated migration for each instance:"},{"line_number":773,"context_line":"            other_migration \u003d filtered.get(uuid, None)"},{"line_number":774,"context_line":"            if (not other_migration or"},{"line_number":775,"context_line":"                    migration.updated_at \u003e\u003d other_migration.updated_at):"},{"line_number":776,"context_line":"                filtered[uuid] \u003d migration"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        for migration in filtered.values():"}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_d130a309","line":775,"in_reply_to":"da20952f_71e4370c","updated":"2015-09-11 19:22:30.000000000","message":"Well, those people are WRONG! :)","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"34b34b1790eb2d676cd0226b85a0fd6529be232a","unresolved":false,"context_lines":[{"line_number":1410,"context_line":"class UpdateUsageFromMigrationsTestCase(BaseTrackerTestCase):"},{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":"    @mock.patch.object("},{"line_number":1413,"context_line":"        resource_tracker.ResourceTracker, \u0027_update_usage_from_migration\u0027)"},{"line_number":1414,"context_line":"    def test_no_migrations(self, mock_update_usage):"},{"line_number":1415,"context_line":"        migrations \u003d []"},{"line_number":1416,"context_line":"        self.tracker._update_usage_from_migrations(self.context, migrations)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_8c88e123","line":1413,"updated":"2015-09-11 11:34:25.000000000","message":"The code is solid; all my comments are about style. On this line and others in this class, it would be more consistent with the rest of the code to format the decorator as:\n\n    @mock.patch.object(resource_tracker.ResourceTracker,\n                       \u0027_update_usage_from_migration\u0027)","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1410,"context_line":"class UpdateUsageFromMigrationsTestCase(BaseTrackerTestCase):"},{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":"    @mock.patch.object("},{"line_number":1413,"context_line":"        resource_tracker.ResourceTracker, \u0027_update_usage_from_migration\u0027)"},{"line_number":1414,"context_line":"    def test_no_migrations(self, mock_update_usage):"},{"line_number":1415,"context_line":"        migrations \u003d []"},{"line_number":1416,"context_line":"        self.tracker._update_usage_from_migrations(self.context, migrations)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_9ada4577","line":1413,"in_reply_to":"da20952f_8c88e123","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"34b34b1790eb2d676cd0226b85a0fd6529be232a","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"    @mock.patch(\u0027nova.objects.instance.Instance.get_by_uuid\u0027)"},{"line_number":1422,"context_line":"    def test_instance_not_found(self, mock_get_instance, mock_update_usage):"},{"line_number":1423,"context_line":"        mock_get_instance.side_effect \u003d exception.InstanceNotFound("},{"line_number":1424,"context_line":"            instance_id\u003d\u0027some_id\u0027"},{"line_number":1425,"context_line":"        )"},{"line_number":1426,"context_line":"        migration \u003d objects.Migration("},{"line_number":1427,"context_line":"            context\u003dself.context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_cc72594a","line":1424,"updated":"2015-09-11 11:34:25.000000000","message":"When using the multi-line format, you should end each option with a trailing comma to minimize diffs with later changes.","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1421,"context_line":"    @mock.patch(\u0027nova.objects.instance.Instance.get_by_uuid\u0027)"},{"line_number":1422,"context_line":"    def test_instance_not_found(self, mock_get_instance, mock_update_usage):"},{"line_number":1423,"context_line":"        mock_get_instance.side_effect \u003d exception.InstanceNotFound("},{"line_number":1424,"context_line":"            instance_id\u003d\u0027some_id\u0027"},{"line_number":1425,"context_line":"        )"},{"line_number":1426,"context_line":"        migration \u003d objects.Migration("},{"line_number":1427,"context_line":"            context\u003dself.context,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_3ae3f935","line":1424,"in_reply_to":"da20952f_cc72594a","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"34b34b1790eb2d676cd0226b85a0fd6529be232a","unresolved":false,"context_lines":[{"line_number":1425,"context_line":"        )"},{"line_number":1426,"context_line":"        migration \u003d objects.Migration("},{"line_number":1427,"context_line":"            context\u003dself.context,"},{"line_number":1428,"context_line":"            instance_uuid\u003d\u0027some_uuid\u0027"},{"line_number":1429,"context_line":"        )"},{"line_number":1430,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1431,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_6c9a2d64","line":1428,"updated":"2015-09-11 11:34:25.000000000","message":"Ditto","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1425,"context_line":"        )"},{"line_number":1426,"context_line":"        migration \u003d objects.Migration("},{"line_number":1427,"context_line":"            context\u003dself.context,"},{"line_number":1428,"context_line":"            instance_uuid\u003d\u0027some_uuid\u0027"},{"line_number":1429,"context_line":"        )"},{"line_number":1430,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1431,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_5ae02d26","line":1428,"in_reply_to":"da20952f_6c9a2d64","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"34b34b1790eb2d676cd0226b85a0fd6529be232a","unresolved":false,"context_lines":[{"line_number":1507,"context_line":"        self.assertEqual(mock_update_usage.call_count, 1)"},{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_6ce8edb3","line":1510,"updated":"2015-09-11 11:34:25.000000000","message":"Since this is used only by the test_most_recent() method, and is essentially a staticmethod, I would move it inside that method.","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1507,"context_line":"        self.assertEqual(mock_update_usage.call_count, 1)"},{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_5ab7cd20","line":1510,"in_reply_to":"da20952f_6ce8edb3","updated":"2015-09-11 17:52:59.000000000","message":"Done - inlined as per Kevin\u0027s suggestion","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"950afe7e83f83d944199a468cb162aeebfcea542","unresolved":false,"context_lines":[{"line_number":1507,"context_line":"        self.assertEqual(mock_update_usage.call_count, 1)"},{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_ce26c366","line":1510,"in_reply_to":"da20952f_6ce8edb3","updated":"2015-09-11 16:00:23.000000000","message":"Have to agree, this is easy to insert directly into the test method, and is only two lines long with my suggested change below…","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1507,"context_line":"        self.assertEqual(mock_update_usage.call_count, 1)"},{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_fa36e1b2","line":1510,"in_reply_to":"da20952f_ce26c366","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"950afe7e83f83d944199a468cb162aeebfcea542","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_6e72177e","line":1511,"updated":"2015-09-11 16:00:23.000000000","message":"And again, I recommend avoiding the usage of \u0027_\u0027; here, subscription appears to be the best option:\n\n    args \u003d mock_update_usage.call_args[0]\n    migration \u003d args[3]\n\nOr, perhaps better:\n\n    migration \u003d mock_update_usage.call_args[0][3]","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"513f4282d334ed495e393c9ca41fce4d1ffbad69","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"        self._assert_called_with_migration_id(mock_update_usage, 2003)"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"    def _assert_called_with_migration_id(self, mock_update_usage, expected_id):"},{"line_number":1511,"context_line":"        args, _ \u003d mock_update_usage.call_args"},{"line_number":1512,"context_line":"        _, _, _, migration \u003d args"},{"line_number":1513,"context_line":"        self.assertEqual(migration.id, expected_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_da419d0b","line":1511,"in_reply_to":"da20952f_6e72177e","updated":"2015-09-11 17:52:59.000000000","message":"Done","commit_id":"8613783d5db33ccb9ffc6db0e9a512afc118babf"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d7790731491d4408db2b332c9b2a3c9b09750a83","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"            instance_uuid\u003dinstance.uuid,"},{"line_number":1474,"context_line":"        )"},{"line_number":1475,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1476,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"},{"line_number":1477,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1478,"context_line":""},{"line_number":1479,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_da83ddc9","line":1476,"updated":"2015-09-11 18:10:38.000000000","message":"Can you use mock.assert_called_once_with(..) here? That would be much more consistent with most of our other tests, and would mean you\u0027re also checking the args.","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"20c1eb18b5d572c76d2a8b9b32297095255b2133","unresolved":false,"context_lines":[{"line_number":1473,"context_line":"            instance_uuid\u003dinstance.uuid,"},{"line_number":1474,"context_line":"        )"},{"line_number":1475,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1476,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"},{"line_number":1477,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1478,"context_line":""},{"line_number":1479,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_5b5e70ea","line":1476,"in_reply_to":"da20952f_da83ddc9","updated":"2015-09-14 15:40:27.000000000","message":"Done","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d7790731491d4408db2b332c9b2a3c9b09750a83","unresolved":false,"context_lines":[{"line_number":1474,"context_line":"        )"},{"line_number":1475,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1476,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"},{"line_number":1477,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1478,"context_line":""},{"line_number":1479,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"},{"line_number":1480,"context_line":"                       \u0027_update_usage_from_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_9a51e564","line":1477,"updated":"2015-09-11 18:10:38.000000000","message":"And here, the more conventional thing for nova tests would be:\n\n  self.assertFalse(mock_update_usage.called)","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"20c1eb18b5d572c76d2a8b9b32297095255b2133","unresolved":false,"context_lines":[{"line_number":1474,"context_line":"        )"},{"line_number":1475,"context_line":"        self.tracker._update_usage_from_migrations(self.context, [migration])"},{"line_number":1476,"context_line":"        self.assertEqual(mock_get_instance.call_count, 1)"},{"line_number":1477,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1478,"context_line":""},{"line_number":1479,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"},{"line_number":1480,"context_line":"                       \u0027_update_usage_from_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_9b55e8c7","line":1477,"in_reply_to":"da20952f_9a51e564","updated":"2015-09-14 15:40:27.000000000","message":"Done","commit_id":"1d2c27c170413f8c05966ca1241c280404f519c4"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"48eb5f8b7c6c480f68243b61abb1a00c56893bdf","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"    def test_no_migrations(self, mock_update_usage):"},{"line_number":1415,"context_line":"        migrations \u003d []"},{"line_number":1416,"context_line":"        self.tracker._update_usage_from_migrations(self.context, migrations)"},{"line_number":1417,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1418,"context_line":""},{"line_number":1419,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"},{"line_number":1420,"context_line":"                       \u0027_update_usage_from_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_cc48af8a","line":1417,"updated":"2015-09-12 10:17:00.000000000","message":"nit, There should be \"self.assertEqual(0, mock_update_usage.call_count)\"\n\nThe first argument is expected value, the second argument is actual value.\n\nall the assertEqual in this patch looks like need correct.","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"a6d91bfa232173af5676007dd6bb893520192e7b","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"    def test_no_migrations(self, mock_update_usage):"},{"line_number":1415,"context_line":"        migrations \u003d []"},{"line_number":1416,"context_line":"        self.tracker._update_usage_from_migrations(self.context, migrations)"},{"line_number":1417,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1418,"context_line":""},{"line_number":1419,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"},{"line_number":1420,"context_line":"                       \u0027_update_usage_from_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_3b14dcf3","line":1417,"in_reply_to":"ba15a1d1_cc48af8a","updated":"2015-09-14 15:41:07.000000000","message":"Done","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c4b1ed60554e9a28b330a0921ece9914030d82eb","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"    def test_no_migrations(self, mock_update_usage):"},{"line_number":1415,"context_line":"        migrations \u003d []"},{"line_number":1416,"context_line":"        self.tracker._update_usage_from_migrations(self.context, migrations)"},{"line_number":1417,"context_line":"        self.assertEqual(mock_update_usage.call_count, 0)"},{"line_number":1418,"context_line":""},{"line_number":1419,"context_line":"    @mock.patch.object(resource_tracker.ResourceTracker,"},{"line_number":1420,"context_line":"                       \u0027_update_usage_from_migration\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_9a8de933","line":1417,"in_reply_to":"ba15a1d1_cc48af8a","updated":"2015-09-14 13:52:50.000000000","message":"ah, right, I asked for these in a previous set and then got caught up with the functional change and forgot.","commit_id":"097c220110ee5e6e205fcf2946e69788a30ad1e7"}]}
