)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6b255129ac6c816fe50ad48a26fa625841f1d327","unresolved":false,"context_lines":[{"line_number":15,"context_line":"hosts to the compute node as Selection object. The Selection object includes"},{"line_number":16,"context_line":"the json dict of allocation object. That means if a try of instance building"},{"line_number":17,"context_line":"happened in the middle of upgrade, the old format allocation json dict will"},{"line_number":18,"context_line":"send back to the new version scheduler. So the claim_resources method still"},{"line_number":19,"context_line":"needs to support old version allocation json format."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I4314ade528c9cb69bbf6c55d31566e1e188fef09"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7f96bb07_58a54246","line":18,"range":{"start_line":18,"start_character":29,"end_line":18,"end_character":38},"updated":"2018-01-24 14:21:16.000000000","message":"nit: it\u0027s really the cell conductor, but that\u0027s OK.\n\nhttps://github.com/openstack/nova/blob/87ea686f9f2cc706205d188922bb14272625e7be/nova/conductor/manager.py#L627\n\nThe point of the Selection objects and the alternates is that the cell conductor can\u0027t reach the scheduler over RPC, so we have to figure out the alternates within the cell at the top before the build request is sent to the first chosen compute in a cell. Then the retries happen within the cell using the list of alternates, never going back up to the scheduler.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b9adea2024f6311cd7e127c744cd056a8aaa2d6a","unresolved":false,"context_lines":[{"line_number":15,"context_line":"hosts to the compute node as Selection object. The Selection object includes"},{"line_number":16,"context_line":"the json dict of allocation object. That means if a try of instance building"},{"line_number":17,"context_line":"happened in the middle of upgrade, the old format allocation json dict will"},{"line_number":18,"context_line":"send back to the new version scheduler. So the claim_resources method still"},{"line_number":19,"context_line":"needs to support old version allocation json format."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: I4314ade528c9cb69bbf6c55d31566e1e188fef09"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7f96bb07_eee9e419","line":18,"range":{"start_line":18,"start_character":29,"end_line":18,"end_character":38},"in_reply_to":"7f96bb07_58a54246","updated":"2018-01-24 15:04:30.000000000","message":"emm....yea, right, it should be the cell conductor.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"39cdf9f0bb6029ac12bc7090ccd756900aeff10b","unresolved":false,"context_lines":[{"line_number":1149,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.10"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_0af25107","line":1152,"range":{"start_line":1152,"start_character":21,"end_line":1152,"end_character":25},"updated":"2018-01-22 12:18:24.000000000","message":"^","commit_id":"cdda7b4f31235322d73eda98142879dee1182719"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ec2cf7050c899d4b5f5a3c6b4adc1f220ac7dd4c","unresolved":false,"context_lines":[{"line_number":1148,"context_line":"                                           allocations."},{"line_number":1149,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.10"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_180e0fe5","line":1152,"range":{"start_line":1151,"start_character":8,"end_line":1152,"end_character":25},"updated":"2018-01-23 07:25:29.000000000","message":"update here to","commit_id":"6bc41affb53a331419e81f8f4cec737515b34623"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b24bfde719c05023f9a771d418a51fec23eda69","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_2eacde33","line":201,"range":{"start_line":201,"start_character":18,"end_line":201,"end_character":23},"updated":"2018-01-23 13:54:35.000000000","message":"nit: set() seems to be unnecessary","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3dd9579343df6120138e8605bf148ea654f6bb33","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_469edbb8","line":201,"range":{"start_line":201,"start_character":18,"end_line":201,"end_character":23},"in_reply_to":"7f96bb07_2eacde33","updated":"2018-01-23 22:02:34.000000000","message":"I assume the set is used in the case of separate allocation requests against a shared provider, like a shared storage provider, see the example in the API reference:\n\nhttps://developer.openstack.org/api-ref/placement/#response-example-microversions-1-12\n\nThere are two allocation candidates in the list and they each have a shared DISK_GB provider.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"96786e7042d62dc7e5d4359dcf0d44fd4d9cbb55","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_ce2bd3e8","line":201,"range":{"start_line":201,"start_character":18,"end_line":201,"end_character":23},"in_reply_to":"7f96bb07_469edbb8","updated":"2018-01-24 11:47:15.000000000","message":"The dest_alloc_req[\u0027allocations\u0027].keys() already returns a unique key set containing rp uuids so in your example there would be two different rp uuids in the set.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3dd9579343df6120138e8605bf148ea654f6bb33","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            # decrementing any old allocations as necessary, the scheduler"},{"line_number":221,"context_line":"            # shouldn\u0027t make assumptions about that."},{"line_number":222,"context_line":"            scheduler_utils.merge_resources("},{"line_number":223,"context_line":"                new_alloc_req[\u0027allocations\u0027][rp_uuid][\u0027resources\u0027],"},{"line_number":224,"context_line":"                dest_alloc_req[\u0027allocations\u0027][rp_uuid][\u0027resources\u0027])"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    LOG.debug(\"New allocation_request containing both source and \""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_c6c66b4a","line":223,"range":{"start_line":223,"start_character":16,"end_line":223,"end_character":29},"updated":"2018-01-23 22:02:34.000000000","message":"This seems a bit weird, why isn\u0027t this using current_allocs?","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a0e057e86e9418dc3c17196858369a99646b735a","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            # decrementing any old allocations as necessary, the scheduler"},{"line_number":221,"context_line":"            # shouldn\u0027t make assumptions about that."},{"line_number":222,"context_line":"            scheduler_utils.merge_resources("},{"line_number":223,"context_line":"                new_alloc_req[\u0027allocations\u0027][rp_uuid][\u0027resources\u0027],"},{"line_number":224,"context_line":"                dest_alloc_req[\u0027allocations\u0027][rp_uuid][\u0027resources\u0027])"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    LOG.debug(\"New allocation_request containing both source and \""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_d23dbfdd","line":223,"range":{"start_line":223,"start_character":16,"end_line":223,"end_character":29},"in_reply_to":"7f96bb07_c6c66b4a","updated":"2018-01-24 04:38:36.000000000","message":"new_alloc_req and current_allocs reference to the same dict obj, so I think they are same.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3dd9579343df6120138e8605bf148ea654f6bb33","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.12"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"},{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_c6450b17","line":1153,"updated":"2018-01-23 22:02:34.000000000","message":"We run the risk here that a client has sent an older version format and _move_operation_alloc_request could break. Since we don\u0027t persist allocation candidate requests, the only way I think this could happen is if we were in the middle of a server create / cold migrate operation where the Selection objects were all created with the 1.10 format, then we upgraded the code and restarted the nova-conductor service, a build fails in a compute and sends the alternates back to the conductor which then calls claim_resources with the old format and blows up.\n\nSo there is a possibility that this could not work, which is a risk that we take by not checking for both the old and new format and dealing with them both in a common way, like with a versioned object for example (that would have been really nice right about now).","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a0e057e86e9418dc3c17196858369a99646b735a","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.12"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"},{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_85d7ef4f","line":1153,"in_reply_to":"7f96bb07_0814619f","updated":"2018-01-24 04:38:36.000000000","message":"We are ok for the cold migration and live migration, since they didn\u0027t return alternates.\n\nThe case you pointed out, probably will happened in the scheduling rety.\n\nWhen the boot request with alternate hosts send to the compute node, then we upgrade the whole control plane(not only the conductor, also the scheduler), then the compute node build failed, send the retry back to the scheduler, then allocation_request dict in the Selection object will be the old format.\n\nSo I will add check for the request version, if the version less than 1.12, I will convert it to the new format.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a23b44654225f7fa7b13b97da0a102b2d39d1b7c","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.12"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"},{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_38e1569c","line":1153,"in_reply_to":"7f96bb07_85d7ef4f","updated":"2018-01-24 14:15:50.000000000","message":"\u003e We are ok for the cold migration and live migration, since they didn\u0027t return alternates.\n\nFor cold migrate, it will once this merges:\n\nhttps://review.openstack.org/#/c/526436/","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9e1650c075931ce3462680be3a52a53de754d7f1","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.12"},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.12\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"},{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_0814619f","line":1153,"in_reply_to":"7f96bb07_c6450b17","updated":"2018-01-23 22:36:14.000000000","message":"Could we add a simple shim such that we check if the \u0027allocations\u0027 value in the request is a list or a dict and if it\u0027s not a dict, we know it\u0027s the old format and we have to transform it to the new 1.12 format? Then anything that gets an allocation request and we\u0027re not sure what format it might be in, we run it through the TRANSFORMATRON 5000 before passing it onto something else that expects the 1.12 format, like _move_operation_alloc_request.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b24bfde719c05023f9a771d418a51fec23eda69","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                                            resources, -1)"},{"line_number":1262,"context_line":"            LOG.debug(\u0027Subtracting old resources from same-host \u0027"},{"line_number":1263,"context_line":"                      \u0027allocation: %s\u0027, peer_alloc[rp_uuid][\u0027resources\u0027])"},{"line_number":1264,"context_line":"            new_allocs.update(peer_alloc)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        payload \u003d {\u0027allocations\u0027: new_allocs}"},{"line_number":1267,"context_line":"        payload[\u0027project_id\u0027] \u003d project_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_dd3babc5","line":1264,"updated":"2018-01-23 13:54:35.000000000","message":"Now there is a chance that we override an existing value in the new_allocs dict. Fortunately it is not a problem as new_allocs generated in a way that the current rp_uuid is not in the new_allocs (L1248). So it looks good.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a0e057e86e9418dc3c17196858369a99646b735a","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                                            resources, -1)"},{"line_number":1262,"context_line":"            LOG.debug(\u0027Subtracting old resources from same-host \u0027"},{"line_number":1263,"context_line":"                      \u0027allocation: %s\u0027, peer_alloc[rp_uuid][\u0027resources\u0027])"},{"line_number":1264,"context_line":"            new_allocs.update(peer_alloc)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        payload \u003d {\u0027allocations\u0027: new_allocs}"},{"line_number":1267,"context_line":"        payload[\u0027project_id\u0027] \u003d project_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_e5d11359","line":1264,"in_reply_to":"7f96bb07_dd3babc5","updated":"2018-01-24 04:38:36.000000000","message":"after rethink, we think we can remove the change for this method from this patch, since only the claim_resources need to be upgrade to 1.12. Let us upgrade other place in the rocky, then we can reduce some risk.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3dd9579343df6120138e8605bf148ea654f6bb33","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":1374,"context_line":"            \u0027user_id\u0027: user_id,"},{"line_number":1375,"context_line":"        }"},{"line_number":1376,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % consumer_uuid"},{"line_number":1377,"context_line":"        r \u003d self.put(url, payload, version\u003d\u00271.8\u0027)"},{"line_number":1378,"context_line":"        if r.status_code \u003d\u003d 406:"},{"line_number":1379,"context_line":"            # microversion 1.8 not available so try the earlier way"},{"line_number":1380,"context_line":"            # TODO(melwitt): Remove this when we can be sure all placement"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_26c70f15","line":1377,"range":{"start_line":1376,"start_character":8,"end_line":1377,"end_character":49},"updated":"2018-01-23 22:02:34.000000000","message":"I guess we don\u0027t update this to use 1.12...don\u0027t need to at this point anyway, we only get here from the resource tracker.","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a0e057e86e9418dc3c17196858369a99646b735a","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":1374,"context_line":"            \u0027user_id\u0027: user_id,"},{"line_number":1375,"context_line":"        }"},{"line_number":1376,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % consumer_uuid"},{"line_number":1377,"context_line":"        r \u003d self.put(url, payload, version\u003d\u00271.8\u0027)"},{"line_number":1378,"context_line":"        if r.status_code \u003d\u003d 406:"},{"line_number":1379,"context_line":"            # microversion 1.8 not available so try the earlier way"},{"line_number":1380,"context_line":"            # TODO(melwitt): Remove this when we can be sure all placement"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_b28273c7","line":1377,"range":{"start_line":1376,"start_character":8,"end_line":1377,"end_character":49},"in_reply_to":"7f96bb07_26c70f15","updated":"2018-01-24 04:38:36.000000000","message":"yes","commit_id":"afe9524f17acc0073f71609550b7ceeafcf07ed1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a9b7db35e9199df694e3424fca5e5b273efabb8c","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_fd3c4394","line":201,"range":{"start_line":201,"start_character":52,"end_line":201,"end_character":59},"updated":"2018-01-24 14:52:31.000000000","message":"nit: You don\u0027t need this.\n\n  \u003e\u003e\u003e x \u003d {\u0027hello\u0027: \u0027world\u0027}\n  \u003e\u003e\u003e set(x)\n  set([\u0027hello\u0027])","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b9adea2024f6311cd7e127c744cd056a8aaa2d6a","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_2e602ccf","line":201,"range":{"start_line":201,"start_character":52,"end_line":201,"end_character":59},"in_reply_to":"7f96bb07_fd3c4394","updated":"2018-01-24 15:04:30.000000000","message":"Done","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f57c1dd0bad2af0aa33c662e42cb80247d9dc0bb","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    # already allocated against on the source host (like shared storage"},{"line_number":199,"context_line":"    # providers)"},{"line_number":200,"context_line":"    cur_rp_uuids \u003d set(source_allocs.keys())"},{"line_number":201,"context_line":"    new_rp_uuids \u003d set(dest_alloc_req[\u0027allocations\u0027].keys()) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d {"},{"line_number":204,"context_line":"        cur_rp_uuid: {\u0027resources\u0027: alloc[\u0027resources\u0027]}"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_b961543c","line":201,"range":{"start_line":201,"start_character":52,"end_line":201,"end_character":59},"in_reply_to":"7f96bb07_fd3c4394","updated":"2018-01-25 11:44:39.000000000","message":"yeah, either the .keys() or the set() call was superfluous","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a9b7db35e9199df694e3424fca5e5b273efabb8c","unresolved":false,"context_lines":[{"line_number":1149,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.10, upgrade to 1.12 in Rocky release."},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.10\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_7d711376","line":1152,"range":{"start_line":1152,"start_character":27,"end_line":1152,"end_character":60},"updated":"2018-01-24 14:52:31.000000000","message":"Can you make this a TODO\n\nEDIT: Actually, if the client is really that old, surely it\u0027s not sending 1.12 compatible payloads? In Rocky we should probably start rejecting requests that don\u0027t include this information, right? Maybe I\u0027m missing something...","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b9adea2024f6311cd7e127c744cd056a8aaa2d6a","unresolved":false,"context_lines":[{"line_number":1149,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":1150,"context_line":"        \"\"\""},{"line_number":1151,"context_line":"        # Older clients might not send the allocation_request_version, so"},{"line_number":1152,"context_line":"        # default to 1.10, upgrade to 1.12 in Rocky release."},{"line_number":1153,"context_line":"        allocation_request_version \u003d allocation_request_version or \u00271.10\u0027"},{"line_number":1154,"context_line":"        # Ensure we don\u0027t change the supplied alloc request since it\u0027s used in"},{"line_number":1155,"context_line":"        # a loop within the scheduler against multiple instance claims"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_6e6ab4b3","line":1152,"range":{"start_line":1152,"start_character":27,"end_line":1152,"end_character":60},"in_reply_to":"7f96bb07_7d711376","updated":"2018-01-24 15:04:30.000000000","message":"yea, i think you are right.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a9b7db35e9199df694e3424fca5e5b273efabb8c","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"},{"line_number":1157,"context_line":""},{"line_number":1158,"context_line":"        # If the allocation_request_version less than 1.12, then convert the"},{"line_number":1159,"context_line":"        # allocation array format to the dict format. This convertion can be"},{"line_number":1160,"context_line":"        # remove in Rocky release."},{"line_number":1161,"context_line":"        major_ver, minor_ver \u003d allocation_request_version.split(\u0027.\u0027)"},{"line_number":1162,"context_line":"        if (int(major_ver), int(minor_ver)) \u003c (1, 12):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_fd6523b6","line":1159,"range":{"start_line":1159,"start_character":59,"end_line":1159,"end_character":69},"updated":"2018-01-24 14:52:31.000000000","message":"conversion","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b9adea2024f6311cd7e127c744cd056a8aaa2d6a","unresolved":false,"context_lines":[{"line_number":1156,"context_line":"        ar \u003d copy.deepcopy(alloc_request)"},{"line_number":1157,"context_line":""},{"line_number":1158,"context_line":"        # If the allocation_request_version less than 1.12, then convert the"},{"line_number":1159,"context_line":"        # allocation array format to the dict format. This convertion can be"},{"line_number":1160,"context_line":"        # remove in Rocky release."},{"line_number":1161,"context_line":"        major_ver, minor_ver \u003d allocation_request_version.split(\u0027.\u0027)"},{"line_number":1162,"context_line":"        if (int(major_ver), int(minor_ver)) \u003c (1, 12):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_ee9b24c6","line":1159,"range":{"start_line":1159,"start_character":59,"end_line":1159,"end_character":69},"in_reply_to":"7f96bb07_fd6523b6","updated":"2018-01-24 15:04:30.000000000","message":"Done","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a9b7db35e9199df694e3424fca5e5b273efabb8c","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"        # If the allocation_request_version less than 1.12, then convert the"},{"line_number":1159,"context_line":"        # allocation array format to the dict format. This convertion can be"},{"line_number":1160,"context_line":"        # remove in Rocky release."},{"line_number":1161,"context_line":"        major_ver, minor_ver \u003d allocation_request_version.split(\u0027.\u0027)"},{"line_number":1162,"context_line":"        if (int(major_ver), int(minor_ver)) \u003c (1, 12):"},{"line_number":1163,"context_line":"            ar \u003d {"},{"line_number":1164,"context_line":"                \u0027allocations\u0027: {"},{"line_number":1165,"context_line":"                    alloc[\u0027resource_provider\u0027][\u0027uuid\u0027]: {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_9d565fce","line":1162,"range":{"start_line":1161,"start_character":8,"end_line":1162,"end_character":54},"updated":"2018-01-24 14:52:31.000000000","message":"Surely we have util code to do this for us? Can you use it, if so","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a23b44654225f7fa7b13b97da0a102b2d39d1b7c","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"        # If the allocation_request_version less than 1.12, then convert the"},{"line_number":1159,"context_line":"        # allocation array format to the dict format. This convertion can be"},{"line_number":1160,"context_line":"        # remove in Rocky release."},{"line_number":1161,"context_line":"        major_ver, minor_ver \u003d allocation_request_version.split(\u0027.\u0027)"},{"line_number":1162,"context_line":"        if (int(major_ver), int(minor_ver)) \u003c (1, 12):"},{"line_number":1163,"context_line":"            ar \u003d {"},{"line_number":1164,"context_line":"                \u0027allocations\u0027: {"},{"line_number":1165,"context_line":"                    alloc[\u0027resource_provider\u0027][\u0027uuid\u0027]: {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_98ce6a58","line":1162,"range":{"start_line":1161,"start_character":8,"end_line":1162,"end_character":54},"updated":"2018-01-24 14:15:50.000000000","message":"nit: you could probably use something in here for this conversion:\n\nhttps://github.com/openstack/oslo.utils/blob/master/oslo_utils/versionutils.py","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b9adea2024f6311cd7e127c744cd056a8aaa2d6a","unresolved":false,"context_lines":[{"line_number":1158,"context_line":"        # If the allocation_request_version less than 1.12, then convert the"},{"line_number":1159,"context_line":"        # allocation array format to the dict format. This convertion can be"},{"line_number":1160,"context_line":"        # remove in Rocky release."},{"line_number":1161,"context_line":"        major_ver, minor_ver \u003d allocation_request_version.split(\u0027.\u0027)"},{"line_number":1162,"context_line":"        if (int(major_ver), int(minor_ver)) \u003c (1, 12):"},{"line_number":1163,"context_line":"            ar \u003d {"},{"line_number":1164,"context_line":"                \u0027allocations\u0027: {"},{"line_number":1165,"context_line":"                    alloc[\u0027resource_provider\u0027][\u0027uuid\u0027]: {"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_ae6c3cd0","line":1162,"range":{"start_line":1161,"start_character":8,"end_line":1162,"end_character":54},"in_reply_to":"7f96bb07_9d565fce","updated":"2018-01-24 15:04:30.000000000","message":"yea, thanks","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"96786e7042d62dc7e5d4359dcf0d44fd4d9cbb55","unresolved":false,"context_lines":[{"line_number":1164,"context_line":"                \u0027allocations\u0027: {"},{"line_number":1165,"context_line":"                    alloc[\u0027resource_provider\u0027][\u0027uuid\u0027]: {"},{"line_number":1166,"context_line":"                        \u0027resources\u0027: alloc[\u0027resources\u0027]"},{"line_number":1167,"context_line":"                    } for alloc in ar[\u0027allocations\u0027]"},{"line_number":1168,"context_line":"                }"},{"line_number":1169,"context_line":"            }"},{"line_number":1170,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_1da80f1e","line":1167,"range":{"start_line":1167,"start_character":35,"end_line":1167,"end_character":37},"updated":"2018-01-24 11:47:15.000000000","message":"I just note this here for the future reader: this \u0027ar\u0027 is a deepcopy of the incoming allocation_request in 1.10 format and the \u0027ar\u0027 created at L1163 is the same request in 1.12 format.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"ebcbf1005bd536f3fa6c0db0c3ee02de3ccd3406","unresolved":false,"context_lines":[{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"        payload[\u0027project_id\u0027] \u003d project_id"},{"line_number":1185,"context_line":"        payload[\u0027user_id\u0027] \u003d user_id"},{"line_number":1186,"context_line":"        r \u003d self.put(url, payload, version\u003d\u00271.12\u0027)"},{"line_number":1187,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1188,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":1189,"context_line":"            # but we have no error codes, only error messages."}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_38a8761e","line":1186,"range":{"start_line":1186,"start_character":26,"end_line":1186,"end_character":49},"updated":"2018-01-24 14:19:35.000000000","message":"Don\u0027t change this. The whole reason for including the allocation_request_version in the Selection object is so that placement knows how to handle the allocation_request. If there is a change to placement that alters the format of allocation_request, this will break.\n\nSince we\u0027re already doing a \"bad\" thing by modifying ARs (which are supposed to be opaque blobs outside of placement), it would be better if you also modified the allocation_request_version to 1.12 when you modify the allocation_request in the block starting on L1163.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d776db5eef92250f2cc314c1f15790541edd4337","unresolved":false,"context_lines":[{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"        payload[\u0027project_id\u0027] \u003d project_id"},{"line_number":1185,"context_line":"        payload[\u0027user_id\u0027] \u003d user_id"},{"line_number":1186,"context_line":"        r \u003d self.put(url, payload, version\u003d\u00271.12\u0027)"},{"line_number":1187,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1188,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":1189,"context_line":"            # but we have no error codes, only error messages."}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_eb4d5672","line":1186,"range":{"start_line":1186,"start_character":26,"end_line":1186,"end_character":49},"in_reply_to":"7f96bb07_38a8761e","updated":"2018-01-24 14:23:53.000000000","message":"\u003e Since we\u0027re already doing a \"bad\" thing by modifying ARs (which are supposed to be opaque blobs outside of placement),\n\nDan mentioned this in IRC when he was looking at this code before for a separate change, but at some point we\u0027ll likely need a versioned object to pass around for the allocation request rather than the dict because of the fact we have to handle multiple versions of this thing now.\n\n\u003e it would be better if you also modified the allocation_request_version to 1.12 when you modify the allocation_request in the block starting on L1163.\n\nI think that makes sense.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"}],"nova/scheduler/manager.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"ebcbf1005bd536f3fa6c0db0c3ee02de3ccd3406","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                for ar in alloc_reqs:"},{"line_number":144,"context_line":"                    for rp_uuid in ar[\u0027allocations\u0027]:"},{"line_number":145,"context_line":"                        alloc_reqs_by_rp_uuid[rp_uuid].append("},{"line_number":146,"context_line":"                            ar)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        # Only return alternates if both return_objects and return_alternates"},{"line_number":149,"context_line":"        # are True."}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_7877ded5","line":146,"range":{"start_line":146,"start_character":28,"end_line":146,"end_character":31},"updated":"2018-01-24 14:19:35.000000000","message":"This should be on the preceding line. No need to put it on a separate line.","commit_id":"e3d052e0f250e241a698cabe67373c3bb892a42c"}]}
