)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d59e7e7765f0c746034ce67c7bf7c04a306e0d55","unresolved":false,"context_lines":[{"line_number":22,"context_line":"allocation to include the original source host\u0027s resources along with"},{"line_number":23,"context_line":"the new destination host\u0027s resources."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"We ensure that if the original allocation on the source host included"},{"line_number":26,"context_line":"shared resource providers that we do not \"double up\" the request for"},{"line_number":27,"context_line":"that resource in the new allocation."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: Ifd09bd0128ed74347c984a3dcca1304336853865"},{"line_number":30,"context_line":"blueprint: placement-claims"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"bf3e73b7_44450e70","line":27,"range":{"start_line":25,"start_character":0,"end_line":27,"end_character":36},"updated":"2017-08-05 00:22:21.000000000","message":"Looking at https://review.openstack.org/#/c/490733/ now I\u0027m not sure why we decided to not double up the shared allocation. I think it was because there was an assumption of a cold or live migration, where the disk_gb in the flavor isn\u0027t changing, but for a resize from host A to host B with shared storage provider C and the flavor disk goes from let\u0027s say 20GB to 40GB, we need to account for that difference in disk allocation on the shared provider. Either we sum them to allocation 60GB, or we just allocate the max of the two, so 40GB in this case.","commit_id":"9d1db10f842286fb59b9316987e075fd8758107d"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a58a556cf5ccdef72f90471973b987bce86d0c0","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_93f17098","line":927,"range":{"start_line":927,"start_character":45,"end_line":927,"end_character":69},"updated":"2017-07-26 21:25:10.000000000","message":"_allocate_for_instance","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"73b58e4c87a28c55f3b11be4d5487bdc1512bb29","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_b696a292","line":927,"range":{"start_line":927,"start_character":45,"end_line":927,"end_character":69},"in_reply_to":"ff346bd7_93f17098","updated":"2017-07-26 21:52:28.000000000","message":"Done","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a58a556cf5ccdef72f90471973b987bce86d0c0","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        :note: This method will attempt to retry a claim that fails with a"},{"line_number":932,"context_line":"        concurrent update up to 3 times"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_130c6092","line":929,"range":{"start_line":927,"start_character":73,"end_line":929,"end_character":75},"updated":"2017-07-26 21:25:10.000000000","message":"How does the destination compute calling _allocate_for_instance free up the allocations against the source compute? Because it\u0027s a full override of the allocations for that instance against ALL resource providers? Looking at the put_allocations method, it looks like it\u0027s scoped to just the compute node resource provider, not all of them.","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"73b58e4c87a28c55f3b11be4d5487bdc1512bb29","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        :note: This method will attempt to retry a claim that fails with a"},{"line_number":932,"context_line":"        concurrent update up to 3 times"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_d68a46bd","line":929,"range":{"start_line":927,"start_character":73,"end_line":929,"end_character":75},"in_reply_to":"ff346bd7_130c6092","updated":"2017-07-26 21:52:28.000000000","message":"It overrides the claimed resources for the consumer (the instance). Right now, it will only claim against the destination compute host (not any shared provider). See the comment in put_allocations() about that:\n\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/client/report.py#L956-L958","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"22ccb13f510ae027f5b65fd3c45fe131dcaf9e87","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        :note: This method will attempt to retry a claim that fails with a"},{"line_number":932,"context_line":"        concurrent update up to 3 times"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_16db2e4f","line":929,"range":{"start_line":927,"start_character":73,"end_line":929,"end_character":75},"in_reply_to":"ff346bd7_130c6092","updated":"2017-07-26 21:35:22.000000000","message":"OK I get it now, PUT /allocations/{consumer_uuid} is a full override of the allocations for that consumer, and in _allocate_for_instance() on the destination node it\u0027s going to call put_allocations and only set allocations for that provider (the dest host). Or the source host if you\u0027re doing something like a resize and you revert it back to the source host.","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"de513dc077595d1a4ad4bf4f8aea43d569b2048d","unresolved":false,"context_lines":[{"line_number":924,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":925,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":926,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":927,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":928,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":929,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":930,"context_line":""},{"line_number":931,"context_line":"        :note: This method will attempt to retry a claim that fails with a"},{"line_number":932,"context_line":"        concurrent update up to 3 times"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_96eefeea","line":929,"range":{"start_line":927,"start_character":73,"end_line":929,"end_character":75},"in_reply_to":"ff346bd7_130c6092","updated":"2017-07-26 21:35:34.000000000","message":"Yeah, I think we have problems with move operations for having duplicate allcations because when the RT is running, it just PUT /allocations for all the existing instances which would remove the other allocations...","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a58a556cf5ccdef72f90471973b987bce86d0c0","unresolved":false,"context_lines":[{"line_number":950,"context_line":"        # the move operation against both the source and destination hosts"},{"line_number":951,"context_line":"        r \u003d self.get(url)"},{"line_number":952,"context_line":"        if r.status_code \u003d\u003d 200:"},{"line_number":953,"context_line":"            LOG.debug(\"Doubling-up allocation request for move operation.\")"},{"line_number":954,"context_line":"            current_allocs \u003d r.json()[\u0027allocations\u0027]"},{"line_number":955,"context_line":"            # Remove any allocations against resource providers that are"},{"line_number":956,"context_line":"            # already allocated against on the source host (like shared storage"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_b36b541c","line":953,"range":{"start_line":953,"start_character":12,"end_line":953,"end_character":75},"updated":"2017-07-26 21:25:10.000000000","message":"nit: we could do instance_uuid\u003dconsumer_uuid kwarg for the LOG.debug statement for context. Since a move operation is a single instance the context would also log the request id, so not a huge issue to also have the instance id in there.\n\nAlso, we\u0027ll get a 200 back even if there are no allocations already for the instance, so isn\u0027t this log message premature?","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"73b58e4c87a28c55f3b11be4d5487bdc1512bb29","unresolved":false,"context_lines":[{"line_number":950,"context_line":"        # the move operation against both the source and destination hosts"},{"line_number":951,"context_line":"        r \u003d self.get(url)"},{"line_number":952,"context_line":"        if r.status_code \u003d\u003d 200:"},{"line_number":953,"context_line":"            LOG.debug(\"Doubling-up allocation request for move operation.\")"},{"line_number":954,"context_line":"            current_allocs \u003d r.json()[\u0027allocations\u0027]"},{"line_number":955,"context_line":"            # Remove any allocations against resource providers that are"},{"line_number":956,"context_line":"            # already allocated against on the source host (like shared storage"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_b687c2b5","line":953,"range":{"start_line":953,"start_character":12,"end_line":953,"end_character":75},"in_reply_to":"ff346bd7_b36b541c","updated":"2017-07-26 21:52:28.000000000","message":"Guh, yes, you are correct.","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a58a556cf5ccdef72f90471973b987bce86d0c0","unresolved":false,"context_lines":[{"line_number":955,"context_line":"            # Remove any allocations against resource providers that are"},{"line_number":956,"context_line":"            # already allocated against on the source host (like shared storage"},{"line_number":957,"context_line":"            # providers)"},{"line_number":958,"context_line":"            cur_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":959,"context_line":"                                   for a in current_allocs)"},{"line_number":960,"context_line":"            new_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":961,"context_line":"                               for a in ar[\u0027allocations\u0027]) - cur_rp_uuids"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_738decd1","line":958,"range":{"start_line":958,"start_character":34,"end_line":958,"end_character":51},"updated":"2017-07-26 21:25:10.000000000","message":"Is this right? I thought GET /allocations responses looked like this:\n\n    {\u0027allocations\u0027:\n       RP_UUID_1: {\n           \u0027generation\u0027: GENERATION,\n           \u0027resources\u0027: {\n              \u0027DISK_GB\u0027: 4,\n              \u0027VCPU\u0027: 2\n           }\n       },\n       RP_UUID_2: {\n           \u0027generation\u0027: GENERATION,\n           \u0027resources\u0027: {\n              \u0027DISK_GB\u0027: 6,\n              \u0027VCPU\u0027: 3\n           }\n       }\n    }\n\nSo the provider uuids are the keys.","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"73b58e4c87a28c55f3b11be4d5487bdc1512bb29","unresolved":false,"context_lines":[{"line_number":955,"context_line":"            # Remove any allocations against resource providers that are"},{"line_number":956,"context_line":"            # already allocated against on the source host (like shared storage"},{"line_number":957,"context_line":"            # providers)"},{"line_number":958,"context_line":"            cur_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":959,"context_line":"                                   for a in current_allocs)"},{"line_number":960,"context_line":"            new_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":961,"context_line":"                               for a in ar[\u0027allocations\u0027]) - cur_rp_uuids"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_b67582cd","line":958,"range":{"start_line":958,"start_character":34,"end_line":958,"end_character":51},"in_reply_to":"ff346bd7_738decd1","updated":"2017-07-26 21:52:28.000000000","message":"*sigh*, yes you are correct. gotta love inconsistent GET/PUT bodies. :(","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"2b5cb8aa99edd7b165fe2886bc32855e70006cc4","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    new_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":201,"context_line":"                       for a in dest_alloc_req[\u0027allocations\u0027]) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d ["},{"line_number":204,"context_line":"        {"},{"line_number":205,"context_line":"            \u0027resource_provider\u0027: {"},{"line_number":206,"context_line":"                \u0027uuid\u0027: cur_rp_uuid,"},{"line_number":207,"context_line":"            },"},{"line_number":208,"context_line":"            \u0027resources\u0027: alloc[\u0027resources\u0027],"},{"line_number":209,"context_line":"        }"},{"line_number":210,"context_line":"        for cur_rp_uuid, alloc in source_allocs.items()"},{"line_number":211,"context_line":"    ]"},{"line_number":212,"context_line":"    new_alloc_req \u003d {"},{"line_number":213,"context_line":"        \u0027allocations\u0027: current_allocs,"},{"line_number":214,"context_line":"    }"},{"line_number":215,"context_line":"    for alloc in dest_alloc_req[\u0027allocations\u0027]:"},{"line_number":216,"context_line":"        if alloc[\u0027resource_provider\u0027][\u0027uuid\u0027] in new_rp_uuids:"},{"line_number":217,"context_line":"            new_alloc_req[\u0027allocations\u0027].append(alloc)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_849c846a","line":214,"range":{"start_line":203,"start_character":0,"end_line":214,"end_character":5},"updated":"2017-07-26 23:07:12.000000000","message":"Oh, think of dansmith\u0027s eyes!\nHow about:\n\n    current_allocs \u003d [{\u0027resource_provider\u0027: {\u0027uuid\u0027: cur_rp_uuid},\n                      \u0027resources\u0027: alloc[\u0027resources\u0027]}\n                      for cur_rp_uuid, alloc in source_allocs.items()]\n    new_alloc_req \u003d {\u0027allocations\u0027: current_allocs}\n\nAnything that doesn\u0027t involve a 1-element dict straddling 3 lines.","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3f4ccf9ac237eff577753cf10afc8eb355ea034","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    new_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":201,"context_line":"                       for a in dest_alloc_req[\u0027allocations\u0027]) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d ["},{"line_number":204,"context_line":"        {"},{"line_number":205,"context_line":"            \u0027resource_provider\u0027: {"},{"line_number":206,"context_line":"                \u0027uuid\u0027: cur_rp_uuid,"},{"line_number":207,"context_line":"            },"},{"line_number":208,"context_line":"            \u0027resources\u0027: alloc[\u0027resources\u0027],"},{"line_number":209,"context_line":"        }"},{"line_number":210,"context_line":"        for cur_rp_uuid, alloc in source_allocs.items()"},{"line_number":211,"context_line":"    ]"},{"line_number":212,"context_line":"    new_alloc_req \u003d {"},{"line_number":213,"context_line":"        \u0027allocations\u0027: current_allocs,"},{"line_number":214,"context_line":"    }"},{"line_number":215,"context_line":"    for alloc in dest_alloc_req[\u0027allocations\u0027]:"},{"line_number":216,"context_line":"        if alloc[\u0027resource_provider\u0027][\u0027uuid\u0027] in new_rp_uuids:"},{"line_number":217,"context_line":"            new_alloc_req[\u0027allocations\u0027].append(alloc)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_bf143545","line":214,"range":{"start_line":203,"start_character":0,"end_line":214,"end_character":5},"in_reply_to":"ff346bd7_849c846a","updated":"2017-07-26 23:17:18.000000000","message":"meh","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"de75bcb808f57d4a6ef2a2ab125bb8e52c8b6f8a","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    new_rp_uuids \u003d set(a[\u0027resource_provider\u0027][\u0027uuid\u0027]"},{"line_number":201,"context_line":"                       for a in dest_alloc_req[\u0027allocations\u0027]) - cur_rp_uuids"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    current_allocs \u003d ["},{"line_number":204,"context_line":"        {"},{"line_number":205,"context_line":"            \u0027resource_provider\u0027: {"},{"line_number":206,"context_line":"                \u0027uuid\u0027: cur_rp_uuid,"},{"line_number":207,"context_line":"            },"},{"line_number":208,"context_line":"            \u0027resources\u0027: alloc[\u0027resources\u0027],"},{"line_number":209,"context_line":"        }"},{"line_number":210,"context_line":"        for cur_rp_uuid, alloc in source_allocs.items()"},{"line_number":211,"context_line":"    ]"},{"line_number":212,"context_line":"    new_alloc_req \u003d {"},{"line_number":213,"context_line":"        \u0027allocations\u0027: current_allocs,"},{"line_number":214,"context_line":"    }"},{"line_number":215,"context_line":"    for alloc in dest_alloc_req[\u0027allocations\u0027]:"},{"line_number":216,"context_line":"        if alloc[\u0027resource_provider\u0027][\u0027uuid\u0027] in new_rp_uuids:"},{"line_number":217,"context_line":"            new_alloc_req[\u0027allocations\u0027].append(alloc)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_5a38b4ed","line":214,"range":{"start_line":203,"start_character":0,"end_line":214,"end_character":5},"in_reply_to":"ff346bd7_bf143545","updated":"2017-07-27 02:41:57.000000000","message":"Jesus Christ I can\u0027t read either form so eff you both!","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ad416752d7df673b904a7f8d73295af1dfff0be","unresolved":false,"context_lines":[{"line_number":960,"context_line":"        operations from being scheduled to improperly, we create a \"doubled-up\""},{"line_number":961,"context_line":"        allocation that consumes resources on *both* the source and the"},{"line_number":962,"context_line":"        destination host during the move operation. When the move operation"},{"line_number":963,"context_line":"        completes, the destination host (via _allocation_for_instance()) will"},{"line_number":964,"context_line":"        end up setting allocations for the instance only on the destination"},{"line_number":965,"context_line":"        host thereby freeing up resources on the source host appropriately."},{"line_number":966,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff346bd7_fa7888c4","line":963,"range":{"start_line":963,"start_character":45,"end_line":963,"end_character":69},"updated":"2017-07-27 02:42:02.000000000","message":"_allocate_for_instance","commit_id":"85b6e7f6d85401ca67c90d7dead94424bd70681b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ad416752d7df673b904a7f8d73295af1dfff0be","unresolved":false,"context_lines":[{"line_number":991,"context_line":"            current_allocs \u003d r.json()[\u0027allocations\u0027]"},{"line_number":992,"context_line":"            if current_allocs:"},{"line_number":993,"context_line":"                merged_ar \u003d _move_operation_alloc_request(current_allocs, ar)"},{"line_number":994,"context_line":"                payload \u003d merged_ar"},{"line_number":995,"context_line":""},{"line_number":996,"context_line":"        payload[\u0027project_id\u0027] \u003d project_id"},{"line_number":997,"context_line":"        payload[\u0027user_id\u0027] \u003d user_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"ff346bd7_3a44d073","line":994,"range":{"start_line":994,"start_character":16,"end_line":994,"end_character":35},"updated":"2017-07-27 02:42:02.000000000","message":"You can assign payload above and save the merged_ar variable.","commit_id":"85b6e7f6d85401ca67c90d7dead94424bd70681b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c5eb264a16672b678196eb116a5b22c87873c07a","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                \u0027uuid\u0027: cur_rp_uuid,"},{"line_number":207,"context_line":"            },"},{"line_number":208,"context_line":"            \u0027resources\u0027: alloc[\u0027resources\u0027],"},{"line_number":209,"context_line":"        } for cur_rp_uuid, alloc in source_allocs.items()"},{"line_number":210,"context_line":"    ]"},{"line_number":211,"context_line":"    new_alloc_req \u003d {\u0027allocations\u0027: current_allocs}"},{"line_number":212,"context_line":"    for alloc in dest_alloc_req[\u0027allocations\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff346bd7_b8967def","line":209,"range":{"start_line":209,"start_character":50,"end_line":209,"end_character":57},"updated":"2017-07-27 09:44:58.000000000","message":"nit: items() returns a iterator in py3 while it returns a list of tuples in py3, so that works fortunately given you loop over the list.","commit_id":"ff1f6e25cbf6b3e3f430ed5a6ced5d8804a99f3c"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d062de90b849dd29f95249a614b5de06da1d474b","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                LOG.debug(\"Another process changed the resource providers \""},{"line_number":1006,"context_line":"                          \"involved in our claim attempt. Retrying claim.\")"},{"line_number":1007,"context_line":"                return self.claim_resources(consumer_uuid, alloc_request,"},{"line_number":1008,"context_line":"                    project_id, user_id, attempt\u003d(attempt + 1))"},{"line_number":1009,"context_line":"            LOG.warning("},{"line_number":1010,"context_line":"                \u0027Unable to submit allocation for instance \u0027"},{"line_number":1011,"context_line":"                \u0027%(uuid)s (%(code)i %(text)s)\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff346bd7_646ab2ed","line":1008,"updated":"2017-07-27 08:18:51.000000000","message":"A little waste to get source allocation records on each retry.","commit_id":"ff1f6e25cbf6b3e3f430ed5a6ced5d8804a99f3c"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"22ccb13f510ae027f5b65fd3c45fe131dcaf9e87","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        as well as the resources on the destination host."},{"line_number":278,"context_line":"        \"\"\""},{"line_number":279,"context_line":"        get_resp_mock \u003d mock.Mock(status_code\u003d200)"},{"line_number":280,"context_line":"        get_resp_mock.json.return_value \u003d {"},{"line_number":281,"context_line":"            \u0027allocations\u0027: ["},{"line_number":282,"context_line":"                {"},{"line_number":283,"context_line":"                    \u0027resource_provider\u0027: {"},{"line_number":284,"context_line":"                        \u0027uuid\u0027: uuids.source,"},{"line_number":285,"context_line":"                    },"},{"line_number":286,"context_line":"                    \u0027resources\u0027: {"},{"line_number":287,"context_line":"                        \u0027VCPU\u0027: 1,"},{"line_number":288,"context_line":"                        \u0027MEMORY_MB\u0027: 1024,"},{"line_number":289,"context_line":"                    },"},{"line_number":290,"context_line":"                },"},{"line_number":291,"context_line":"            ]"},{"line_number":292,"context_line":"        }"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        self.ks_sess_mock.get.return_value \u003d get_resp_mock"},{"line_number":295,"context_line":"        resp_mock \u003d mock.Mock(status_code\u003d204)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_d6fa46bb","line":292,"range":{"start_line":280,"start_character":8,"end_line":292,"end_character":9},"updated":"2017-07-26 21:35:22.000000000","message":"This is the wrong format:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/placement/handlers/allocation.py#L109\n\nThat ^ example response is wrong too, but I can fix that separately.","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b8fd77e70c108acc6f913b5650f669bb0b5996ec","unresolved":false,"context_lines":[{"line_number":318,"context_line":"        # New allocation should include resources claimed on both the source"},{"line_number":319,"context_line":"        # and destination hosts"},{"line_number":320,"context_line":"        expected_payload \u003d {"},{"line_number":321,"context_line":"            \u0027allocations\u0027: ["},{"line_number":322,"context_line":"                {"},{"line_number":323,"context_line":"                    \u0027resource_provider\u0027: {"},{"line_number":324,"context_line":"                        \u0027uuid\u0027: uuids.source,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff346bd7_73f84c48","line":321,"updated":"2017-07-26 21:24:38.000000000","message":"is the ordering of this list stable? (here it is of course, I mean in the actual payload that it will be compared against)","commit_id":"b2788c748211d9cafa477d4d464973fa47f102e2"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"2b5cb8aa99edd7b165fe2886bc32855e70006cc4","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                        \u0027MEMORY_MB\u0027: 1024,"},{"line_number":290,"context_line":"                    },"},{"line_number":291,"context_line":"                },"},{"line_number":292,"context_line":"            }"},{"line_number":293,"context_line":"        }"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.ks_sess_mock.get.return_value \u003d get_resp_mock"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_c4cdec66","line":292,"range":{"start_line":292,"start_character":12,"end_line":292,"end_character":13},"updated":"2017-07-26 23:07:12.000000000","message":"Why doesn\u0027t this one get a trailing comma, too?","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3f4ccf9ac237eff577753cf10afc8eb355ea034","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                        \u0027MEMORY_MB\u0027: 1024,"},{"line_number":290,"context_line":"                    },"},{"line_number":291,"context_line":"                },"},{"line_number":292,"context_line":"            }"},{"line_number":293,"context_line":"        }"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.ks_sess_mock.get.return_value \u003d get_resp_mock"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_6402c00d","line":292,"range":{"start_line":292,"start_character":12,"end_line":292,"end_character":13},"in_reply_to":"ff346bd7_c4cdec66","updated":"2017-07-26 23:17:18.000000000","message":"it should.","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3f4ccf9ac237eff577753cf10afc8eb355ea034","unresolved":false,"context_lines":[{"line_number":374,"context_line":"                        \u0027DISK_GB\u0027: 100,"},{"line_number":375,"context_line":"                    },"},{"line_number":376,"context_line":"                },"},{"line_number":377,"context_line":"            }"},{"line_number":378,"context_line":"        }"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"        self.ks_sess_mock.get.return_value \u003d get_resp_mock"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff346bd7_1f06a11e","line":377,"updated":"2017-07-26 23:17:18.000000000","message":"so should this.","commit_id":"0c8f3388fc01f12fa40e00d62defea63fa6059bc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"07c00239067ffd99dafd17f7b842f7d29863b738","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        self.ks_sess_mock.put.assert_called_once_with("},{"line_number":346,"context_line":"            expected_url, endpoint_filter\u003dmock.ANY,"},{"line_number":347,"context_line":"            headers\u003d{\u0027OpenStack-API-Version\u0027: \u0027placement 1.10\u0027},"},{"line_number":348,"context_line":"            json\u003dexpected_payload, raise_exc\u003dFalse)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"        self.assertTrue(res)"},{"line_number":351,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ff346bd7_77a391b3","line":348,"range":{"start_line":348,"start_character":17,"end_line":348,"end_character":33},"updated":"2017-07-27 01:42:25.000000000","message":"Chris was right, this failed because the payload ordering isn\u0027t what was used:\n\nhttp://logs.openstack.org/89/487589/3/check/gate-nova-python35/7cb6baf/console.html#_2017-07-26_23_36_06_814217\n\nSo we need to get the actual arg passed to the mock and compare it to the expected_payload using something like self.assertDictEqual which handles the ordering issues.","commit_id":"85b6e7f6d85401ca67c90d7dead94424bd70681b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4f12b036bb619c9ab1db39d18e4ac5424b46913d","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        # We have to pull the json body from the mock call_args to validate"},{"line_number":350,"context_line":"        # it separately otherwise hash seed issues get in the way."},{"line_number":351,"context_line":"        actual_payload \u003d self.ks_sess_mock.put.call_args[1][\u0027json\u0027]"},{"line_number":352,"context_line":"        self.assertDictEqual(expected_payload, actual_payload)"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"        self.assertTrue(res)"},{"line_number":355,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ff346bd7_7e96baf2","line":352,"range":{"start_line":352,"start_character":8,"end_line":352,"end_character":62},"updated":"2017-07-27 12:48:33.000000000","message":"Why don\u0027t we also have to fix this one up for sorting?","commit_id":"d9a52520f12ddf41b5817a87580c3e169fd21552"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"99cd335b5b713f06029f04ead1ecc43a2b4ab40b","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        # We have to pull the json body from the mock call_args to validate"},{"line_number":350,"context_line":"        # it separately otherwise hash seed issues get in the way."},{"line_number":351,"context_line":"        actual_payload \u003d self.ks_sess_mock.put.call_args[1][\u0027json\u0027]"},{"line_number":352,"context_line":"        self.assertDictEqual(expected_payload, actual_payload)"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"        self.assertTrue(res)"},{"line_number":355,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ff346bd7_3924ccae","line":352,"in_reply_to":"ff346bd7_7e96baf2","updated":"2017-07-27 12:59:32.000000000","message":"Probably luck? I\u0027ll change this one too if I manage to get past another test weirdness on another change. Too much stuff being wonky.","commit_id":"d9a52520f12ddf41b5817a87580c3e169fd21552"}]}
