)]}'
{"nova/scheduler/client/report.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a2309d8d4bf601dd7adfbe2f97d75160bd134b62","unresolved":false,"context_lines":[{"line_number":756,"context_line":"        if curr is None:"},{"line_number":757,"context_line":"            return None"},{"line_number":758,"context_line":""},{"line_number":759,"context_line":"        LOG.debug(\u0027Updating ProviderTree inventory for provider %s from \u0027"},{"line_number":760,"context_line":"                  \u0027_refresh_and_get_inventory using data: %s\u0027, rp_uuid,"},{"line_number":761,"context_line":"                  curr[\u0027inventories\u0027])"},{"line_number":762,"context_line":"        self._provider_tree.update_inventory("},{"line_number":763,"context_line":"            rp_uuid, curr[\u0027inventories\u0027],"},{"line_number":764,"context_line":"            generation\u003dcurr[\u0027resource_provider_generation\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_632f50a6","line":761,"range":{"start_line":759,"start_character":0,"end_line":761,"end_character":38},"updated":"2018-10-22 13:55:24.000000000","message":"This...","commit_id":"ade240b392563914c1bddc228a3eb00585177d4c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a2309d8d4bf601dd7adfbe2f97d75160bd134b62","unresolved":false,"context_lines":[{"line_number":967,"context_line":"        # Update our view of the generation for next time"},{"line_number":968,"context_line":"        updated_inventories_result \u003d result.json()"},{"line_number":969,"context_line":"        new_gen \u003d updated_inventories_result[\u0027resource_provider_generation\u0027]"},{"line_number":970,"context_line":"        LOG.debug(\u0027Updating ProviderTree inventory for provider %s with \u0027"},{"line_number":971,"context_line":"                  \u0027generation %s from _update_inventory_attempt with data: \u0027"},{"line_number":972,"context_line":"                  \u0027%s\u0027, rp_uuid, new_gen, inv_data)"},{"line_number":973,"context_line":"        self._provider_tree.update_inventory(rp_uuid, inv_data,"},{"line_number":974,"context_line":"                                             generation\u003dnew_gen)"},{"line_number":975,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_06046a13","line":972,"range":{"start_line":970,"start_character":0,"end_line":972,"end_character":51},"updated":"2018-10-22 13:55:24.000000000","message":"...and this...","commit_id":"ade240b392563914c1bddc228a3eb00585177d4c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a2309d8d4bf601dd7adfbe2f97d75160bd134b62","unresolved":false,"context_lines":[{"line_number":1133,"context_line":"        resp \u003d do_put(url, payload)"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":1136,"context_line":"            LOG.debug(\u0027Updated inventory for provider %s with generation %s \u0027"},{"line_number":1137,"context_line":"                      \u0027in Placement from _set_inventory_for_provider using \u0027"},{"line_number":1138,"context_line":"                      \u0027data: %s\u0027, rp_uuid, generation, inv_data)"},{"line_number":1139,"context_line":"            json \u003d resp.json()"},{"line_number":1140,"context_line":"            self._provider_tree.update_inventory("},{"line_number":1141,"context_line":"                rp_uuid, json[\u0027inventories\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_066b0ab9","line":1138,"range":{"start_line":1136,"start_character":0,"end_line":1138,"end_character":64},"updated":"2018-10-22 13:55:24.000000000","message":"...and this appear to be redundant with the message you added in update_inventory itself, except when that method detects no change. So the only value this adds is telling us which code path is taken to check has_inventory_changed. IMO, we could leave these out.","commit_id":"ade240b392563914c1bddc228a3eb00585177d4c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fc186d5d9eb9550b4b3795ed995f9a203892b0ef","unresolved":false,"context_lines":[{"line_number":1133,"context_line":"        resp \u003d do_put(url, payload)"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":1136,"context_line":"            LOG.debug(\u0027Updated inventory for provider %s with generation %s \u0027"},{"line_number":1137,"context_line":"                      \u0027in Placement from _set_inventory_for_provider using \u0027"},{"line_number":1138,"context_line":"                      \u0027data: %s\u0027, rp_uuid, generation, inv_data)"},{"line_number":1139,"context_line":"            json \u003d resp.json()"},{"line_number":1140,"context_line":"            self._provider_tree.update_inventory("},{"line_number":1141,"context_line":"                rp_uuid, json[\u0027inventories\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_699971cd","line":1138,"range":{"start_line":1136,"start_character":0,"end_line":1138,"end_character":64},"in_reply_to":"3f79a3b5_066b0ab9","updated":"2018-10-22 14:33:18.000000000","message":"When I was debugging the bug linked in the commit message, CI was failing for both the libvirt and xenapi drivers, which go down different paths in the RT to call methods here in the report client, and we have mostly redundant code but it\u0027s hard to tell without logs, so yes part of the debug is knowing which path we\u0027re taking and the other big difference here is we\u0027re logging the actual inventory payload we\u0027re sending, because it was critical to know when we were sending cpu_allocation_ratio\u003d0.0 to placement, which we don\u0027t get in the placement logs because we don\u0027t log the request body, just the URL path and headers.","commit_id":"ade240b392563914c1bddc228a3eb00585177d4c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4cca465eb93fc78d7184655ef357259cd586a5f1","unresolved":false,"context_lines":[{"line_number":1133,"context_line":"        resp \u003d do_put(url, payload)"},{"line_number":1134,"context_line":""},{"line_number":1135,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":1136,"context_line":"            LOG.debug(\u0027Updated inventory for provider %s with generation %s \u0027"},{"line_number":1137,"context_line":"                      \u0027in Placement from _set_inventory_for_provider using \u0027"},{"line_number":1138,"context_line":"                      \u0027data: %s\u0027, rp_uuid, generation, inv_data)"},{"line_number":1139,"context_line":"            json \u003d resp.json()"},{"line_number":1140,"context_line":"            self._provider_tree.update_inventory("},{"line_number":1141,"context_line":"                rp_uuid, json[\u0027inventories\u0027],"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_31195e75","line":1138,"range":{"start_line":1136,"start_character":0,"end_line":1138,"end_character":64},"in_reply_to":"3f79a3b5_699971cd","updated":"2018-10-24 20:12:02.000000000","message":"\u003e and the other big difference here is we\u0027re logging the\n \u003e actual inventory payload we\u0027re sending\n\nJust so I\u0027m clear: update_inventory is getting (and logging) the inventory data from the *response*, which has all the fields filled in, whereas the *request* may leave some fields out, resulting in placement setting those as defaults. Is that why the difference matters?\n\n \u003e so yes part of the debug is knowing which path we\u0027re\n \u003e taking\n\nI can buy that. We could do some inspect magic in update_inventory to get that same information, but I agree the noisiness/duplication in the logs is probably the lesser evil there.","commit_id":"ade240b392563914c1bddc228a3eb00585177d4c"}]}
