)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"aef6ffcc5c1f9d3fbc8a313d276073114b5ca876","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor _heal_allocations_for_instance to make place for port healing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current structur of _heal_allocations_for_instance makes it hard to"},{"line_number":10,"context_line":"add the port related allocation to process as that needs to be added"},{"line_number":11,"context_line":"both if the allocation does not exists at all or when only the user_id"},{"line_number":12,"context_line":"and project_id is missing or when only the ports needs healing."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5fc1f717_5d109557","line":9,"range":{"start_line":9,"start_character":55,"end_line":9,"end_character":68},"updated":"2019-03-15 17:00:37.000000000","message":"having looked at the patch two up from here, I don\u0027t understand how this refactor makes it less hard.","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"aef6ffcc5c1f9d3fbc8a313d276073114b5ca876","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor _heal_allocations_for_instance to make place for port healing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current structur of _heal_allocations_for_instance makes it hard to"},{"line_number":10,"context_line":"add the port related allocation to process as that needs to be added"},{"line_number":11,"context_line":"both if the allocation does not exists at all or when only the user_id"},{"line_number":12,"context_line":"and project_id is missing or when only the ports needs healing."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5fc1f717_9d127d61","line":9,"range":{"start_line":9,"start_character":12,"end_line":9,"end_character":20},"updated":"2019-03-15 17:00:37.000000000","message":"structure","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"58743d6ff52cc91ba0be3e965523abeb41d9920e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor _heal_allocations_for_instance to make place for port healing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current structur of _heal_allocations_for_instance makes it hard to"},{"line_number":10,"context_line":"add the port related allocation to process as that needs to be added"},{"line_number":11,"context_line":"both if the allocation does not exists at all or when only the user_id"},{"line_number":12,"context_line":"and project_id is missing or when only the ports needs healing."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5fc1f717_102738cc","line":9,"range":{"start_line":9,"start_character":55,"end_line":9,"end_character":68},"in_reply_to":"5fc1f717_5d109557","updated":"2019-03-18 16:26:32.000000000","message":"Done","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"58743d6ff52cc91ba0be3e965523abeb41d9920e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor _heal_allocations_for_instance to make place for port healing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The current structur of _heal_allocations_for_instance makes it hard to"},{"line_number":10,"context_line":"add the port related allocation to process as that needs to be added"},{"line_number":11,"context_line":"both if the allocation does not exists at all or when only the user_id"},{"line_number":12,"context_line":"and project_id is missing or when only the ports needs healing."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5fc1f717_703c7ce0","line":9,"range":{"start_line":9,"start_character":12,"end_line":9,"end_character":20},"in_reply_to":"5fc1f717_9d127d61","updated":"2019-03-18 16:26:32.000000000","message":"Done","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"88040daaf2013fe7a6d4cc893b853afd2be7c6a1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Refactor _heal_allocations_for_instance to make place for port healing"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a bit of extra strucutre so that port healing can be easier later"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Related-Bug: #1819923"},{"line_number":12,"context_line":"Change-Id: Id1003d758b9d35db051c1d591806276dfb521628"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5fc1f717_1fe89c79","line":9,"range":{"start_line":9,"start_character":19,"end_line":9,"end_character":28},"updated":"2019-03-18 20:37:44.000000000","message":"structure","commit_id":"3b86bba2dc4fc64e5768ae90267c20c095eef9fb"}],"nova/cmd/manage.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"aef6ffcc5c1f9d3fbc8a313d276073114b5ca876","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"        # return None if we can\u0027t communicate with Placement, and the"},{"line_number":1875,"context_line":"        # response can have an empty {\u0027allocations\u0027: {}} response if"},{"line_number":1876,"context_line":"        # there are no allocations for the instance so handle both"},{"line_number":1877,"context_line":"        if not allocations or not allocations.get(\u0027allocations\u0027):"},{"line_number":1878,"context_line":""},{"line_number":1879,"context_line":"            # This instance doesn\u0027t have allocations so we need to find"},{"line_number":1880,"context_line":"            # its compute node resource provider."}],"source_content_type":"text/x-python","patch_set":7,"id":"5fc1f717_f804ef16","line":1877,"range":{"start_line":1877,"start_character":0,"end_line":1877,"end_character":65},"updated":"2019-03-15 17:00:37.000000000","message":"I get why you wanted to add explicit `else`s and indents, but why did you need to invert the order of everything? IMO changing `if X and Y` to `if not X or not Y` is a backwards step clarity-wise; and it also makes for a bigger and harder-to-grok delta.","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"58743d6ff52cc91ba0be3e965523abeb41d9920e","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"        # return None if we can\u0027t communicate with Placement, and the"},{"line_number":1875,"context_line":"        # response can have an empty {\u0027allocations\u0027: {}} response if"},{"line_number":1876,"context_line":"        # there are no allocations for the instance so handle both"},{"line_number":1877,"context_line":"        if not allocations or not allocations.get(\u0027allocations\u0027):"},{"line_number":1878,"context_line":""},{"line_number":1879,"context_line":"            # This instance doesn\u0027t have allocations so we need to find"},{"line_number":1880,"context_line":"            # its compute node resource provider."}],"source_content_type":"text/x-python","patch_set":7,"id":"5fc1f717_302274ba","line":1877,"range":{"start_line":1877,"start_character":0,"end_line":1877,"end_character":65},"in_reply_to":"5fc1f717_f804ef16","updated":"2019-03-18 16:26:32.000000000","message":"Done","commit_id":"a3d33f2d34e0c793fb0c1e07181322d98da1707d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7ed825351b8bbcbc81d7bc8c73695523cd99bfc3","unresolved":false,"context_lines":[{"line_number":1908,"context_line":"            else:"},{"line_number":1909,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":1910,"context_line":"                    consumer_uuid\u003dinstance.uuid, error\u003dresp.text)"},{"line_number":1911,"context_line":"        else:"},{"line_number":1912,"context_line":"            # This instance doesn\u0027t have allocations so we need to find"},{"line_number":1913,"context_line":"            # its compute node resource provider."},{"line_number":1914,"context_line":"            node_uuid \u003d self._get_compute_node_uuid("}],"source_content_type":"text/x-python","patch_set":8,"id":"5fc1f717_3cc15830","line":1911,"updated":"2019-04-06 00:10:47.000000000","message":"I don\u0027t think I had an else on this because the if block above either returns or raises, and it still looks weird to me to have an else block here since we wouldn\u0027t hit this code regardless, but I suppose I should look to see what\u0027s changed after this.","commit_id":"3b86bba2dc4fc64e5768ae90267c20c095eef9fb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f1aa5903616f1aa18422e3f83133e0ea3b82be59","unresolved":false,"context_lines":[{"line_number":1908,"context_line":"            else:"},{"line_number":1909,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":1910,"context_line":"                    consumer_uuid\u003dinstance.uuid, error\u003dresp.text)"},{"line_number":1911,"context_line":"        else:"},{"line_number":1912,"context_line":"            # This instance doesn\u0027t have allocations so we need to find"},{"line_number":1913,"context_line":"            # its compute node resource provider."},{"line_number":1914,"context_line":"            node_uuid \u003d self._get_compute_node_uuid("}],"source_content_type":"text/x-python","patch_set":8,"id":"3fce034c_d6d671f2","line":1911,"in_reply_to":"5fc1f717_3cc15830","updated":"2019-04-11 07:54:57.000000000","message":"Technically the else is not necessary here, as you said, all the codepath exists above. Honestly this is pretty complex code and I need to add more complexity to it in the coming patches so I try to play it safe and add the else as a safety net. I have plans to restructure this code to be a bit simpler as adding port allocation adds another layer of complexity directly here.","commit_id":"3b86bba2dc4fc64e5768ae90267c20c095eef9fb"}]}
