)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove port allocation during detach"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the port has resource allocation in placement then during inteface"},{"line_number":10,"context_line":"detach nova needs to update the instance allocation in placement,"},{"line_number":11,"context_line":"removing the resources from it that was there because of the port that"},{"line_number":12,"context_line":"is being detached."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"9fdfeff1_920dcd3f","line":9,"range":{"start_line":9,"start_character":61,"end_line":9,"end_character":69},"updated":"2019-02-25 21:10:19.000000000","message":"interface","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Remove port allocation during detach"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If the port has resource allocation in placement then during inteface"},{"line_number":10,"context_line":"detach nova needs to update the instance allocation in placement,"},{"line_number":11,"context_line":"removing the resources from it that was there because of the port that"},{"line_number":12,"context_line":"is being detached."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":27,"id":"9fdfeff1_42c52e8d","line":9,"range":{"start_line":9,"start_character":61,"end_line":9,"end_character":69},"in_reply_to":"9fdfeff1_920dcd3f","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"}],"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":5972,"context_line":"                        {\u0027port_id\u0027: port_id, \u0027msg\u0027: ex},"},{"line_number":5973,"context_line":"                        instance\u003dinstance)"},{"line_number":5974,"context_line":"            try:"},{"line_number":5975,"context_line":"                # NOTE(gibi): once we support attaching port that has resource"},{"line_number":5976,"context_line":"                # request we have to make sure that such allocation is deleted"},{"line_number":5977,"context_line":"                # during this cleanup."},{"line_number":5978,"context_line":"                self.network_api.deallocate_port_for_instance("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_72006903","line":5975,"updated":"2019-02-25 21:10:19.000000000","message":"Alternatively you could refactor this cleanup code to a helper method that deals with the allocation deletion, then the caller doesn\u0027t need to handle that explicitly. It looks like the only difference between it being used here and in detach_interface is if deallocate_port_for_instance raises something we may re-raise it, and we could control that with a kwarg to the helper method.\n\nThat could be a follow up though.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":5972,"context_line":"                        {\u0027port_id\u0027: port_id, \u0027msg\u0027: ex},"},{"line_number":5973,"context_line":"                        instance\u003dinstance)"},{"line_number":5974,"context_line":"            try:"},{"line_number":5975,"context_line":"                # NOTE(gibi): once we support attaching port that has resource"},{"line_number":5976,"context_line":"                # request we have to make sure that such allocation is deleted"},{"line_number":5977,"context_line":"                # during this cleanup."},{"line_number":5978,"context_line":"                self.network_api.deallocate_port_for_instance("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_02c1662f","line":5975,"in_reply_to":"9fdfeff1_72006903","updated":"2019-02-27 12:48:59.000000000","message":"Good point. I did the refactor in this patch as it is the one that introduce the logic that needs to be moved to the helper anyhow.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6045,"context_line":"                                {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":6046,"context_line":"                                instance\u003dinstance)"},{"line_number":6047,"context_line":"            else:"},{"line_number":6048,"context_line":"                # Deallocate the resources in placement that is used by the"},{"line_number":6049,"context_line":"                # detached port."},{"line_number":6050,"context_line":"                try:"},{"line_number":6051,"context_line":"                    client \u003d self.reportclient"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ed223ca3","line":6048,"range":{"start_line":6048,"start_character":61,"end_line":6048,"end_character":63},"updated":"2019-02-25 21:10:19.000000000","message":"were","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6045,"context_line":"                                {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":6046,"context_line":"                                instance\u003dinstance)"},{"line_number":6047,"context_line":"            else:"},{"line_number":6048,"context_line":"                # Deallocate the resources in placement that is used by the"},{"line_number":6049,"context_line":"                # detached port."},{"line_number":6050,"context_line":"                try:"},{"line_number":6051,"context_line":"                    client \u003d self.reportclient"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e2e1c2d1","line":6048,"range":{"start_line":6048,"start_character":61,"end_line":6048,"end_character":63},"in_reply_to":"9fdfeff1_ed223ca3","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6049,"context_line":"                # detached port."},{"line_number":6050,"context_line":"                try:"},{"line_number":6051,"context_line":"                    client \u003d self.reportclient"},{"line_number":6052,"context_line":"                    client.remove_resources_from_instance_allocation("},{"line_number":6053,"context_line":"                        context, instance.uuid, port_allocation)"},{"line_number":6054,"context_line":"                except Exception as ex:"},{"line_number":6055,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8d405037","line":6052,"range":{"start_line":6052,"start_character":27,"end_line":6052,"end_character":68},"updated":"2019-02-25 21:10:19.000000000","message":"Shouldn\u0027t we only call this if port_allocation is True(ish)? Looks like the deep down the method will handle that case:\n\nhttps://review.openstack.org/#/c/622421/27/nova/scheduler/client/report.py@1705\n\nBut that seems like a brittle interface to me.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6049,"context_line":"                # detached port."},{"line_number":6050,"context_line":"                try:"},{"line_number":6051,"context_line":"                    client \u003d self.reportclient"},{"line_number":6052,"context_line":"                    client.remove_resources_from_instance_allocation("},{"line_number":6053,"context_line":"                        context, instance.uuid, port_allocation)"},{"line_number":6054,"context_line":"                except Exception as ex:"},{"line_number":6055,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_42d0cef7","line":6052,"range":{"start_line":6052,"start_character":27,"end_line":6052,"end_character":68},"in_reply_to":"9fdfeff1_8d405037","updated":"2019-02-27 12:48:59.000000000","message":"You are right. Added an extra if. Done.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6054,"context_line":"                except Exception as ex:"},{"line_number":6055,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":6056,"context_line":"                        LOG.warning(\u0027Failed to remove resource allocation \u0027"},{"line_number":6057,"context_line":"                                    \u0027of port %(port_id)s of instance. Error: \u0027"},{"line_number":6058,"context_line":"                                    \u0027%(error)s\u0027,"},{"line_number":6059,"context_line":"                                    {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":6060,"context_line":"                                    instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_6d43ac40","line":6057,"range":{"start_line":6057,"start_character":57,"end_line":6057,"end_character":59},"updated":"2019-02-25 21:10:19.000000000","message":"for","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6054,"context_line":"                except Exception as ex:"},{"line_number":6055,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":6056,"context_line":"                        LOG.warning(\u0027Failed to remove resource allocation \u0027"},{"line_number":6057,"context_line":"                                    \u0027of port %(port_id)s of instance. Error: \u0027"},{"line_number":6058,"context_line":"                                    \u0027%(error)s\u0027,"},{"line_number":6059,"context_line":"                                    {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":6060,"context_line":"                                    instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_62cdd25b","line":6057,"range":{"start_line":6057,"start_character":57,"end_line":6057,"end_character":59},"in_reply_to":"9fdfeff1_6d43ac40","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7070a78fa07c24e35c62d8ee50e7b1de97443eca","unresolved":false,"context_lines":[{"line_number":8181,"context_line":"            LOG.debug(\u0027Received event %(event)s\u0027,"},{"line_number":8182,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":8183,"context_line":"                      instance\u003dinstance)"},{"line_number":8184,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":8185,"context_line":"                try:"},{"line_number":8186,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":8187,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_540af0d1","line":8184,"updated":"2019-02-25 22:15:35.000000000","message":"I think we get this event if the port was detached out of band in neutron by the admin (or whoever) changes the device_id on the port - in that case, we\u0027d be leaking the allocation for that port in placement, right?\n\nThere is also the network-vif-deleted case below where the port is outright deleted. That\u0027s another case where we wouldn\u0027t be cleaning up the allocation on the port, right? It of seems like neutron should be taking care of this for us since it manages the ports.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f9dd35f2e0fb01ff97258bea17ebfd0417a2dac9","unresolved":false,"context_lines":[{"line_number":8181,"context_line":"            LOG.debug(\u0027Received event %(event)s\u0027,"},{"line_number":8182,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":8183,"context_line":"                      instance\u003dinstance)"},{"line_number":8184,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":8185,"context_line":"                try:"},{"line_number":8186,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":8187,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_941a98c3","line":8184,"in_reply_to":"9fdfeff1_540af0d1","updated":"2019-02-25 22:29:22.000000000","message":"For the detached out of band case (network-changed I think) we can get the allocation from the port\u0027s binding:profile (I think), and for the port deleted out of band case we can\u0027t get the allocation from the port\u0027s binding:profile because the port is gone, but thankfully we store the binding:profile in the info cache, so we could at least make a best effort attempt at cleaning up the allocations if the port is deleted out of band (Sean Mooney reminded me that we cache the profile). Anyway, probably something to at least mark with TODOs here.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"37b46d8a96e74cba356770364617c1160d1a1f95","unresolved":false,"context_lines":[{"line_number":8181,"context_line":"            LOG.debug(\u0027Received event %(event)s\u0027,"},{"line_number":8182,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":8183,"context_line":"                      instance\u003dinstance)"},{"line_number":8184,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":8185,"context_line":"                try:"},{"line_number":8186,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":8187,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_eaebeba0","line":8184,"in_reply_to":"9fdfeff1_941a98c3","updated":"2019-02-26 17:13:26.000000000","message":"I see the notification when the port is deleted but I don\u0027t see the notification coming when the device_id and device_owner is changed in the bound port.\n\nI will add a TODO but it feels like something that is pretty extreme to support.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":8181,"context_line":"            LOG.debug(\u0027Received event %(event)s\u0027,"},{"line_number":8182,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":8183,"context_line":"                      instance\u003dinstance)"},{"line_number":8184,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":8185,"context_line":"                try:"},{"line_number":8186,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":8187,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_4a5c604a","line":8184,"in_reply_to":"9fdfeff1_eaebeba0","updated":"2019-02-27 14:43:54.000000000","message":"\u003e I see the notification when the port is deleted but I don\u0027t see the\n \u003e notification coming when the device_id and device_owner is changed\n \u003e in the bound port.\n \u003e \n \u003e I will add a TODO but it feels like something that is pretty\n \u003e extreme to support.\n\nI agree it\u0027s not something we should bend over backwards to support, but neutron definitely doesn\u0027t help us here (unlike how cinder will not allow a user to delete a volume that is in-use unless you force detach/delete it as admin). So I\u0027m OK with a TODO so we don\u0027t forget about it.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":8181,"context_line":"            LOG.debug(\u0027Received event %(event)s\u0027,"},{"line_number":8182,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":8183,"context_line":"                      instance\u003dinstance)"},{"line_number":8184,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":8185,"context_line":"                try:"},{"line_number":8186,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":8187,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8230f656","line":8184,"in_reply_to":"9fdfeff1_eaebeba0","updated":"2019-02-27 12:48:59.000000000","message":"Added a TODO. Done.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":5954,"context_line":"        except Exception as ex:"},{"line_number":5955,"context_line":"            if raise_on_failure:"},{"line_number":5956,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":5957,"context_line":"                    # Since this is a cast operation, log the failure for"},{"line_number":5958,"context_line":"                    # triage."},{"line_number":5959,"context_line":"                    LOG.warning(\u0027Failed to deallocate port %(port_id)s \u0027"},{"line_number":5960,"context_line":"                                \u0027for instance. Error: %(error)s\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_0a8bb8bf","line":5957,"range":{"start_line":5957,"start_character":38,"end_line":5957,"end_character":42},"updated":"2019-02-27 14:43:54.000000000","message":"This comment about the RPC cast is not true in all cases (attach_interface is a call, detach_interface is a cast). I would just remove the comment.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bbb064319129798098c0a1234ab1490ce0323a08","unresolved":false,"context_lines":[{"line_number":5954,"context_line":"        except Exception as ex:"},{"line_number":5955,"context_line":"            if raise_on_failure:"},{"line_number":5956,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":5957,"context_line":"                    # Since this is a cast operation, log the failure for"},{"line_number":5958,"context_line":"                    # triage."},{"line_number":5959,"context_line":"                    LOG.warning(\u0027Failed to deallocate port %(port_id)s \u0027"},{"line_number":5960,"context_line":"                                \u0027for instance. Error: %(error)s\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_da425968","line":5957,"range":{"start_line":5957,"start_character":38,"end_line":5957,"end_character":42},"in_reply_to":"9fdfeff1_0a8bb8bf","updated":"2019-02-27 17:09:27.000000000","message":"Done","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":5952,"context_line":"                context, instance, port_id)"},{"line_number":5953,"context_line":"            __, port_allocation \u003d result"},{"line_number":5954,"context_line":"        except Exception as ex:"},{"line_number":5955,"context_line":"            if raise_on_failure:"},{"line_number":5956,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":5957,"context_line":"                    # Since this is a cast operation, log the failure for"},{"line_number":5958,"context_line":"                    # triage."},{"line_number":5959,"context_line":"                    LOG.warning(\u0027Failed to deallocate port %(port_id)s \u0027"},{"line_number":5960,"context_line":"                                \u0027for instance. Error: %(error)s\u0027,"},{"line_number":5961,"context_line":"                                {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":5962,"context_line":"                                instance\u003dinstance)"},{"line_number":5963,"context_line":"            else:"},{"line_number":5964,"context_line":"                LOG.warning(\"deallocate port %(port_id)s failed\","},{"line_number":5965,"context_line":"                            {\u0027port_id\u0027: port_id}, instance\u003dinstance)"},{"line_number":5966,"context_line":""},{"line_number":5967,"context_line":"        else:"},{"line_number":5968,"context_line":"            if port_allocation:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_ea8d14d4","line":5965,"range":{"start_line":5955,"start_character":12,"end_line":5965,"end_character":68},"updated":"2019-02-27 14:43:54.000000000","message":"We don\u0027t need the if/else condition here because you can do this:\n\nwith excutils.save_and_reraise_exception(reraise\u003draise_on_failure):","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bbb064319129798098c0a1234ab1490ce0323a08","unresolved":false,"context_lines":[{"line_number":5952,"context_line":"                context, instance, port_id)"},{"line_number":5953,"context_line":"            __, port_allocation \u003d result"},{"line_number":5954,"context_line":"        except Exception as ex:"},{"line_number":5955,"context_line":"            if raise_on_failure:"},{"line_number":5956,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":5957,"context_line":"                    # Since this is a cast operation, log the failure for"},{"line_number":5958,"context_line":"                    # triage."},{"line_number":5959,"context_line":"                    LOG.warning(\u0027Failed to deallocate port %(port_id)s \u0027"},{"line_number":5960,"context_line":"                                \u0027for instance. Error: %(error)s\u0027,"},{"line_number":5961,"context_line":"                                {\u0027port_id\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":5962,"context_line":"                                instance\u003dinstance)"},{"line_number":5963,"context_line":"            else:"},{"line_number":5964,"context_line":"                LOG.warning(\"deallocate port %(port_id)s failed\","},{"line_number":5965,"context_line":"                            {\u0027port_id\u0027: port_id}, instance\u003dinstance)"},{"line_number":5966,"context_line":""},{"line_number":5967,"context_line":"        else:"},{"line_number":5968,"context_line":"            if port_allocation:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_7a26cdcd","line":5965,"range":{"start_line":5955,"start_character":12,"end_line":5965,"end_character":68},"in_reply_to":"9fdfeff1_ea8d14d4","updated":"2019-02-27 17:09:27.000000000","message":"Good catch. Done.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":5973,"context_line":"                    client.remove_resources_from_instance_allocation("},{"line_number":5974,"context_line":"                        context, instance.uuid, port_allocation)"},{"line_number":5975,"context_line":"                except Exception as ex:"},{"line_number":5976,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":5977,"context_line":"                        LOG.warning(\u0027Failed to remove resource allocation \u0027"},{"line_number":5978,"context_line":"                                    \u0027of port %(port_id)s for instance. Error: \u0027"},{"line_number":5979,"context_line":"                                    \u0027%(error)s\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_cac290e9","line":5976,"updated":"2019-02-27 14:43:54.000000000","message":"You might want to add a comment here about why raise_on_failure is not used here.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bbb064319129798098c0a1234ab1490ce0323a08","unresolved":false,"context_lines":[{"line_number":5973,"context_line":"                    client.remove_resources_from_instance_allocation("},{"line_number":5974,"context_line":"                        context, instance.uuid, port_allocation)"},{"line_number":5975,"context_line":"                except Exception as ex:"},{"line_number":5976,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":5977,"context_line":"                        LOG.warning(\u0027Failed to remove resource allocation \u0027"},{"line_number":5978,"context_line":"                                    \u0027of port %(port_id)s for instance. Error: \u0027"},{"line_number":5979,"context_line":"                                    \u0027%(error)s\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_dd057311","line":5976,"in_reply_to":"9fdfeff1_cac290e9","updated":"2019-02-27 17:09:27.000000000","message":"Done","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":5969,"context_line":"                except Exception as ex:"},{"line_number":5970,"context_line":"                    # We always raise here as it is not a race condition where"},{"line_number":5971,"context_line":"                    # somebody has already deleted the port we want to cleanup."},{"line_number":5972,"context_line":"                    # Here we see that the port exits, the allocation exists,"},{"line_number":5973,"context_line":"                    # but we cannot clean it up so we will actually leak"},{"line_number":5974,"context_line":"                    # allocations."},{"line_number":5975,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_53e2b802","line":5972,"range":{"start_line":5972,"start_character":48,"end_line":5972,"end_character":53},"updated":"2019-02-28 16:29:09.000000000","message":"exists","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":5969,"context_line":"                except Exception as ex:"},{"line_number":5970,"context_line":"                    # We always raise here as it is not a race condition where"},{"line_number":5971,"context_line":"                    # somebody has already deleted the port we want to cleanup."},{"line_number":5972,"context_line":"                    # Here we see that the port exits, the allocation exists,"},{"line_number":5973,"context_line":"                    # but we cannot clean it up so we will actually leak"},{"line_number":5974,"context_line":"                    # allocations."},{"line_number":5975,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_f38e4ccf","line":5972,"range":{"start_line":5972,"start_character":48,"end_line":5972,"end_character":53},"in_reply_to":"9fdfeff1_53e2b802","updated":"2019-02-28 16:46:58.000000000","message":"Done","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7070a78fa07c24e35c62d8ee50e7b1de97443eca","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                    raise exception.ExternalNetworkAttachForbidden("},{"line_number":621,"context_line":"                        network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":624,"context_line":"                      neutron, port_client\u003dNone):"},{"line_number":625,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id,"},{"line_number":626,"context_line":"        device_owner and dns_name."}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_14422810","line":623,"range":{"start_line":623,"start_character":8,"end_line":623,"end_character":21},"updated":"2019-02-25 22:15:35.000000000","message":"Let\u0027s say we\u0027re detaching a port that had a resource allocation in the binding:profile, shouldn\u0027t we null that out in here?","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ddbc7351d3f170a6785e73ce2836dcafd8726d2","unresolved":false,"context_lines":[{"line_number":620,"context_line":"                    raise exception.ExternalNetworkAttachForbidden("},{"line_number":621,"context_line":"                        network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":624,"context_line":"                      neutron, port_client\u003dNone):"},{"line_number":625,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id,"},{"line_number":626,"context_line":"        device_owner and dns_name."}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_b4e6bc15","line":623,"range":{"start_line":623,"start_character":8,"end_line":623,"end_character":21},"in_reply_to":"9fdfeff1_14422810","updated":"2019-02-25 22:19:43.000000000","message":"Oh nevermind L679.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1676,"context_line":"        :param context: the request context"},{"line_number":1677,"context_line":"        :param instance: the instance object the port is detached from"},{"line_number":1678,"context_line":"        :param port_id: the UUID of the port being detached"},{"line_number":1679,"context_line":"        :return: A NetworkInfo, port_allocation tuple, where the"},{"line_number":1680,"context_line":"                 port_allocation is a dict contains the resource allocation of"},{"line_number":1681,"context_line":"                 the port per resource provider uuid. E.g.:"},{"line_number":1682,"context_line":"                 {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8d6930bf","line":1679,"range":{"start_line":1679,"start_character":53,"end_line":1679,"end_character":54},"updated":"2019-02-25 21:10:19.000000000","message":"nix","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1676,"context_line":"        :param context: the request context"},{"line_number":1677,"context_line":"        :param instance: the instance object the port is detached from"},{"line_number":1678,"context_line":"        :param port_id: the UUID of the port being detached"},{"line_number":1679,"context_line":"        :return: A NetworkInfo, port_allocation tuple, where the"},{"line_number":1680,"context_line":"                 port_allocation is a dict contains the resource allocation of"},{"line_number":1681,"context_line":"                 the port per resource provider uuid. E.g.:"},{"line_number":1682,"context_line":"                 {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_f6ebc3d9","line":1679,"range":{"start_line":1679,"start_character":53,"end_line":1679,"end_character":54},"in_reply_to":"9fdfeff1_8d6930bf","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1677,"context_line":"        :param instance: the instance object the port is detached from"},{"line_number":1678,"context_line":"        :param port_id: the UUID of the port being detached"},{"line_number":1679,"context_line":"        :return: A NetworkInfo, port_allocation tuple, where the"},{"line_number":1680,"context_line":"                 port_allocation is a dict contains the resource allocation of"},{"line_number":1681,"context_line":"                 the port per resource provider uuid. E.g.:"},{"line_number":1682,"context_line":"                 {"},{"line_number":1683,"context_line":"                     rp_uuid: {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_6d5c0c19","line":1680,"range":{"start_line":1680,"start_character":43,"end_line":1680,"end_character":51},"updated":"2019-02-25 21:10:19.000000000","message":"either \"containing\" or \"which contains\"","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1677,"context_line":"        :param instance: the instance object the port is detached from"},{"line_number":1678,"context_line":"        :param port_id: the UUID of the port being detached"},{"line_number":1679,"context_line":"        :return: A NetworkInfo, port_allocation tuple, where the"},{"line_number":1680,"context_line":"                 port_allocation is a dict contains the resource allocation of"},{"line_number":1681,"context_line":"                 the port per resource provider uuid. E.g.:"},{"line_number":1682,"context_line":"                 {"},{"line_number":1683,"context_line":"                     rp_uuid: {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_16e9a7e1","line":1680,"range":{"start_line":1680,"start_character":43,"end_line":1680,"end_character":51},"in_reply_to":"9fdfeff1_6d5c0c19","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1686,"context_line":"                     }"},{"line_number":1687,"context_line":"                 }"},{"line_number":1688,"context_line":"                 Note that right now this dict only contains a single key as a"},{"line_number":1689,"context_line":"                 neutron port only allocation from a single resource provider."},{"line_number":1690,"context_line":"        \"\"\""},{"line_number":1691,"context_line":"        neutron \u003d get_client(context)"},{"line_number":1692,"context_line":"        # NOTE(gibi): we need to read the port resource information from"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_eda55c04","line":1689,"range":{"start_line":1689,"start_character":35,"end_line":1689,"end_character":45},"updated":"2019-02-25 21:10:19.000000000","message":"allocates","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1686,"context_line":"                     }"},{"line_number":1687,"context_line":"                 }"},{"line_number":1688,"context_line":"                 Note that right now this dict only contains a single key as a"},{"line_number":1689,"context_line":"                 neutron port only allocation from a single resource provider."},{"line_number":1690,"context_line":"        \"\"\""},{"line_number":1691,"context_line":"        neutron \u003d get_client(context)"},{"line_number":1692,"context_line":"        # NOTE(gibi): we need to read the port resource information from"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_36cf0b80","line":1689,"range":{"start_line":1689,"start_character":35,"end_line":1689,"end_character":45},"in_reply_to":"9fdfeff1_eda55c04","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1691,"context_line":"        neutron \u003d get_client(context)"},{"line_number":1692,"context_line":"        # NOTE(gibi): we need to read the port resource information from"},{"line_number":1693,"context_line":"        # neutron here as we might delete the port below"},{"line_number":1694,"context_line":"        port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1695,"context_line":"        preexisting_ports \u003d self._get_preexisting_port_ids(instance)"},{"line_number":1696,"context_line":"        if port_id in preexisting_ports:"},{"line_number":1697,"context_line":"            self._unbind_ports(context, [port_id], neutron)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_add99483","line":1694,"range":{"start_line":1694,"start_character":23,"end_line":1694,"end_character":32},"updated":"2019-02-25 21:10:19.000000000","message":"This could raise a 404 if the port is already gone. In fact, I remember fixing a related race bug for this in tempest recently:\n\nhttps://review.openstack.org/#/c/605488/\n\nSo we could hit a case where the server is being deleted at the same time this (asynchronous) call is made. So should we handle that and continue below to at least try and delete the VirtualInterface information? Note that _unbind_ports and _delete_ports both handle the port being gone already gracefully.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1691,"context_line":"        neutron \u003d get_client(context)"},{"line_number":1692,"context_line":"        # NOTE(gibi): we need to read the port resource information from"},{"line_number":1693,"context_line":"        # neutron here as we might delete the port below"},{"line_number":1694,"context_line":"        port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1695,"context_line":"        preexisting_ports \u003d self._get_preexisting_port_ids(instance)"},{"line_number":1696,"context_line":"        if port_id in preexisting_ports:"},{"line_number":1697,"context_line":"            self._unbind_ports(context, [port_id], neutron)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_b678dbf7","line":1694,"range":{"start_line":1694,"start_character":23,"end_line":1694,"end_character":32},"in_reply_to":"9fdfeff1_add99483","updated":"2019-02-27 12:48:59.000000000","message":"OK, let\u0027s handle 404 gracefully here.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1712,"context_line":"        # if there is resource associated to this port then that needs to"},{"line_number":1713,"context_line":"        # be deallocated so lets return info about such allocation"},{"line_number":1714,"context_line":"        port_allocation \u003d {}"},{"line_number":1715,"context_line":"        resource_request \u003d port.get(\u0027resource_request\u0027, None)"},{"line_number":1716,"context_line":"        allocated_rp \u003d port.get(BINDING_PROFILE, {}).get(\u0027allocation\u0027, None)"},{"line_number":1717,"context_line":"        if resource_request and allocated_rp:"},{"line_number":1718,"context_line":"            port_allocation \u003d {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_6ddf2c66","line":1715,"range":{"start_line":1715,"start_character":54,"end_line":1715,"end_character":60},"updated":"2019-02-25 21:10:19.000000000","message":"unnecessary with get()","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1712,"context_line":"        # if there is resource associated to this port then that needs to"},{"line_number":1713,"context_line":"        # be deallocated so lets return info about such allocation"},{"line_number":1714,"context_line":"        port_allocation \u003d {}"},{"line_number":1715,"context_line":"        resource_request \u003d port.get(\u0027resource_request\u0027, None)"},{"line_number":1716,"context_line":"        allocated_rp \u003d port.get(BINDING_PROFILE, {}).get(\u0027allocation\u0027, None)"},{"line_number":1717,"context_line":"        if resource_request and allocated_rp:"},{"line_number":1718,"context_line":"            port_allocation \u003d {"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_7657d35b","line":1715,"range":{"start_line":1715,"start_character":54,"end_line":1715,"end_character":60},"in_reply_to":"9fdfeff1_6ddf2c66","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1713,"context_line":"        # be deallocated so lets return info about such allocation"},{"line_number":1714,"context_line":"        port_allocation \u003d {}"},{"line_number":1715,"context_line":"        resource_request \u003d port.get(\u0027resource_request\u0027, None)"},{"line_number":1716,"context_line":"        allocated_rp \u003d port.get(BINDING_PROFILE, {}).get(\u0027allocation\u0027, None)"},{"line_number":1717,"context_line":"        if resource_request and allocated_rp:"},{"line_number":1718,"context_line":"            port_allocation \u003d {"},{"line_number":1719,"context_line":"                allocated_rp: resource_request.get(\u0027resources\u0027, {})}"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_0dd2205d","line":1716,"range":{"start_line":1716,"start_character":69,"end_line":1716,"end_character":75},"updated":"2019-02-25 21:10:19.000000000","message":"same","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1713,"context_line":"        # be deallocated so lets return info about such allocation"},{"line_number":1714,"context_line":"        port_allocation \u003d {}"},{"line_number":1715,"context_line":"        resource_request \u003d port.get(\u0027resource_request\u0027, None)"},{"line_number":1716,"context_line":"        allocated_rp \u003d port.get(BINDING_PROFILE, {}).get(\u0027allocation\u0027, None)"},{"line_number":1717,"context_line":"        if resource_request and allocated_rp:"},{"line_number":1718,"context_line":"            port_allocation \u003d {"},{"line_number":1719,"context_line":"                allocated_rp: resource_request.get(\u0027resources\u0027, {})}"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_3655cb50","line":1716,"range":{"start_line":1716,"start_character":69,"end_line":1716,"end_character":75},"in_reply_to":"9fdfeff1_0dd2205d","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dae4656a25b1a66ed47221eb30011710024f75e9","unresolved":false,"context_lines":[{"line_number":1694,"context_line":"            # NOTE(gibi): we need to read the port resource information from"},{"line_number":1695,"context_line":"            # neutron here as we might delete the port below"},{"line_number":1696,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1697,"context_line":"        except exception.PortNotFound:"},{"line_number":1698,"context_line":"            LOG.debug(\u0027Unable to show port %s as it no longer \u0027"},{"line_number":1699,"context_line":"                      \u0027exists.\u0027, port_id)"},{"line_number":1700,"context_line":"            port \u003d None"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_25734f82","line":1697,"updated":"2019-02-27 14:46:46.000000000","message":"One more small thing - you don\u0027t have a unit test for this case.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1694,"context_line":"            # NOTE(gibi): we need to read the port resource information from"},{"line_number":1695,"context_line":"            # neutron here as we might delete the port below"},{"line_number":1696,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1697,"context_line":"        except exception.PortNotFound:"},{"line_number":1698,"context_line":"            LOG.debug(\u0027Unable to show port %s as it no longer \u0027"},{"line_number":1699,"context_line":"                      \u0027exists.\u0027, port_id)"},{"line_number":1700,"context_line":"            port \u003d None"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_55f06591","line":1697,"in_reply_to":"9fdfeff1_25734f82","updated":"2019-02-28 16:46:58.000000000","message":"Done","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":1695,"context_line":"            # neutron here as we might delete the port below"},{"line_number":1696,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1697,"context_line":"        except exception.PortNotFound:"},{"line_number":1698,"context_line":"            LOG.debug(\u0027Unable to show port %s as it no longer \u0027"},{"line_number":1699,"context_line":"                      \u0027exists.\u0027, port_id)"},{"line_number":1700,"context_line":"            port \u003d None"},{"line_number":1701,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_e5178745","line":1698,"range":{"start_line":1698,"start_character":33,"end_line":1698,"end_character":37},"updated":"2019-02-27 14:43:54.000000000","message":"nit: this is probably copied from elsewhere, but here I\u0027d say something like \"Unable to determine port %s resource allocation information as the port no longer exists.\"","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bbb064319129798098c0a1234ab1490ce0323a08","unresolved":false,"context_lines":[{"line_number":1695,"context_line":"            # neutron here as we might delete the port below"},{"line_number":1696,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1697,"context_line":"        except exception.PortNotFound:"},{"line_number":1698,"context_line":"            LOG.debug(\u0027Unable to show port %s as it no longer \u0027"},{"line_number":1699,"context_line":"                      \u0027exists.\u0027, port_id)"},{"line_number":1700,"context_line":"            port \u003d None"},{"line_number":1701,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_1d4e9b6e","line":1698,"range":{"start_line":1698,"start_character":33,"end_line":1698,"end_character":37},"in_reply_to":"9fdfeff1_e5178745","updated":"2019-02-27 17:09:27.000000000","message":"Done","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":1716,"context_line":"            LOG.debug(\u0027VirtualInterface not found for port: %s\u0027,"},{"line_number":1717,"context_line":"                      port_id, instance\u003dinstance)"},{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"        if port:"},{"line_number":1720,"context_line":"            # if there is resource associated to this port then that needs to"},{"line_number":1721,"context_line":"            # be deallocated so lets return info about such allocation"},{"line_number":1722,"context_line":"            resource_request \u003d port.get(\u0027resource_request\u0027)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_a575ff99","line":1719,"updated":"2019-02-27 14:43:54.000000000","message":"Thinking out loud, if we don\u0027t get the port because it\u0027s already gone, should we just assume we failed a race and something else cleaned up the port? Or should we at least have an else block that looks for the corresponding vif in the info cache and if that vif has a binding profile with an \u0027allocation\u0027 stashed in it, we could log a warning that we were unable to cleanup allocations for the port but they might have already been cleaned up concurrently - or something to the effect that port resource allocations could have been leaked?","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1716,"context_line":"            LOG.debug(\u0027VirtualInterface not found for port: %s\u0027,"},{"line_number":1717,"context_line":"                      port_id, instance\u003dinstance)"},{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"        if port:"},{"line_number":1720,"context_line":"            # if there is resource associated to this port then that needs to"},{"line_number":1721,"context_line":"            # be deallocated so lets return info about such allocation"},{"line_number":1722,"context_line":"            resource_request \u003d port.get(\u0027resource_request\u0027)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_373281f3","line":1719,"in_reply_to":"9fdfeff1_a575ff99","updated":"2019-02-28 16:46:58.000000000","message":"I\u0027ve added a warning for this case. Done.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":1729,"context_line":"            # in that cache there is allocation in the profile then we suspect"},{"line_number":1730,"context_line":"            # that the port is disappeared without deallocating the resources."},{"line_number":1731,"context_line":"            for vif in instance.get_network_info():"},{"line_number":1732,"context_line":"                if vif[\u0027id\u0027] \u003d\u003d port_id:"},{"line_number":1733,"context_line":"                    profile \u003d vif.get(\u0027profile\u0027) or {}"},{"line_number":1734,"context_line":"                    rp_uuid \u003d profile.get(\u0027allocation\u0027)"},{"line_number":1735,"context_line":"                    if rp_uuid:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_13a430a2","line":1732,"range":{"start_line":1732,"start_character":16,"end_line":1732,"end_character":40},"updated":"2019-02-28 16:29:09.000000000","message":"You can break the loop once you\u0027ve found the matching VIF from the cache.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1729,"context_line":"            # in that cache there is allocation in the profile then we suspect"},{"line_number":1730,"context_line":"            # that the port is disappeared without deallocating the resources."},{"line_number":1731,"context_line":"            for vif in instance.get_network_info():"},{"line_number":1732,"context_line":"                if vif[\u0027id\u0027] \u003d\u003d port_id:"},{"line_number":1733,"context_line":"                    profile \u003d vif.get(\u0027profile\u0027) or {}"},{"line_number":1734,"context_line":"                    rp_uuid \u003d profile.get(\u0027allocation\u0027)"},{"line_number":1735,"context_line":"                    if rp_uuid:"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_53add82e","line":1732,"range":{"start_line":1732,"start_character":16,"end_line":1732,"end_character":40},"in_reply_to":"9fdfeff1_13a430a2","updated":"2019-02-28 16:46:58.000000000","message":"Done","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":1730,"context_line":"            # that the port is disappeared without deallocating the resources."},{"line_number":1731,"context_line":"            for vif in instance.get_network_info():"},{"line_number":1732,"context_line":"                if vif[\u0027id\u0027] \u003d\u003d port_id:"},{"line_number":1733,"context_line":"                    profile \u003d vif.get(\u0027profile\u0027) or {}"},{"line_number":1734,"context_line":"                    rp_uuid \u003d profile.get(\u0027allocation\u0027)"},{"line_number":1735,"context_line":"                    if rp_uuid:"},{"line_number":1736,"context_line":"                        LOG.warning("},{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_53ccf85f","line":1734,"range":{"start_line":1733,"start_character":20,"end_line":1734,"end_character":55},"updated":"2019-02-28 16:29:09.000000000","message":"This could be:\n\nrp_uuid \u003d vif.get(\u0027profile\u0027, {}).get(ALLOCATION)\n\nRemember you have a constant for allocation now.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9a60ae2c4d7e048f908a5509fc571603ebb1588d","unresolved":false,"context_lines":[{"line_number":1730,"context_line":"            # that the port is disappeared without deallocating the resources."},{"line_number":1731,"context_line":"            for vif in instance.get_network_info():"},{"line_number":1732,"context_line":"                if vif[\u0027id\u0027] \u003d\u003d port_id:"},{"line_number":1733,"context_line":"                    profile \u003d vif.get(\u0027profile\u0027) or {}"},{"line_number":1734,"context_line":"                    rp_uuid \u003d profile.get(\u0027allocation\u0027)"},{"line_number":1735,"context_line":"                    if rp_uuid:"},{"line_number":1736,"context_line":"                        LOG.warning("},{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_16a41ea2","line":1734,"range":{"start_line":1733,"start_character":20,"end_line":1734,"end_character":55},"in_reply_to":"9fdfeff1_3325b4c2","updated":"2019-02-28 16:48:42.000000000","message":"Yeah forgot about that and it\u0027s bitten me in the past I think.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1730,"context_line":"            # that the port is disappeared without deallocating the resources."},{"line_number":1731,"context_line":"            for vif in instance.get_network_info():"},{"line_number":1732,"context_line":"                if vif[\u0027id\u0027] \u003d\u003d port_id:"},{"line_number":1733,"context_line":"                    profile \u003d vif.get(\u0027profile\u0027) or {}"},{"line_number":1734,"context_line":"                    rp_uuid \u003d profile.get(\u0027allocation\u0027)"},{"line_number":1735,"context_line":"                    if rp_uuid:"},{"line_number":1736,"context_line":"                        LOG.warning("},{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_3325b4c2","line":1734,"range":{"start_line":1733,"start_character":20,"end_line":1734,"end_character":55},"in_reply_to":"9fdfeff1_53ccf85f","updated":"2019-02-28 16:46:58.000000000","message":"I need the \u0027or {}\u0027 part as profile is initialized to None if not provided so get(profile) would return None and None.get(\u0027allocation\u0027) blows.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":1736,"context_line":"                        LOG.warning("},{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"},{"line_number":1738,"context_line":"                            \u0027resource allocation on resource provider %s. \u0027"},{"line_number":1739,"context_line":"                            \u0027Resource allocation for this port is probably \u0027"},{"line_number":1740,"context_line":"                            \u0027leaked.\u0027, port_id, rp_uuid)"},{"line_number":1741,"context_line":""},{"line_number":1742,"context_line":"        return self.get_instance_nw_info(context, instance), port_allocation"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_333ff425","line":1739,"range":{"start_line":1739,"start_character":63,"end_line":1739,"end_character":74},"updated":"2019-02-28 16:29:09.000000000","message":"We don\u0027t know, so let\u0027s say \"may be\".","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1736,"context_line":"                        LOG.warning("},{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"},{"line_number":1738,"context_line":"                            \u0027resource allocation on resource provider %s. \u0027"},{"line_number":1739,"context_line":"                            \u0027Resource allocation for this port is probably \u0027"},{"line_number":1740,"context_line":"                            \u0027leaked.\u0027, port_id, rp_uuid)"},{"line_number":1741,"context_line":""},{"line_number":1742,"context_line":"        return self.get_instance_nw_info(context, instance), port_allocation"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_16b09e3f","line":1739,"range":{"start_line":1739,"start_character":63,"end_line":1739,"end_character":74},"in_reply_to":"9fdfeff1_333ff425","updated":"2019-02-28 16:46:58.000000000","message":"Done","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"},{"line_number":1738,"context_line":"                            \u0027resource allocation on resource provider %s. \u0027"},{"line_number":1739,"context_line":"                            \u0027Resource allocation for this port is probably \u0027"},{"line_number":1740,"context_line":"                            \u0027leaked.\u0027, port_id, rp_uuid)"},{"line_number":1741,"context_line":""},{"line_number":1742,"context_line":"        return self.get_instance_nw_info(context, instance), port_allocation"},{"line_number":1743,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_f3440cba","line":1740,"updated":"2019-02-28 16:29:09.000000000","message":"Throw the instance\u003dinstance kwarg in the warning() call as well.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24d0b0da683bad9a05aa5713b2f3981454eed776","unresolved":false,"context_lines":[{"line_number":1737,"context_line":"                            \u0027Port %s disappeared during deallocate but it had \u0027"},{"line_number":1738,"context_line":"                            \u0027resource allocation on resource provider %s. \u0027"},{"line_number":1739,"context_line":"                            \u0027Resource allocation for this port is probably \u0027"},{"line_number":1740,"context_line":"                            \u0027leaked.\u0027, port_id, rp_uuid)"},{"line_number":1741,"context_line":""},{"line_number":1742,"context_line":"        return self.get_instance_nw_info(context, instance), port_allocation"},{"line_number":1743,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_767a4a77","line":1740,"in_reply_to":"9fdfeff1_f3440cba","updated":"2019-02-28 16:46:58.000000000","message":"Done","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"647540ed1dd7b5f2895fddefa06eb477b0e7552f","unresolved":false,"context_lines":[{"line_number":1689,"context_line":"        port_allocation \u003d {}"},{"line_number":1690,"context_line":"        try:"},{"line_number":1691,"context_line":"            # NOTE(gibi): we need to read the port resource information from"},{"line_number":1692,"context_line":"            # neutron here as we might delete the port below"},{"line_number":1693,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":1694,"context_line":"        except exception.PortNotFound:"},{"line_number":1695,"context_line":"            LOG.debug(\u0027Unable to determine port %s resource allocation \u0027"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_6dcb5571","line":1692,"updated":"2019-02-28 20:21:58.000000000","message":"✔","commit_id":"859a0ac11842101c902a98165277175d984c3352"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                 communicate with the placement API"},{"line_number":1683,"context_line":"        \"\"\""},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        # Note(gibi): It is just a small wrapper to raise instead of return"},{"line_number":1686,"context_line":"        # if we run out of retries."},{"line_number":1687,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1688,"context_line":"                context, consumer_uuid, resources):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_2d3cc491","line":1685,"range":{"start_line":1685,"start_character":10,"end_line":1685,"end_character":14},"updated":"2019-02-25 21:10:19.000000000","message":"NOTE","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                 communicate with the placement API"},{"line_number":1683,"context_line":"        \"\"\""},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        # Note(gibi): It is just a small wrapper to raise instead of return"},{"line_number":1686,"context_line":"        # if we run out of retries."},{"line_number":1687,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1688,"context_line":"                context, consumer_uuid, resources):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_dcf4a35d","line":1685,"range":{"start_line":1685,"start_character":10,"end_line":1685,"end_character":14},"in_reply_to":"9fdfeff1_2d3cc491","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1708,"context_line":""},{"line_number":1709,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s.\""},{"line_number":1710,"context_line":""},{"line_number":1711,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1712,"context_line":"            raise exception.AllocationUpdateFailed("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ad00b435","line":1709,"updated":"2019-02-25 21:10:19.000000000","message":"nit: I\u0027d personally avoid a generic error reason for each of the specific errors below to help with debugging since that leaves the person looking at the logs to have to figure out just what about the resources_to_remove and current_allocs is causing the failure. Plus then in your tests you can explicitly check that you\u0027re asserting AllocationUpdateFailed for the correct reason, e.g.:\n\nex \u003d self.assertRaises(exception.AllocationUpdateFailed, ...)\nself.assertIn(\u0027something i expect for this test\u0027, six.text_type(ex))","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1708,"context_line":""},{"line_number":1709,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s.\""},{"line_number":1710,"context_line":""},{"line_number":1711,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1712,"context_line":"            raise exception.AllocationUpdateFailed("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e709d4dc","line":1709,"in_reply_to":"9fdfeff1_ad00b435","updated":"2019-02-27 12:48:59.000000000","message":"You are right, I guess I was lazy. Done.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1709,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s.\""},{"line_number":1710,"context_line":""},{"line_number":1711,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1712,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1713,"context_line":"                consumer_uuid\u003dconsumer_uuid,"},{"line_number":1714,"context_line":"                error\u003derror_reason % (resources, current_allocs))"},{"line_number":1715,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cd55f8c3","line":1712,"updated":"2019-02-25 21:10:19.000000000","message":"Is this really what we want? If we\u0027re trying to remove resources from the allocations for the consumer, and the consumer already has no allocations, then why complain about it? Clearly we just lost a race but the end result is what we wanted anyway.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":1709,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s.\""},{"line_number":1710,"context_line":""},{"line_number":1711,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1712,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1713,"context_line":"                consumer_uuid\u003dconsumer_uuid,"},{"line_number":1714,"context_line":"                error\u003derror_reason % (resources, current_allocs))"},{"line_number":1715,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ea451445","line":1712,"in_reply_to":"9fdfeff1_a7574c01","updated":"2019-02-27 14:43:54.000000000","message":"I\u0027ll defer to your judgement and if this causes problems we\u0027ll deal with it later when we have an actual bug.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1709,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s.\""},{"line_number":1710,"context_line":""},{"line_number":1711,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1712,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1713,"context_line":"                consumer_uuid\u003dconsumer_uuid,"},{"line_number":1714,"context_line":"                error\u003derror_reason % (resources, current_allocs))"},{"line_number":1715,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_a7574c01","line":1712,"in_reply_to":"9fdfeff1_cd55f8c3","updated":"2019-02-27 12:48:59.000000000","message":"Yeah one way to look at this is that we don\u0027t have to do anything if there is no allocation as somebody removed it already. \n\nBelow, from L1720, we try to subtract the resource from the allocation and if we cannot then we fail. Would you agree that this can be also because we lost a race and somebody already removed what we trying to remove? The problem there is that what if we can only partially remove the resources? Should we a) allow the partial remove and commit it, b) do not remove anything if it would be partial but pass, c) or fail (as it is implemented now)?\n\nThe trick is that on the PR there can be resources from this RCs due to other ports that might allow a partial remove to succeed here (option a) while the current removal was already done. So this could would remove more than it should be. \n\nI think fail is the safest thing here.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1748,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1749,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":1750,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":1751,"context_line":"                # NOTE(jaypipes): Yes, it sucks doing string comparison like"},{"line_number":1752,"context_line":"                # this but we have no error codes, only error messages."},{"line_number":1753,"context_line":"                reason \u003d (\u0027another process changed the resource providers or \u0027"},{"line_number":1754,"context_line":"                          \u0027the consumer involved in our attempt to update \u0027"},{"line_number":1755,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ed28fc33","line":1752,"range":{"start_line":1751,"start_character":16,"end_line":1752,"end_character":71},"updated":"2019-02-25 21:10:19.000000000","message":"I see this block is mostly copied from put_allocations but this code is not doing any string comparison whereas put_allocations is, so we can remove this comment right?","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1748,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1749,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":1750,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":1751,"context_line":"                # NOTE(jaypipes): Yes, it sucks doing string comparison like"},{"line_number":1752,"context_line":"                # this but we have no error codes, only error messages."},{"line_number":1753,"context_line":"                reason \u003d (\u0027another process changed the resource providers or \u0027"},{"line_number":1754,"context_line":"                          \u0027the consumer involved in our attempt to update \u0027"},{"line_number":1755,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_fc29679b","line":1752,"range":{"start_line":1751,"start_character":16,"end_line":1752,"end_character":71},"in_reply_to":"9fdfeff1_ed28fc33","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":1755,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"},{"line_number":1756,"context_line":"                          \u0027resources %s from the current allocation %s\u0027 %"},{"line_number":1757,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1758,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1759,"context_line":"                # remove the resources from the updated allocations."},{"line_number":1760,"context_line":"                raise Retry("},{"line_number":1761,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_4d17c8ef","line":1758,"updated":"2019-02-25 21:10:19.000000000","message":"And we might have a chance on retry because if we failed on a generation conflict, then on the next pass we\u0027d fetch the current allocations with the current generation. At least that is the idea correct?","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":1755,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"},{"line_number":1756,"context_line":"                          \u0027resources %s from the current allocation %s\u0027 %"},{"line_number":1757,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1758,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1759,"context_line":"                # remove the resources from the updated allocations."},{"line_number":1760,"context_line":"                raise Retry("},{"line_number":1761,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_3c760fda","line":1758,"in_reply_to":"9fdfeff1_4d17c8ef","updated":"2019-02-27 12:48:59.000000000","message":"Correct. Added it to the note.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"}],"nova/tests/functional/integrated_helpers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        self.fail(\u0027Timed out waiting for migration with status \"%s\" for \u0027"},{"line_number":354,"context_line":"                  \u0027instance: %s\u0027 % (expected_statuses, server[\u0027id\u0027]))"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def _wait_for_port_unbind(self, neutron, port_id, retries\u003d10):"},{"line_number":357,"context_line":"        for attempt in range(retries):"},{"line_number":358,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":359,"context_line":"            if port[\u0027binding:host_id\u0027] is None:"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_2dc12455","line":356,"updated":"2019-02-25 21:10:19.000000000","message":"Another way to skin this cat is to wait for the interface_detach.end versioned notification, right? But maybe the test that is using this isn\u0027t using the fake_notifier so this is more generic.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        self.fail(\u0027Timed out waiting for migration with status \"%s\" for \u0027"},{"line_number":354,"context_line":"                  \u0027instance: %s\u0027 % (expected_statuses, server[\u0027id\u0027]))"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def _wait_for_port_unbind(self, neutron, port_id, retries\u003d10):"},{"line_number":357,"context_line":"        for attempt in range(retries):"},{"line_number":358,"context_line":"            port \u003d neutron.show_port(port_id)[\u0027port\u0027]"},{"line_number":359,"context_line":"            if port[\u0027binding:host_id\u0027] is None:"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ac4c0c76","line":356,"in_reply_to":"9fdfeff1_2dc12455","updated":"2019-02-27 12:48:59.000000000","message":"It depends on that the interface_detach.end comes after the allocation is deleted from the port binding. :)","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6291,"context_line":"        self.assertEqual(self.sriov_pf2_rp_uuid,"},{"line_number":6292,"context_line":"                         sriov_binding[\u0027allocation\u0027])"},{"line_number":6293,"context_line":""},{"line_number":6294,"context_line":"    # Mocking detach is a hack but the fake virt driver does not allow"},{"line_number":6295,"context_line":"    # detaching interfaces that are added during the boot. Also the fake virt"},{"line_number":6296,"context_line":"    # driver is not easy to fix to allow it. In the other hand ports with"},{"line_number":6297,"context_line":"    # bandwidth request cannot be attached after the server is booted."},{"line_number":6298,"context_line":"    @mock.patch(\u0027nova.virt.fake.SmallFakeDriver.detach_interface\u0027)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8da29099","line":6295,"range":{"start_line":6294,"start_character":4,"end_line":6295,"end_character":58},"updated":"2019-02-25 21:10:19.000000000","message":"Looks like this is simply due to the FakeDriver.spawn() not adding anything to self._interfaces, is that correct? That should be pretty simple to add:\n\ndef spawn(...):\n   if network_info:\n       self._interfaces \u003d {vif[\u0027id\u0027]: vif for vif in network_info}\n   ...","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":6291,"context_line":"        self.assertEqual(self.sriov_pf2_rp_uuid,"},{"line_number":6292,"context_line":"                         sriov_binding[\u0027allocation\u0027])"},{"line_number":6293,"context_line":""},{"line_number":6294,"context_line":"    # Mocking detach is a hack but the fake virt driver does not allow"},{"line_number":6295,"context_line":"    # detaching interfaces that are added during the boot. Also the fake virt"},{"line_number":6296,"context_line":"    # driver is not easy to fix to allow it. In the other hand ports with"},{"line_number":6297,"context_line":"    # bandwidth request cannot be attached after the server is booted."},{"line_number":6298,"context_line":"    @mock.patch(\u0027nova.virt.fake.SmallFakeDriver.detach_interface\u0027)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_055c0b17","line":6295,"range":{"start_line":6294,"start_character":4,"end_line":6295,"end_character":58},"in_reply_to":"9fdfeff1_8ca58805","updated":"2019-02-27 14:43:54.000000000","message":"\u003e I remember I tried to fix it this way but broke many existing test.\n \u003e However now your proposed fix works seamlessly. So I did it.\n\nmagic!","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6291,"context_line":"        self.assertEqual(self.sriov_pf2_rp_uuid,"},{"line_number":6292,"context_line":"                         sriov_binding[\u0027allocation\u0027])"},{"line_number":6293,"context_line":""},{"line_number":6294,"context_line":"    # Mocking detach is a hack but the fake virt driver does not allow"},{"line_number":6295,"context_line":"    # detaching interfaces that are added during the boot. Also the fake virt"},{"line_number":6296,"context_line":"    # driver is not easy to fix to allow it. In the other hand ports with"},{"line_number":6297,"context_line":"    # bandwidth request cannot be attached after the server is booted."},{"line_number":6298,"context_line":"    @mock.patch(\u0027nova.virt.fake.SmallFakeDriver.detach_interface\u0027)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8ca58805","line":6295,"range":{"start_line":6294,"start_character":4,"end_line":6295,"end_character":58},"in_reply_to":"9fdfeff1_8da29099","updated":"2019-02-27 12:48:59.000000000","message":"I remember I tried to fix it this way but broke many existing test. However now your proposed fix works seamlessly. So I did it.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6316,"context_line":"        allocations \u003d self.placement_api.get("},{"line_number":6317,"context_line":"            \u0027/allocations/%s\u0027 % server[\u0027id\u0027]).body[\u0027allocations\u0027]"},{"line_number":6318,"context_line":""},{"line_number":6319,"context_line":"        # We expect that the port related resource allocations are removed"},{"line_number":6320,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":6321,"context_line":"        compute_allocations \u003d allocations[self.compute1_rp_uuid][\u0027resources\u0027]"},{"line_number":6322,"context_line":"        self.assertEqual(self._resources_from_flavor(self.flavor),"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cdadf884","line":6319,"updated":"2019-02-25 21:10:19.000000000","message":"You never asserted that the port resources were allocated to the server after the server was created, so this could be a false positive correct?","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6316,"context_line":"        allocations \u003d self.placement_api.get("},{"line_number":6317,"context_line":"            \u0027/allocations/%s\u0027 % server[\u0027id\u0027]).body[\u0027allocations\u0027]"},{"line_number":6318,"context_line":""},{"line_number":6319,"context_line":"        # We expect that the port related resource allocations are removed"},{"line_number":6320,"context_line":"        self.assertEqual(1, len(allocations))"},{"line_number":6321,"context_line":"        compute_allocations \u003d allocations[self.compute1_rp_uuid][\u0027resources\u0027]"},{"line_number":6322,"context_line":"        self.assertEqual(self._resources_from_flavor(self.flavor),"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ec68d488","line":6319,"in_reply_to":"9fdfeff1_cdadf884","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":6322,"context_line":"        self.assertEqual(self._resources_from_flavor(self.flavor),"},{"line_number":6323,"context_line":"                         compute_allocations)"},{"line_number":6324,"context_line":""},{"line_number":6325,"context_line":"        # We expect that the allocation is removed from the port too"},{"line_number":6326,"context_line":"        binding_profile \u003d updated_port[\u0027binding:profile\u0027]"},{"line_number":6327,"context_line":"        self.assertNotIn(\u0027allocation\u0027, binding_profile)"},{"line_number":6328,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_0ddd4013","line":6325,"updated":"2019-02-25 21:10:19.000000000","message":"Same - would be good to assert the allocation was set on the port prior to detaching it.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":6322,"context_line":"        self.assertEqual(self._resources_from_flavor(self.flavor),"},{"line_number":6323,"context_line":"                         compute_allocations)"},{"line_number":6324,"context_line":""},{"line_number":6325,"context_line":"        # We expect that the allocation is removed from the port too"},{"line_number":6326,"context_line":"        binding_profile \u003d updated_port[\u0027binding:profile\u0027]"},{"line_number":6327,"context_line":"        self.assertNotIn(\u0027allocation\u0027, binding_profile)"},{"line_number":6328,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_2cf81cc2","line":6325,"in_reply_to":"9fdfeff1_0ddd4013","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"647540ed1dd7b5f2895fddefa06eb477b0e7552f","unresolved":false,"context_lines":[{"line_number":6266,"context_line":"        # compute rp and one set for the networking resources on the ovs bridge"},{"line_number":6267,"context_line":"        # rp due to the port resource request"},{"line_number":6268,"context_line":"        self.assertEqual(2, len(allocations))"},{"line_number":6269,"context_line":"        compute_allocations \u003d allocations[self.compute1_rp_uuid][\u0027resources\u0027]"},{"line_number":6270,"context_line":"        network_allocations \u003d allocations["},{"line_number":6271,"context_line":"            self.ovs_bridge_rp_per_host[self.compute1_rp_uuid]][\u0027resources\u0027]"},{"line_number":6272,"context_line":""},{"line_number":6273,"context_line":"        self.assertEqual(self._resources_from_flavor(self.flavor),"},{"line_number":6274,"context_line":"                         compute_allocations)"}],"source_content_type":"text/x-python","patch_set":33,"id":"9fdfeff1_0d45e9b3","line":6271,"range":{"start_line":6269,"start_character":0,"end_line":6271,"end_character":76},"updated":"2019-02-28 20:21:58.000000000","message":"tiny suggestion... it might be worth adding these assertions before attempting to access allocations[self.compute1_rp_uuid] and allocations[self.ovs_bridge_rp_per_host[self.compute1_rp_uuid]]:\n\n self.assertIn(self.compute1_rp_uuid, allocations)\n self.assertIn(self.ovs_bridge_rp_per_host[self.compute1_rp_uuid], allocations)\n\notherwise KeyError might be hard to reason about in a potential test failure.","commit_id":"859a0ac11842101c902a98165277175d984c3352"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"636d0ef1a3b375b9fe3ce07e6370436bb9c36259","unresolved":false,"context_lines":[{"line_number":4910,"context_line":"        self.assertEqual({}, port_allocation)"},{"line_number":4911,"context_line":"        self.assertIn("},{"line_number":4912,"context_line":"            \u0027Resource allocation for this port is probably leaked\u0027,"},{"line_number":4913,"context_line":"            self.stdlog.logger.output)"},{"line_number":4914,"context_line":""},{"line_number":4915,"context_line":"    def test_delete_nic_metadata(self):"},{"line_number":4916,"context_line":"        vif \u003d objects.VirtualInterface(address\u003d\u0027aa:bb:cc:dd:ee:ff\u0027, tag\u003d\u0027foo\u0027)"}],"source_content_type":"text/x-python","patch_set":32,"id":"9fdfeff1_930d8090","line":4913,"range":{"start_line":4913,"start_character":12,"end_line":4913,"end_character":37},"updated":"2019-02-28 16:29:09.000000000","message":"I wouldn\u0027t have thought about using this, but it works. I probably would have mocked the LOG.warning call and assert it was called with the expected message, but this works and doesn\u0027t require mocking or caring what the logging level is.","commit_id":"131e37c61b699e555e8c7dff225e27b89ca3b4cf"}],"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":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3329,"context_line":"        }"},{"line_number":3330,"context_line":"        resources_to_remove \u003d {"},{"line_number":3331,"context_line":"            uuids.rp1: {"},{"line_number":3332,"context_line":"                \u0027NET_BW_EGR_KILOBIT_PER_SEC\u0027: 200,"},{"line_number":3333,"context_line":"                \u0027NET_BW_IGR_KILOBIT_PER_SEC\u0027: 200,"},{"line_number":3334,"context_line":"            }"},{"line_number":3335,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ed355c46","line":3332,"updated":"2019-02-25 21:10:19.000000000","message":"A comment would be nice to indicate this should be removed because its allocated value results in 0.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3329,"context_line":"        }"},{"line_number":3330,"context_line":"        resources_to_remove \u003d {"},{"line_number":3331,"context_line":"            uuids.rp1: {"},{"line_number":3332,"context_line":"                \u0027NET_BW_EGR_KILOBIT_PER_SEC\u0027: 200,"},{"line_number":3333,"context_line":"                \u0027NET_BW_IGR_KILOBIT_PER_SEC\u0027: 200,"},{"line_number":3334,"context_line":"            }"},{"line_number":3335,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8741e865","line":3332,"in_reply_to":"9fdfeff1_ed355c46","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3446,"context_line":"        }"},{"line_number":3447,"context_line":""},{"line_number":3448,"context_line":"        self.assertRaises("},{"line_number":3449,"context_line":"            exception.AllocationUpdateFailed, self._test_remove_res_from_alloc,"},{"line_number":3450,"context_line":"            current_allocations, resources_to_remove, None)"},{"line_number":3451,"context_line":""},{"line_number":3452,"context_line":"    def test_remove_res_from_alloc_missing_rp(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_6d416ca6","line":3449,"range":{"start_line":3449,"start_character":22,"end_line":3449,"end_character":44},"updated":"2019-02-25 21:10:19.000000000","message":"This seems like another case of, why do we raise? We\u0027re asking to remove something that\u0027s already gone - why not just log it but not raise because the end state is what we wanted anyway.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3446,"context_line":"        }"},{"line_number":3447,"context_line":""},{"line_number":3448,"context_line":"        self.assertRaises("},{"line_number":3449,"context_line":"            exception.AllocationUpdateFailed, self._test_remove_res_from_alloc,"},{"line_number":3450,"context_line":"            current_allocations, resources_to_remove, None)"},{"line_number":3451,"context_line":""},{"line_number":3452,"context_line":"    def test_remove_res_from_alloc_missing_rp(self):"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e73554f8","line":3449,"range":{"start_line":3449,"start_character":22,"end_line":3449,"end_character":44},"in_reply_to":"9fdfeff1_6d416ca6","updated":"2019-02-27 12:48:59.000000000","message":"See my question about allowing a partial remove in the report.py","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3605,"context_line":"        get_rsp \u003d fake_requests.FakeResponse("},{"line_number":3606,"context_line":"            200, content\u003djsonutils.dumps(current_allocations))"},{"line_number":3607,"context_line":""},{"line_number":3608,"context_line":"        mock_get.side_effect \u003d [get_rsp, get_rsp, get_rsp, get_rsp]"},{"line_number":3609,"context_line":""},{"line_number":3610,"context_line":"        put_rsp \u003d fake_requests.FakeResponse("},{"line_number":3611,"context_line":"            status_code\u003d409,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_0d79c0fa","line":3608,"range":{"start_line":3608,"start_character":17,"end_line":3608,"end_character":28},"updated":"2019-02-25 21:10:19.000000000","message":"This can just be return_value since the response doesn\u0027t change, right?","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3605,"context_line":"        get_rsp \u003d fake_requests.FakeResponse("},{"line_number":3606,"context_line":"            200, content\u003djsonutils.dumps(current_allocations))"},{"line_number":3607,"context_line":""},{"line_number":3608,"context_line":"        mock_get.side_effect \u003d [get_rsp, get_rsp, get_rsp, get_rsp]"},{"line_number":3609,"context_line":""},{"line_number":3610,"context_line":"        put_rsp \u003d fake_requests.FakeResponse("},{"line_number":3611,"context_line":"            status_code\u003d409,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_670ac426","line":3608,"range":{"start_line":3608,"start_character":17,"end_line":3608,"end_character":28},"in_reply_to":"9fdfeff1_0d79c0fa","updated":"2019-02-27 12:48:59.000000000","message":"You are technically correct but I changed this to [get_rps] * 4 to show that the number or returns are significant.","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3613,"context_line":"                    {\u0027errors\u0027: [{\u0027code\u0027: \u0027placement.concurrent_update\u0027,"},{"line_number":3614,"context_line":"                                 \u0027detail\u0027: \u0027\u0027}]}))"},{"line_number":3615,"context_line":""},{"line_number":3616,"context_line":"        mock_put.side_effect \u003d [put_rsp, put_rsp, put_rsp, put_rsp]"},{"line_number":3617,"context_line":""},{"line_number":3618,"context_line":"        self.assertRaises("},{"line_number":3619,"context_line":"            exception.AllocationUpdateFailed,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_2d7e04e4","line":3616,"range":{"start_line":3616,"start_character":17,"end_line":3616,"end_character":28},"updated":"2019-02-25 21:10:19.000000000","message":"same","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3613,"context_line":"                    {\u0027errors\u0027: [{\u0027code\u0027: \u0027placement.concurrent_update\u0027,"},{"line_number":3614,"context_line":"                                 \u0027detail\u0027: \u0027\u0027}]}))"},{"line_number":3615,"context_line":""},{"line_number":3616,"context_line":"        mock_put.side_effect \u003d [put_rsp, put_rsp, put_rsp, put_rsp]"},{"line_number":3617,"context_line":""},{"line_number":3618,"context_line":"        self.assertRaises("},{"line_number":3619,"context_line":"            exception.AllocationUpdateFailed,"}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_0703b811","line":3616,"range":{"start_line":3616,"start_character":17,"end_line":3616,"end_character":28},"in_reply_to":"9fdfeff1_2d7e04e4","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3624,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, version\u003d\u00271.28\u0027,"},{"line_number":3625,"context_line":"            global_request_id\u003dself.context.global_id)"},{"line_number":3626,"context_line":""},{"line_number":3627,"context_line":"        self.assertEqual("},{"line_number":3628,"context_line":"            [get_call, get_call, get_call, get_call],"},{"line_number":3629,"context_line":"            mock_get.mock_calls)"},{"line_number":3630,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_cd57385a","line":3627,"range":{"start_line":3627,"start_character":13,"end_line":3627,"end_character":24},"updated":"2019-02-25 21:10:19.000000000","message":"nit: use mock_get.assert_has_calls([get_call] * 4) instead","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3624,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, version\u003d\u00271.28\u0027,"},{"line_number":3625,"context_line":"            global_request_id\u003dself.context.global_id)"},{"line_number":3626,"context_line":""},{"line_number":3627,"context_line":"        self.assertEqual("},{"line_number":3628,"context_line":"            [get_call, get_call, get_call, get_call],"},{"line_number":3629,"context_line":"            mock_get.mock_calls)"},{"line_number":3630,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_623dd2b9","line":3627,"range":{"start_line":3627,"start_character":13,"end_line":3627,"end_character":24},"in_reply_to":"9fdfeff1_cd57385a","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3625,"context_line":"            global_request_id\u003dself.context.global_id)"},{"line_number":3626,"context_line":""},{"line_number":3627,"context_line":"        self.assertEqual("},{"line_number":3628,"context_line":"            [get_call, get_call, get_call, get_call],"},{"line_number":3629,"context_line":"            mock_get.mock_calls)"},{"line_number":3630,"context_line":""},{"line_number":3631,"context_line":"        put_call \u003d mock.call("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_ad699425","line":3628,"range":{"start_line":3628,"start_character":12,"end_line":3628,"end_character":52},"updated":"2019-02-25 21:10:19.000000000","message":"Could also be: [get_call] * 4","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3625,"context_line":"            global_request_id\u003dself.context.global_id)"},{"line_number":3626,"context_line":""},{"line_number":3627,"context_line":"        self.assertEqual("},{"line_number":3628,"context_line":"            [get_call, get_call, get_call, get_call],"},{"line_number":3629,"context_line":"            mock_get.mock_calls)"},{"line_number":3630,"context_line":""},{"line_number":3631,"context_line":"        put_call \u003d mock.call("}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_02464651","line":3628,"range":{"start_line":3628,"start_character":12,"end_line":3628,"end_character":52},"in_reply_to":"9fdfeff1_ad699425","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3632,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, updated_allocations,"},{"line_number":3633,"context_line":"            version\u003d\u00271.28\u0027, global_request_id\u003dself.context.global_id)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self.assertEqual("},{"line_number":3636,"context_line":"            [put_call, put_call, put_call, put_call],"},{"line_number":3637,"context_line":"            mock_put.mock_calls)"},{"line_number":3638,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_8d55b052","line":3635,"range":{"start_line":3635,"start_character":13,"end_line":3635,"end_character":24},"updated":"2019-02-25 21:10:19.000000000","message":"nit: use mock_put.assert_has_calls instead","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3632,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, updated_allocations,"},{"line_number":3633,"context_line":"            version\u003d\u00271.28\u0027, global_request_id\u003dself.context.global_id)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self.assertEqual("},{"line_number":3636,"context_line":"            [put_call, put_call, put_call, put_call],"},{"line_number":3637,"context_line":"            mock_put.mock_calls)"},{"line_number":3638,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_22434a41","line":3635,"range":{"start_line":3635,"start_character":13,"end_line":3635,"end_character":24},"in_reply_to":"9fdfeff1_8d55b052","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"48987c3116e3a1a2654c5f09b726ad7efd60e5ab","unresolved":false,"context_lines":[{"line_number":3633,"context_line":"            version\u003d\u00271.28\u0027, global_request_id\u003dself.context.global_id)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self.assertEqual("},{"line_number":3636,"context_line":"            [put_call, put_call, put_call, put_call],"},{"line_number":3637,"context_line":"            mock_put.mock_calls)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_6d6f2c28","line":3636,"range":{"start_line":3636,"start_character":12,"end_line":3636,"end_character":52},"updated":"2019-02-25 21:10:19.000000000","message":"[put_call] * 4","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8f336d53c191112673ec3cb4668c76b0d62dce1","unresolved":false,"context_lines":[{"line_number":3633,"context_line":"            version\u003d\u00271.28\u0027, global_request_id\u003dself.context.global_id)"},{"line_number":3634,"context_line":""},{"line_number":3635,"context_line":"        self.assertEqual("},{"line_number":3636,"context_line":"            [put_call, put_call, put_call, put_call],"},{"line_number":3637,"context_line":"            mock_put.mock_calls)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":""}],"source_content_type":"text/x-python","patch_set":27,"id":"9fdfeff1_e27a2286","line":3636,"range":{"start_line":3636,"start_character":12,"end_line":3636,"end_character":52},"in_reply_to":"9fdfeff1_6d6f2c28","updated":"2019-02-27 12:48:59.000000000","message":"Done","commit_id":"c5fc1126d9ff8b016d83c2026de7ada10df64cbd"}],"nova/virt/fake.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6038afbf1c7bfbce90b9616d2f78d264238d8257","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        # simulate a real driver triggering the async network allocation as it"},{"line_number":196,"context_line":"        # might cause an error"},{"line_number":197,"context_line":"        if network_info:"},{"line_number":198,"context_line":"            [ip for vif in network_info for ip in vif.fixed_ips()]"},{"line_number":199,"context_line":"            self._interfaces \u003d {vif[\u0027id\u0027]: vif for vif in network_info}"},{"line_number":200,"context_line":"        uuid \u003d instance.uuid"},{"line_number":201,"context_line":"        state \u003d power_state.RUNNING"},{"line_number":202,"context_line":"        flavor \u003d instance.flavor"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_05b16b44","line":199,"range":{"start_line":198,"start_character":12,"end_line":199,"end_character":71},"updated":"2019-02-27 14:43:54.000000000","message":"nit: this could be combined into so we only loop over vifs once. And maybe add a comment that we track interfaces here so detach_interface() can be used on interfaces provided when creating the server.","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bbb064319129798098c0a1234ab1490ce0323a08","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        # simulate a real driver triggering the async network allocation as it"},{"line_number":196,"context_line":"        # might cause an error"},{"line_number":197,"context_line":"        if network_info:"},{"line_number":198,"context_line":"            [ip for vif in network_info for ip in vif.fixed_ips()]"},{"line_number":199,"context_line":"            self._interfaces \u003d {vif[\u0027id\u0027]: vif for vif in network_info}"},{"line_number":200,"context_line":"        uuid \u003d instance.uuid"},{"line_number":201,"context_line":"        state \u003d power_state.RUNNING"},{"line_number":202,"context_line":"        flavor \u003d instance.flavor"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_7db00741","line":199,"range":{"start_line":198,"start_character":12,"end_line":199,"end_character":71},"in_reply_to":"9fdfeff1_05b16b44","updated":"2019-02-27 17:09:27.000000000","message":"Done","commit_id":"ba39214197efc45cd634ab0476393b7ce1548e26"}]}
