)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"660de79383ed65daf0c654f67eb21dfc46bcf9e8","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"```python"},{"line_number":19,"context_line":"    def delete_all(self):"},{"line_number":20,"context_line":"        # Allocations can only have a single consumer, so take advantage of"},{"line_number":21,"context_line":"        # that fact and do an efficient batch delete"},{"line_number":22,"context_line":"        consumer_uuid \u003d self.objects[0].consumer.uuid"},{"line_number":23,"context_line":"        _delete_allocations_for_consumer(self._context, consumer_uuid)"},{"line_number":24,"context_line":"        consumer_obj.delete_consumers_if_no_allocations("}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_7f65c8ae","line":21,"range":{"start_line":20,"start_character":0,"end_line":21,"end_character":52},"updated":"2018-07-12 22:08:51.000000000","message":"Ack.\n\nThis was written before there existed any (API) code path with multiple consumers (i.e. before POST /allocations, where that might have been a possibility).  It probably should have had a NOTE/TODO warning future us to watch out for exactly what you\u0027ve noticed and fixed here.","commit_id":"11c29ae4702ac4f50baa9fe3a29e3e413ad69b09"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fc660f718b88cf155a4c80892691e4db1a196af7","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"```python"},{"line_number":19,"context_line":"    def delete_all(self):"},{"line_number":20,"context_line":"        # Allocations can only have a single consumer, so take advantage of"},{"line_number":21,"context_line":"        # that fact and do an efficient batch delete"},{"line_number":22,"context_line":"        consumer_uuid \u003d self.objects[0].consumer.uuid"},{"line_number":23,"context_line":"        _delete_allocations_for_consumer(self._context, consumer_uuid)"},{"line_number":24,"context_line":"        consumer_obj.delete_consumers_if_no_allocations("}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_342425b2","line":21,"range":{"start_line":20,"start_character":0,"end_line":21,"end_character":52},"in_reply_to":"5f7c97a3_7f65c8ae","updated":"2018-07-16 10:04:37.000000000","message":"Past us (at least some of them) didn\u0027t have a clue that POST /allocations was even in the realm of reality, but yeah, we\u0027ve done a lot of things that didn\u0027t seem possible in past.","commit_id":"11c29ae4702ac4f50baa9fe3a29e3e413ad69b09"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"660de79383ed65daf0c654f67eb21dfc46bcf9e8","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"The problem with the above is that if you get all the allocations for a"},{"line_number":29,"context_line":"single resource provider, using"},{"line_number":30,"context_line":"AllocationList.get_all_by_resource_provider() and there are more than"},{"line_number":31,"context_line":"one consumer allocating resources against that provider, then calling"},{"line_number":32,"context_line":"AllocationList.delete_all() will only delete *some* of the resource"},{"line_number":33,"context_line":"provider\u0027s allocations, not all of them."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_24b9857b","line":30,"range":{"start_line":30,"start_character":56,"end_line":30,"end_character":59},"updated":"2018-07-12 22:08:51.000000000","message":"is","commit_id":"11c29ae4702ac4f50baa9fe3a29e3e413ad69b09"}],"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fc660f718b88cf155a4c80892691e4db1a196af7","unresolved":false,"context_lines":[{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    def _create_allocations(alloc_list):"},{"line_number":390,"context_line":"        try:"},{"line_number":391,"context_line":"            alloc_list.replace_all()"},{"line_number":392,"context_line":"            LOG.debug(\"Successfully wrote allocations %s\", alloc_list)"},{"line_number":393,"context_line":"        except Exception:"},{"line_number":394,"context_line":"            if created_new_consumer:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_542761b6","line":391,"updated":"2018-07-16 10:04:37.000000000","message":"good plan","commit_id":"11c29ae4702ac4f50baa9fe3a29e3e413ad69b09"}],"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fc660f718b88cf155a4c80892691e4db1a196af7","unresolved":false,"context_lines":[{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"        :note: This method always deletes all allocations for all consumers"},{"line_number":2104,"context_line":"               referenced in the list of Allocation objects and then replaces"},{"line_number":2105,"context_line":"               the consumer\u0027s allocations with the Allocation objects. In doing"},{"line_number":2106,"context_line":"               so, it will end up setting the Allocation.id attribute of each"},{"line_number":2107,"context_line":"               Allocation object."},{"line_number":2108,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_d46051d3","line":2105,"range":{"start_line":2105,"start_character":47,"end_line":2105,"end_character":51},"updated":"2018-07-16 10:04:37.000000000","message":"you might interject \"new\" or \"supplied\" here to be super clear, but is probably okay as is.","commit_id":"11c29ae4702ac4f50baa9fe3a29e3e413ad69b09"}]}
