)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch changes get_allocations_for_resource_provider to return None"},{"line_number":14,"context_line":"in case of error instead of an empty dict. This is in line with"},{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_4155eac0","line":15,"range":{"start_line":15,"start_character":25,"end_line":15,"end_character":29},"updated":"2019-11-25 16:36:08.000000000","message":"make","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch changes get_allocations_for_resource_provider to return None"},{"line_number":14,"context_line":"in case of error instead of an empty dict. This is in line with"},{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_8b967fa0","line":15,"range":{"start_line":15,"start_character":25,"end_line":15,"end_character":29},"in_reply_to":"3fa7e38b_4155eac0","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This patch changes get_allocations_for_resource_provider to return None"},{"line_number":14,"context_line":"in case of error instead of an empty dict. This is in line with"},{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"},{"line_number":19,"context_line":"checking for None and converting it to an empty dict so from that caller"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_01737281","line":16,"range":{"start_line":16,"start_character":49,"end_line":16,"end_character":53},"updated":"2019-11-25 16:36:08.000000000","message":"is changed","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"This patch changes get_allocations_for_resource_provider to return None"},{"line_number":14,"context_line":"in case of error instead of an empty dict. This is in line with"},{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"},{"line_number":19,"context_line":"checking for None and converting it to an empty dict so from that caller"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_ab9b3bc6","line":16,"range":{"start_line":16,"start_character":49,"end_line":16,"end_character":53},"in_reply_to":"3fa7e38b_01737281","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"},{"line_number":19,"context_line":"checking for None and converting it to an empty dict so from that caller"},{"line_number":20,"context_line":"perspective this is compatible change on the report client."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_a1be1ed1","line":18,"range":{"start_line":18,"start_character":6,"end_line":18,"end_character":12},"updated":"2019-11-25 16:36:08.000000000","message":"OK and that other caller was ResourceTracker._remove_deleted_instances_allocations:\n\nhttps://github.com/openstack/nova/blob/18.0.0/nova/compute/resource_tracker.py#L1277","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"},{"line_number":19,"context_line":"checking for None and converting it to an empty dict so from that caller"},{"line_number":20,"context_line":"perspective this is compatible change on the report client."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_216eae95","line":18,"range":{"start_line":18,"start_character":54,"end_line":18,"end_character":57},"updated":"2019-11-25 16:36:08.000000000","message":"was","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":15,"context_line":"@safe_connect that would made the call return None as well. The"},{"line_number":16,"context_line":"_error_out_instances_whose_build_was_interrupted also changed to check"},{"line_number":17,"context_line":"for None instead of empty dict before reporting the ERROR. The only"},{"line_number":18,"context_line":"other caller of get_allocations_for_resource_provider has already"},{"line_number":19,"context_line":"checking for None and converting it to an empty dict so from that caller"},{"line_number":20,"context_line":"perspective this is compatible change on the report client."},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_0baa8fd2","line":18,"range":{"start_line":18,"start_character":54,"end_line":18,"end_character":57},"in_reply_to":"3fa7e38b_216eae95","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"perspective this is compatible change on the report client."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This is stable only change as get_allocations_for_resource_provider was"},{"line_number":23,"context_line":"improved during stein to raise on placement error."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: I6042e493144d4d5a29ec6ab23ffed6b3e7f385fe"},{"line_number":26,"context_line":"Closes-Bug: #1852759"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_810442c7","line":23,"range":{"start_line":23,"start_character":16,"end_line":23,"end_character":21},"updated":"2019-11-25 16:36:08.000000000","message":"stein [1]\n\n...\n\n[1] I020e7dc47efc79f8907b7bfb753ec779a8da69a1","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"perspective this is compatible change on the report client."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"This is stable only change as get_allocations_for_resource_provider was"},{"line_number":23,"context_line":"improved during stein to raise on placement error."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: I6042e493144d4d5a29ec6ab23ffed6b3e7f385fe"},{"line_number":26,"context_line":"Closes-Bug: #1852759"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3fa7e38b_ebb05343","line":23,"range":{"start_line":23,"start_character":16,"end_line":23,"end_character":21},"in_reply_to":"3fa7e38b_810442c7","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"}],"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"            f \u003d self.reportclient.get_allocations_for_resource_provider"},{"line_number":1326,"context_line":"            allocations \u003d f(context, cn_uuid)"},{"line_number":1327,"context_line":"            if allocations is None:"},{"line_number":1328,"context_line":"                LOG.error("},{"line_number":1329,"context_line":"                    \"Could not retrieve compute node resource provider %s and \""},{"line_number":1330,"context_line":"                    \"therefore unable to error out any instances stuck in \""},{"line_number":1331,"context_line":"                    \"BUILDING state.\", cn_uuid)"},{"line_number":1332,"context_line":"                continue"},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"            not_handled_consumers \u003d (set(allocations) -"},{"line_number":1335,"context_line":"                                     already_handled_instances)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_e16df666","line":1332,"range":{"start_line":1328,"start_character":16,"end_line":1332,"end_character":24},"updated":"2019-11-25 16:36:08.000000000","message":"I ran \"tox -e cover -- test_compute_mgr\" and there is apparently no test coverage of this (was there before?). The new test is asserting that we\u0027re not logging the error message when the allocations are {} but nothing is asserting the None behavior which probably important in case something changes in this code later.","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"            f \u003d self.reportclient.get_allocations_for_resource_provider"},{"line_number":1326,"context_line":"            allocations \u003d f(context, cn_uuid)"},{"line_number":1327,"context_line":"            if allocations is None:"},{"line_number":1328,"context_line":"                LOG.error("},{"line_number":1329,"context_line":"                    \"Could not retrieve compute node resource provider %s and \""},{"line_number":1330,"context_line":"                    \"therefore unable to error out any instances stuck in \""},{"line_number":1331,"context_line":"                    \"BUILDING state.\", cn_uuid)"},{"line_number":1332,"context_line":"                continue"},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"            not_handled_consumers \u003d (set(allocations) -"},{"line_number":1335,"context_line":"                                     already_handled_instances)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cbeb17db","line":1332,"range":{"start_line":1328,"start_character":16,"end_line":1332,"end_character":24},"in_reply_to":"3fa7e38b_e16df666","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0659c315b1d313b1320f7bfad491f63dbf2bd2b","unresolved":false,"context_lines":[{"line_number":1938,"context_line":"        url \u003d \u0027/resource_providers/%s/allocations\u0027 % rp_uuid"},{"line_number":1939,"context_line":"        resp \u003d self.get(url, global_request_id\u003dcontext.global_id)"},{"line_number":1940,"context_line":"        if not resp:"},{"line_number":1941,"context_line":"            return None"},{"line_number":1942,"context_line":"        else:"},{"line_number":1943,"context_line":"            return resp.json()[\u0027allocations\u0027]"},{"line_number":1944,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_c1fd5ab2","line":1941,"updated":"2019-11-25 16:36:08.000000000","message":"A comment would be good here. Something along the lines of, \"The request failed with an error response. Rather than return an empty dict, which is possible if there are no allocations against the given provider, return None to indicate a failure - like in the @safe_connect decorator.\"","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93e99a2eee5ef635d1fb26d353f0b26d802b8f0a","unresolved":false,"context_lines":[{"line_number":1938,"context_line":"        url \u003d \u0027/resource_providers/%s/allocations\u0027 % rp_uuid"},{"line_number":1939,"context_line":"        resp \u003d self.get(url, global_request_id\u003dcontext.global_id)"},{"line_number":1940,"context_line":"        if not resp:"},{"line_number":1941,"context_line":"            return None"},{"line_number":1942,"context_line":"        else:"},{"line_number":1943,"context_line":"            return resp.json()[\u0027allocations\u0027]"},{"line_number":1944,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_2b90ab96","line":1941,"in_reply_to":"3fa7e38b_c1fd5ab2","updated":"2019-11-27 12:55:09.000000000","message":"Done","commit_id":"40eaaf080c2e76a1e6afd0254606f0cd2d9bc03f"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"356c24eadc2acf912f0e3d8c4ea5573c0b74f11b","unresolved":false,"context_lines":[{"line_number":1017,"context_line":"                \u0027get_allocations_for_resource_provider\u0027)"},{"line_number":1018,"context_line":"    @mock.patch.object(objects.ComputeNode, \u0027get_by_host_and_nodename\u0027)"},{"line_number":1019,"context_line":"    @mock.patch.object(fake_driver.FakeDriver, \u0027get_available_nodes\u0027)"},{"line_number":1020,"context_line":"    def test_init_host_with_interrupted_instance_build_placement_error("},{"line_number":1021,"context_line":"            self, mock_get_nodes, mock_get_by_host_and_node,"},{"line_number":1022,"context_line":"            mock_get_allocations, mock_get_instances, mock_instance_save,"},{"line_number":1023,"context_line":"            mock_log):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_e5a14daa","line":1020,"range":{"start_line":1020,"start_character":8,"end_line":1020,"end_character":70},"updated":"2019-11-28 13:51:07.000000000","message":"nit: could have probably DRY\u0027ed up this and the test above with a private method and just control the assertions based on what mock_get_allocations returns but it\u0027s not a big deal.","commit_id":"64f797a0514b0276540d4f6c28cb290383088e35"}]}
