)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"563262ff2a5d69a6cacf81f3663c73323ba89dba","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def _allocation_list_to_dicts(allocations):"},{"line_number":68,"context_line":"    \"\"\"Turn a list of allocations into a list of simple dicts.\"\"\""},{"line_number":69,"context_line":"    allocation_dicts \u003d []"},{"line_number":70,"context_line":"    for allocation in allocations:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_5555f54d","line":67,"range":{"start_line":67,"start_character":0,"end_line":67,"end_character":43},"updated":"2016-09-06 10:03:34.000000000","message":"Whether we should put those into the AllocationList and Allocation object?","commit_id":"1cd9f768df249afbe787993b5d9c975e7fe3b905"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b2a15455b730d5f3647a695adef62633b78c2217","unresolved":false,"context_lines":[{"line_number":64,"context_line":"}"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"def _allocation_list_to_dicts(allocations):"},{"line_number":68,"context_line":"    \"\"\"Turn a list of allocations into a list of simple dicts.\"\"\""},{"line_number":69,"context_line":"    allocation_dicts \u003d []"},{"line_number":70,"context_line":"    for allocation in allocations:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_4b7d561b","line":67,"in_reply_to":"9a89bdaa_5555f54d","updated":"2016-09-06 10:28:17.000000000","message":"Yeah, I considered that but since we\u0027re effectively doing an experiment here (to decide if this comparison is the right change) I figured best to just get something working. I also wasn\u0027t sure if there wasn\u0027t an existing way (via OVO) to do this. So you\u0027re review is doing exactly what I was hoping: pointing towards getting this right as we work out exactly what we want.","commit_id":"1cd9f768df249afbe787993b5d9c975e7fe3b905"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"563262ff2a5d69a6cacf81f3663c73323ba89dba","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    provided_as_dicts \u003d _allocation_list_to_dicts(provided_allocations)"},{"line_number":91,"context_line":"    existing_as_dicts \u003d _allocation_list_to_dicts(existing_allocations)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    for index, provided in enumerate(provided_as_dicts):"},{"line_number":94,"context_line":"        if provided !\u003d existing_as_dicts[index]:"},{"line_number":95,"context_line":"            return False"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    return True"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_d504a57f","line":95,"range":{"start_line":93,"start_character":4,"end_line":95,"end_character":24},"updated":"2016-09-06 10:03:34.000000000","message":"you already sorted the list, so you can just do like \"provided_as_dicts \u003d\u003d  existing_as_dicts\"","commit_id":"1cd9f768df249afbe787993b5d9c975e7fe3b905"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b2a15455b730d5f3647a695adef62633b78c2217","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    for index, provided in enumerate(provided_as_dicts):"},{"line_number":94,"context_line":"        if provided !\u003d existing_as_dicts[index]:"},{"line_number":95,"context_line":"            return False"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    return True"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_4b271612","line":95,"in_reply_to":"9a89bdaa_d504a57f","updated":"2016-09-06 10:28:17.000000000","message":"Ah, of course, thanks. I think I must have gotten it in my head the equivalence testing wouldn\u0027t be deep. Which would be rotten. Clearly rushing...","commit_id":"1cd9f768df249afbe787993b5d9c975e7fe3b905"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"4e92ad8a398e7227ca3a9715a923e21606c1ca94","unresolved":false,"context_lines":[{"line_number":87,"context_line":"def _allocations_equal(provided_allocations, existing_allocations):"},{"line_number":88,"context_line":"    \"\"\"Determine if two AllocationLists are equivalent."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    They must have the same consumer_id for all items in the list."},{"line_number":91,"context_line":"    \"\"\""},{"line_number":92,"context_line":"    if len(provided_allocations) !\u003d len(existing_allocations):"},{"line_number":93,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_b70a7788","line":90,"range":{"start_line":90,"start_character":4,"end_line":90,"end_character":66},"updated":"2016-09-07 13:51:50.000000000","message":"I see that the method that calls this gets the allocations by consumer_id, but this comment should probably note that, because looking at the method on its own, it\u0027s not obvious.","commit_id":"f325c9f6b4fec5c7c3f6846144fc28940d72eb2d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"4e92ad8a398e7227ca3a9715a923e21606c1ca94","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    existing_allocations \u003d objects.AllocationList.get_all_by_consumer_id("},{"line_number":167,"context_line":"        context, consumer_uuid)"},{"line_number":168,"context_line":"    if existing_allocations:"},{"line_number":169,"context_line":"        allocations_to_write \u003d not _allocations_equal("},{"line_number":170,"context_line":"            allocations, existing_allocations)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    if allocations_to_write:"},{"line_number":173,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_17608300","line":170,"range":{"start_line":169,"start_character":0,"end_line":170,"end_character":46},"updated":"2016-09-07 13:51:50.000000000","message":"nit: I think it would read better as:\n\n    if _allocations_equal(...):\n        allocations_to_write \u003d False\n\nThe tiny \u0027not\u0027 gets lost in the midst of 4 big \u0027allocation\u0027 words. :)","commit_id":"f325c9f6b4fec5c7c3f6846144fc28940d72eb2d"}]}
