)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d047e34497a84a537c38e1c2f3ec683648039cd4","unresolved":false,"context_lines":[{"line_number":10,"context_line":"at the allocation that is made in placement as well as the traits of"},{"line_number":11,"context_line":"the used providers. So far these were explicit placement calls. However"},{"line_number":12,"context_line":"it turns out that the Selection object already contains the allocation"},{"line_number":13,"context_line":"data so one of the extra placement call can be removed."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch replaces the GET /allocations/\u003cuuid\u003e placement call from"},{"line_number":16,"context_line":"conductor build instance codepath with the usage of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5fc1f717_337783d7","line":13,"range":{"start_line":13,"start_character":35,"end_line":13,"end_character":39},"updated":"2019-03-08 16:56:14.000000000","message":"calls","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a612e9a25d833ac1a535f73e322446198d04eedc","unresolved":false,"context_lines":[{"line_number":10,"context_line":"at the allocation that is made in placement as well as the traits of"},{"line_number":11,"context_line":"the used providers. So far these were explicit placement calls. However"},{"line_number":12,"context_line":"it turns out that the Selection object already contains the allocation"},{"line_number":13,"context_line":"data so one of the extra placement call can be removed."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch replaces the GET /allocations/\u003cuuid\u003e placement call from"},{"line_number":16,"context_line":"conductor build instance codepath with the usage of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5fc1f717_46ed8f23","line":13,"range":{"start_line":13,"start_character":35,"end_line":13,"end_character":39},"in_reply_to":"5fc1f717_337783d7","updated":"2019-03-11 11:55:16.000000000","message":"Done","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"}],"nova/conductor/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d047e34497a84a537c38e1c2f3ec683648039cd4","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"                    inst.destroy()"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    def _fill_provider_mapping("},{"line_number":1268,"context_line":"            self, context, instance_uuid, request_spec, host_selection):"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        \"\"\"Fills out the request group - resource provider mapping in the"},{"line_number":1271,"context_line":"        request spec."}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_1355a71d","line":1268,"range":{"start_line":1268,"start_character":56,"end_line":1268,"end_character":70},"updated":"2019-03-08 16:56:14.000000000","message":"Would be nice to take this opportunity to document the parameters and their types to this method.","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"46ea59a93b146f665599de2c27980cde3541c9e5","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"                    inst.destroy()"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    def _fill_provider_mapping("},{"line_number":1268,"context_line":"            self, context, instance_uuid, request_spec, host_selection):"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":"        \"\"\"Fills out the request group - resource provider mapping in the"},{"line_number":1271,"context_line":"        request spec."}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_6b4414b8","line":1268,"range":{"start_line":1268,"start_character":56,"end_line":1268,"end_character":70},"in_reply_to":"5fc1f717_1355a71d","updated":"2019-03-11 11:55:04.000000000","message":"Done","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d047e34497a84a537c38e1c2f3ec683648039cd4","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"        if not request_spec.maps_requested_resources:"},{"line_number":1284,"context_line":"            return"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        ar \u003d jsonutils.loads(host_selection.allocation_request)"},{"line_number":1287,"context_line":"        if not ar:"},{"line_number":1288,"context_line":"            # Technically out-of-tree scheduler drivers can still not create"},{"line_number":1289,"context_line":"            # allocations in placement so move on if there are no allocations"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_933516dd","line":1286,"updated":"2019-03-08 16:56:14.000000000","message":"Two things here:\n\n1. I think I noted in the original review that while all in-tree scheduler drivers are using placement now, there is the chance that out of tree scheduler drivers are not, which would mean the Selection.allocation_request is None. However, you can only get here if the check above passes meaning someone is using a request which requires placement, so they can\u0027t even make that type of request unless placement is involved, so it\u0027s probably safe to assume if we get this far, the scheduler is using placement.\n\n2. The other thing is allocation_request is a PUT /allocations/{consumer_id} request and while PUT and GET have the same format, they could technically drift at some point which could break this code, but if that happens we have the Selection.allocation_request_version value to massage the data back to the format we need. I\u0027m not sure if you want to leave a note about this little caveat or not. It should be pretty rare if this breaks at some point so maybe a note is asking too much.","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"46ea59a93b146f665599de2c27980cde3541c9e5","unresolved":false,"context_lines":[{"line_number":1283,"context_line":"        if not request_spec.maps_requested_resources:"},{"line_number":1284,"context_line":"            return"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        ar \u003d jsonutils.loads(host_selection.allocation_request)"},{"line_number":1287,"context_line":"        if not ar:"},{"line_number":1288,"context_line":"            # Technically out-of-tree scheduler drivers can still not create"},{"line_number":1289,"context_line":"            # allocations in placement so move on if there are no allocations"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_4b2fd8a0","line":1286,"in_reply_to":"5fc1f717_933516dd","updated":"2019-03-11 11:55:04.000000000","message":"#1) Good point. I dropped this extra if and added a note instead\n#2) I added a note","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d047e34497a84a537c38e1c2f3ec683648039cd4","unresolved":false,"context_lines":[{"line_number":1284,"context_line":"            return"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        ar \u003d jsonutils.loads(host_selection.allocation_request)"},{"line_number":1287,"context_line":"        if not ar:"},{"line_number":1288,"context_line":"            # Technically out-of-tree scheduler drivers can still not create"},{"line_number":1289,"context_line":"            # allocations in placement so move on if there are no allocations"},{"line_number":1290,"context_line":"            # for the instance."},{"line_number":1291,"context_line":"            LOG.debug(\u0027No allocations found for instance after scheduling. \u0027"},{"line_number":1292,"context_line":"                      \u0027Assuming the scheduler driver is not using Placement.\u0027,"},{"line_number":1293,"context_line":"                      instance_uuid\u003dinstance_uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_b345b245","line":1290,"range":{"start_line":1287,"start_character":8,"end_line":1290,"end_character":31},"updated":"2019-03-08 16:56:14.000000000","message":"Yeah so this is issue #1 above - if that\u0027s the case, we\u0027d blow up by the time we got here because allocation_request will be None.\n\n\u003e\u003e\u003e import json\n\u003e\u003e\u003e json.loads(None)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/usr/lib/python2.7/json/__init__.py\", line 339, in loads\n    return _default_decoder.decode(s)\n  File \"/usr/lib/python2.7/json/decoder.py\", line 364, in decode\n    obj, end \u003d self.raw_decode(s, idx\u003d_w(s, 0).end())\nTypeError: expected string or buffer\n\n\nSo if you leave this in here, you need to check host_selection.allocation_request before trying to deserialize it.","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"46ea59a93b146f665599de2c27980cde3541c9e5","unresolved":false,"context_lines":[{"line_number":1284,"context_line":"            return"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"        ar \u003d jsonutils.loads(host_selection.allocation_request)"},{"line_number":1287,"context_line":"        if not ar:"},{"line_number":1288,"context_line":"            # Technically out-of-tree scheduler drivers can still not create"},{"line_number":1289,"context_line":"            # allocations in placement so move on if there are no allocations"},{"line_number":1290,"context_line":"            # for the instance."},{"line_number":1291,"context_line":"            LOG.debug(\u0027No allocations found for instance after scheduling. \u0027"},{"line_number":1292,"context_line":"                      \u0027Assuming the scheduler driver is not using Placement.\u0027,"},{"line_number":1293,"context_line":"                      instance_uuid\u003dinstance_uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_66644be5","line":1290,"range":{"start_line":1287,"start_character":8,"end_line":1290,"end_character":31},"in_reply_to":"5fc1f717_b345b245","updated":"2019-03-11 11:55:04.000000000","message":"Done","commit_id":"91e700426b2ce5160d0877576c7265b983a2b29b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9658dc7badaee7754656fa96b1f3bc17b0f9e81b","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"        :param context: The security context"},{"line_number":1282,"context_line":"        :param instance_uuid: The UUID of the instance for which the provider"},{"line_number":1283,"context_line":"            mapping is filled"},{"line_number":1284,"context_line":"        :param request_spec: The RequestSpec object associated with the boot"},{"line_number":1285,"context_line":"            request"},{"line_number":1286,"context_line":"        :param host_selection: The Selection object returned by the scheduler"},{"line_number":1287,"context_line":"            for this boot request"},{"line_number":1288,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"5fc1f717_b7233f05","line":1285,"range":{"start_line":1284,"start_character":72,"end_line":1285,"end_character":19},"updated":"2019-03-11 14:35:35.000000000","message":"nit: future proof this by just saying \"operation\"","commit_id":"a036359b7d718b0e762cd6a91807af6a6390a07d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9658dc7badaee7754656fa96b1f3bc17b0f9e81b","unresolved":false,"context_lines":[{"line_number":1284,"context_line":"        :param request_spec: The RequestSpec object associated with the boot"},{"line_number":1285,"context_line":"            request"},{"line_number":1286,"context_line":"        :param host_selection: The Selection object returned by the scheduler"},{"line_number":1287,"context_line":"            for this boot request"},{"line_number":1288,"context_line":"        \"\"\""},{"line_number":1289,"context_line":"        # Exit early if this request spec does not require mappings."},{"line_number":1290,"context_line":"        if not request_spec.maps_requested_resources:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5fc1f717_771dd7bb","line":1287,"range":{"start_line":1287,"start_character":21,"end_line":1287,"end_character":33},"updated":"2019-03-11 14:35:35.000000000","message":"same","commit_id":"a036359b7d718b0e762cd6a91807af6a6390a07d"}]}
