)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":7,"context_line":"fix missing instance.delete notification"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The I8742071b55f018f864f5a382de20075a5b444a79 introduced cases when an"},{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_baef4faf","line":10,"range":{"start_line":10,"start_character":19,"end_line":10,"end_character":28},"updated":"2017-02-28 19:17:28.000000000","message":"destroyed","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"fix missing instance.delete notification"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The I8742071b55f018f864f5a382de20075a5b444a79 introduced cases when an"},{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_e582a393","line":10,"range":{"start_line":10,"start_character":19,"end_line":10,"end_character":28},"in_reply_to":"ba2be162_baef4faf","updated":"2017-03-02 14:35:34.000000000","message":"Done","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The I8742071b55f018f864f5a382de20075a5b444a79 introduced cases when an"},{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"},{"line_number":14,"context_line":"behaviour."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_3a3a7f37","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":2},"updated":"2017-02-28 19:17:28.000000000","message":"being","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The I8742071b55f018f864f5a382de20075a5b444a79 introduced cases when an"},{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"},{"line_number":14,"context_line":"behaviour."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_6545d36e","line":11,"range":{"start_line":11,"start_character":0,"end_line":11,"end_character":2},"in_reply_to":"ba2be162_3a3a7f37","updated":"2017-03-02 14:35:34.000000000","message":"Done","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"},{"line_number":14,"context_line":"behaviour."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1665263"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_7a3cf72f","line":13,"range":{"start_line":13,"start_character":43,"end_line":13,"end_character":50},"updated":"2017-02-28 19:17:28.000000000","message":"strike","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"instance object is destoryed without the instance.delete notification"},{"line_number":11,"context_line":"is emitted."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This patch adds the necessary notification sending to restore legacy"},{"line_number":14,"context_line":"behaviour."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: #1665263"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba2be162_c55aff4f","line":13,"range":{"start_line":13,"start_character":43,"end_line":13,"end_character":50},"in_reply_to":"ba2be162_7a3cf72f","updated":"2017-03-02 14:35:34.000000000","message":"Done","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"}],"nova/compute/api.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":2062,"context_line":"        else:"},{"line_number":2063,"context_line":"            LOG.warning(_LW(\"instance\u0027s host %s is down, deleting from \""},{"line_number":2064,"context_line":"                            \"database\"), instance.host, instance\u003dinstance)"},{"line_number":2065,"context_line":"        compute_utils.notify_about_instance_usage("},{"line_number":2066,"context_line":"            self.notifier, context, instance, \"%s.start\" % delete_type)"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"        elevated \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_fa30e7a0","line":2065,"updated":"2017-02-28 19:17:28.000000000","message":"Wanna use the new context manager here?","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":2062,"context_line":"        else:"},{"line_number":2063,"context_line":"            LOG.warning(_LW(\"instance\u0027s host %s is down, deleting from \""},{"line_number":2064,"context_line":"                            \"database\"), instance.host, instance\u003dinstance)"},{"line_number":2065,"context_line":"        compute_utils.notify_about_instance_usage("},{"line_number":2066,"context_line":"            self.notifier, context, instance, \"%s.start\" % delete_type)"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"        elevated \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_980dd692","line":2065,"in_reply_to":"ba2be162_fa30e7a0","updated":"2017-03-02 14:35:34.000000000","message":"Good point. Done.","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"610a8f2809e4fd39f8c16dda63540dc0ee12f51f","unresolved":false,"context_lines":[{"line_number":1789,"context_line":"                cell, instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1790,"context_line":"                if cell and instance:"},{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"},{"line_number":1798,"context_line":"                    # Instance is already deleted."}],"source_content_type":"text/x-python","patch_set":5,"id":"9a30ddce_0045dcb1","line":1795,"range":{"start_line":1792,"start_character":0,"end_line":1795,"end_character":46},"updated":"2017-03-09 13:30:21.000000000","message":"Its tempting to make this a helper function, to stop the cut and paste, and try stop us forgetting the notification if we add a new case.","commit_id":"1fa28438be6eaba93087e23308f8990f7f87b7b5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ec5fe6613df7c8c734ec9b5fe668f915bdec4250","unresolved":false,"context_lines":[{"line_number":1789,"context_line":"                cell, instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1790,"context_line":"                if cell and instance:"},{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"},{"line_number":1798,"context_line":"                    # Instance is already deleted."}],"source_content_type":"text/x-python","patch_set":5,"id":"9a30ddce_a30c153c","line":1795,"range":{"start_line":1792,"start_character":0,"end_line":1795,"end_character":46},"in_reply_to":"9a30ddce_0045dcb1","updated":"2017-03-09 15:18:21.000000000","message":"I will try to come up with a refactor as a follow up","commit_id":"1fa28438be6eaba93087e23308f8990f7f87b7b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14c06535235b15e2c656f0303723c72e2fd76d7f","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"                    # If instance is None it has already been deleted."},{"line_number":1741,"context_line":"                    if cell:"},{"line_number":1742,"context_line":"                        with nova_context.target_cell(context, cell):"},{"line_number":1743,"context_line":"                            with compute_utils.notify_about_instance_delete("},{"line_number":1744,"context_line":"                                    self.notifier, context, instance):"},{"line_number":1745,"context_line":"                                instance.destroy()"},{"line_number":1746,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_9584955e","line":1743,"updated":"2017-03-09 21:05:31.000000000","message":"Don\u0027t we need delete_type here?","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e53a6461e5d8141d2b3103b235dc1a203f4b9f31","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"                    # If instance is None it has already been deleted."},{"line_number":1741,"context_line":"                    if cell:"},{"line_number":1742,"context_line":"                        with nova_context.target_cell(context, cell):"},{"line_number":1743,"context_line":"                            with compute_utils.notify_about_instance_delete("},{"line_number":1744,"context_line":"                                    self.notifier, context, instance):"},{"line_number":1745,"context_line":"                                instance.destroy()"},{"line_number":1746,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_f5b9517a","line":1743,"in_reply_to":"9a30ddce_754561b1","updated":"2017-03-09 21:20:36.000000000","message":"Right, so not in a cell (not even cell0), can\u0027t soft-delete because soft-delete relies on the compute to do the actual deletion after the configured wait period. Since it\u0027s not in a cell there is no compute to do the cleanup, so we have to hard-delete.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"85a7b5f849a682172a59447aea4b4d0aa3f365db","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"                    # If instance is None it has already been deleted."},{"line_number":1741,"context_line":"                    if cell:"},{"line_number":1742,"context_line":"                        with nova_context.target_cell(context, cell):"},{"line_number":1743,"context_line":"                            with compute_utils.notify_about_instance_delete("},{"line_number":1744,"context_line":"                                    self.notifier, context, instance):"},{"line_number":1745,"context_line":"                                instance.destroy()"},{"line_number":1746,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_754561b1","line":1743,"in_reply_to":"9a30ddce_9584955e","updated":"2017-03-09 21:13:29.000000000","message":"If we\u0027ve gotten here, we\u0027ve already deleted the buildrequest, which means that we\u0027re racing with conductor to do the build and it won\u0027t land in a cell. InstanceMapping is already gone, so it\u0027s never going to be un-soft-deletable.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14c06535235b15e2c656f0303723c72e2fd76d7f","unresolved":false,"context_lines":[{"line_number":1777,"context_line":"        # Normal delete should be attempted."},{"line_number":1778,"context_line":"        if not instance.host:"},{"line_number":1779,"context_line":"            try:"},{"line_number":1780,"context_line":"                if self._delete_while_booting(context, instance):"},{"line_number":1781,"context_line":"                    return"},{"line_number":1782,"context_line":"                # If instance.host was not set it\u0027s possible that the Instance"},{"line_number":1783,"context_line":"                # object here was pulled from a BuildRequest object and is not"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_55b85d2a","line":1780,"range":{"start_line":1780,"start_character":24,"end_line":1780,"end_character":45},"updated":"2017-03-09 21:05:31.000000000","message":"Shouldn\u0027t we be passing delete_type through here?","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e53a6461e5d8141d2b3103b235dc1a203f4b9f31","unresolved":false,"context_lines":[{"line_number":1777,"context_line":"        # Normal delete should be attempted."},{"line_number":1778,"context_line":"        if not instance.host:"},{"line_number":1779,"context_line":"            try:"},{"line_number":1780,"context_line":"                if self._delete_while_booting(context, instance):"},{"line_number":1781,"context_line":"                    return"},{"line_number":1782,"context_line":"                # If instance.host was not set it\u0027s possible that the Instance"},{"line_number":1783,"context_line":"                # object here was pulled from a BuildRequest object and is not"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_75a64154","line":1780,"range":{"start_line":1780,"start_character":24,"end_line":1780,"end_character":45},"in_reply_to":"9a30ddce_55b85d2a","updated":"2017-03-09 21:20:36.000000000","message":"No, see above. This mode does not support soft delete.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e53a6461e5d8141d2b3103b235dc1a203f4b9f31","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_b51fd96a","line":1794,"range":{"start_line":1794,"start_character":32,"end_line":1794,"end_character":55},"updated":"2017-03-09 21:20:36.000000000","message":"Hmm, similar question here. This is the cell0 case. For example, there are no valid hosts from the scheduler, so conductor creates the instance in cell0 and deletes the build request. So _delete_while_booting returns False and we lookup the instance in cell0 here. Now cell0 doesn\u0027t have computes, so soft-delete doesn\u0027t really make sense because there is no compute to actually remove the thing. And we are doing the instance.destroy() right after this.\n\nSo the notification here is actually kind of a lie because the user requested delete, we thought it would be a soft-delete, but it\u0027s really not going to be, it\u0027s always a hard-delete here.\n\nSo we remove the kwarg?","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3d7e7fa1d03bfd3b70b5b172a8cc75177f609614","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_419edf63","line":1794,"range":{"start_line":1794,"start_character":32,"end_line":1794,"end_character":55},"in_reply_to":"9a30ddce_06fb1d7a","updated":"2017-03-09 22:17:13.000000000","message":"I\u0027m going to remove the delete_type kwarg here, it\u0027s not a soft delete, it\u0027s a local delete in the API.\n\nIn fact, Dan figured out that the only time we ever issue instance.soft_delete.start/end notifications is when we\u0027re doing a local delete from the API, which is the opposite of how soft-delete works (which is letting the compute delete the instance after a certain amount of time).\n\nSo we\u0027re going to cleanup the instance.soft_delete notifications from the API altogether in a separate patch because they are really meaningless in how they are used here with local delete.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"81a129f2a2dc5cc56831f5f5001aeff7c2dbc2b5","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_06fb1d7a","line":1794,"range":{"start_line":1794,"start_character":32,"end_line":1794,"end_character":55},"in_reply_to":"9a30ddce_466195d2","updated":"2017-03-09 22:02:33.000000000","message":"Just thinking about this again though, if we send a notification that we\u0027re soft-deleting this instance, that would lead you to believe you could potentially restore it before the window closes on the reclaim in the compute (which won\u0027t happen here). So again, isn\u0027t it basically wrong to ever call this a soft_delete when we\u0027re going to destroy the instance right here?","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d5dd3336c96a790f7eb3ef5f911037a25553b9c1","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_cbb2ee05","line":1794,"range":{"start_line":1794,"start_character":32,"end_line":1794,"end_character":55},"in_reply_to":"9a30ddce_b51fd96a","updated":"2017-03-09 21:34:10.000000000","message":"We can get here even in the non-cell0 case, if we race with compute owning the instance.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7ddd10233a13c8bfd4be365d4baef4e203ba0327","unresolved":false,"context_lines":[{"line_number":1791,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1792,"context_line":"                        with compute_utils.notify_about_instance_delete("},{"line_number":1793,"context_line":"                                self.notifier, context, instance,"},{"line_number":1794,"context_line":"                                delete_type\u003ddelete_type):"},{"line_number":1795,"context_line":"                            instance.destroy()"},{"line_number":1796,"context_line":"                        return"},{"line_number":1797,"context_line":"                if not instance:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_466195d2","line":1794,"range":{"start_line":1794,"start_character":32,"end_line":1794,"end_character":55},"in_reply_to":"9a30ddce_cbb2ee05","updated":"2017-03-09 21:52:38.000000000","message":"Yeah, as discussed in IRC, conductor could have picked a cell but the resource tracker hasn\u0027t set the host yet during the instance_claim call, so we can\u0027t assume this is cell0.\n\nIn the case it\u0027s not cell0 and it gets a host before we call destroy, we\u0027ll get the ObjectActionError below and continue with normal delete processing. If we do destroy the instance here, then we send a soft-delete notification when it\u0027s not really, but meh, that\u0027s probably not a big deal.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"}],"nova/compute/utils.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":701,"context_line":""},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"@contextlib.contextmanager"},{"line_number":704,"context_line":"def notify_about_instance_delete(notifier, context, instance,"},{"line_number":705,"context_line":"                                 delete_type\u003d\u0027delete\u0027):"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"        notify_about_instance_usage(notifier, context, instance,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_5daf2de3","line":704,"updated":"2017-02-28 19:17:28.000000000","message":"Love this.","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2bf8900ada619f4940f43da576a643fb844463c9","unresolved":false,"context_lines":[{"line_number":713,"context_line":"            notify_about_instance_usage(notifier, context, instance,"},{"line_number":714,"context_line":"                                        \"%s.end\" % delete_type,"},{"line_number":715,"context_line":"                                        system_metadata\u003dsystem_metadata)"},{"line_number":716,"context_line":"        except exception.InstanceNotFound:"},{"line_number":717,"context_line":"            notify_about_instance_usage(notifier, context, instance,"},{"line_number":718,"context_line":"                                        \"%s.end\" % delete_type)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a30ddce_7639f9f1","line":716,"updated":"2017-03-09 15:50:25.000000000","message":"Shouldn\u0027t this always happen? We wrap instance.destroy() with this... Maybe you should trigger the lazy-load before you yield?","commit_id":"1fa28438be6eaba93087e23308f8990f7f87b7b5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"95adf2d1568ae2705d2071235b3ebf97d5719748","unresolved":false,"context_lines":[{"line_number":713,"context_line":"            notify_about_instance_usage(notifier, context, instance,"},{"line_number":714,"context_line":"                                        \"%s.end\" % delete_type,"},{"line_number":715,"context_line":"                                        system_metadata\u003dsystem_metadata)"},{"line_number":716,"context_line":"        except exception.InstanceNotFound:"},{"line_number":717,"context_line":"            notify_about_instance_usage(notifier, context, instance,"},{"line_number":718,"context_line":"                                        \"%s.end\" % delete_type)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a30ddce_4a91a646","line":716,"in_reply_to":"9a30ddce_7639f9f1","updated":"2017-03-09 17:12:01.000000000","message":"Good points. It seems we can load the sysmeta earlier to avoid the extra except block.\nDone.","commit_id":"1fa28438be6eaba93087e23308f8990f7f87b7b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3d7e7fa1d03bfd3b70b5b172a8cc75177f609614","unresolved":false,"context_lines":[{"line_number":702,"context_line":""},{"line_number":703,"context_line":"@contextlib.contextmanager"},{"line_number":704,"context_line":"def notify_about_instance_delete(notifier, context, instance,"},{"line_number":705,"context_line":"                                 delete_type\u003d\u0027delete\u0027):"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"        notify_about_instance_usage(notifier, context, instance,"},{"line_number":708,"context_line":"                                    \"%s.start\" % delete_type)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_c1800ffa","line":705,"range":{"start_line":705,"start_character":33,"end_line":705,"end_character":53},"updated":"2017-03-09 22:17:13.000000000","message":"Based on conversation in the API code, I\u0027m going to remove this since it\u0027s not used for soft_delete.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14c06535235b15e2c656f0303723c72e2fd76d7f","unresolved":false,"context_lines":[{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"        notify_about_instance_usage(notifier, context, instance,"},{"line_number":708,"context_line":"                                    \"%s.start\" % delete_type)"},{"line_number":709,"context_line":"        system_metadata \u003d instance.system_metadata"},{"line_number":710,"context_line":"        yield"},{"line_number":711,"context_line":"    finally:"},{"line_number":712,"context_line":"        notify_about_instance_usage(notifier, context, instance,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_15e0a528","line":709,"updated":"2017-03-09 21:05:31.000000000","message":"A comment would be nice about why you\u0027re loading this up here rather than in the finally (I think it\u0027s because you get InstanceNotFound when lazy-loading it after we\u0027ve deleted the instance.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6335f4a14a7337ca59ce45da110a872e1f7171f7","unresolved":false,"context_lines":[{"line_number":708,"context_line":"        # Pre-load system_metadata because if this context is around an"},{"line_number":709,"context_line":"        # instance.destroy(), lazy-loading it later would result in an"},{"line_number":710,"context_line":"        # InstanceNotFound error."},{"line_number":711,"context_line":"        system_metadata \u003d instance.system_metadata"},{"line_number":712,"context_line":"        yield"},{"line_number":713,"context_line":"    finally:"},{"line_number":714,"context_line":"        notify_about_instance_usage(notifier, context, instance, \"delete.end\","}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_d30b80d4","line":711,"updated":"2017-03-09 23:32:02.000000000","message":"This has to come outside the try/finally...you need a unit test for this.","commit_id":"6d13ba548705e84678a0cf98542333ec021f39c6"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ba2be162_fa670723","updated":"2017-02-28 19:17:28.000000000","message":"Nice.","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":7769,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":7770,"context_line":"            lambda observed_instance:"},{"line_number":7771,"context_line":"            observed_instance.uuid \u003d\u003d instance.uuid)"},{"line_number":7772,"context_line":"        self.assertEqual([mock.call(self.compute_api.notifier,"},{"line_number":7773,"context_line":"                                    self.context,"},{"line_number":7774,"context_line":"                                    match_by_instance_uuid,"},{"line_number":7775,"context_line":"                                    \u0027delete.start\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_1a9f7b04","line":7772,"updated":"2017-02-28 19:17:28.000000000","message":"or mock_notify.assert_has_calls([...same list...])","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":7769,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":7770,"context_line":"            lambda observed_instance:"},{"line_number":7771,"context_line":"            observed_instance.uuid \u003d\u003d instance.uuid)"},{"line_number":7772,"context_line":"        self.assertEqual([mock.call(self.compute_api.notifier,"},{"line_number":7773,"context_line":"                                    self.context,"},{"line_number":7774,"context_line":"                                    match_by_instance_uuid,"},{"line_number":7775,"context_line":"                                    \u0027delete.start\u0027),"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_feab1b1b","line":7772,"in_reply_to":"ba2be162_1a9f7b04","updated":"2017-03-02 14:35:34.000000000","message":"it is a good idea especially when I move this to a common function where I don\u0027t need to pass \u0027self\u0027","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e45dc5c3b80de9c27b7941c73c8ba74dd089f987","unresolved":false,"context_lines":[{"line_number":7852,"context_line":"    @mock.patch(\u0027nova.objects.Service.get_minimum_version\u0027)"},{"line_number":7853,"context_line":"    @mock.patch(\u0027nova.compute.utils.notify_about_instance_usage\u0027)"},{"line_number":7854,"context_line":"    @mock.patch(\u0027nova.objects.BuildRequest.get_by_instance_uuid\u0027)"},{"line_number":7855,"context_line":"    def test_delete_while_booting_instance_not_in_cell_db_cellsv1("},{"line_number":7856,"context_line":"            self, br_get_by_instance, notify, minimum_server_version,"},{"line_number":7857,"context_line":"            instance_destroy):"},{"line_number":7858,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a30ddce_9964a3b9","line":7855,"range":{"start_line":7855,"start_character":57,"end_line":7855,"end_character":65},"updated":"2017-03-10 18:09:54.000000000","message":"This isn\u0027t accurate, cellsv1 means you\u0027ve configured cellsv1 (CONF.cells.enable). But we can clean that up later.","commit_id":"f9ac9531fb3259fe83642dce92d0d1901d0f067e"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":1539,"context_line":"        self.assertEqual(\u0027error\u0027, instance.vm_state)"},{"line_number":1540,"context_line":"        self.assertIsNone(None, instance.task_state)"},{"line_number":1541,"context_line":""},{"line_number":1542,"context_line":"    def _assert_delete_notification(self, build_request, mock_notify):"},{"line_number":1543,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":1544,"context_line":"            lambda instance:"},{"line_number":1545,"context_line":"            instance.uuid \u003d\u003d build_request.instance_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_5a5e5346","line":1542,"updated":"2017-02-28 19:17:28.000000000","message":"Since this is duplicated, perhaps put it in test_utils or some other common spot?","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":1539,"context_line":"        self.assertEqual(\u0027error\u0027, instance.vm_state)"},{"line_number":1540,"context_line":"        self.assertIsNone(None, instance.task_state)"},{"line_number":1541,"context_line":""},{"line_number":1542,"context_line":"    def _assert_delete_notification(self, build_request, mock_notify):"},{"line_number":1543,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":1544,"context_line":"            lambda instance:"},{"line_number":1545,"context_line":"            instance.uuid \u003d\u003d build_request.instance_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_5e1c2777","line":1542,"in_reply_to":"ba2be162_5a5e5346","updated":"2017-03-02 14:35:34.000000000","message":"With some extra logic I was able to move it to a common place.","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c26e38e6345275ad977af4b95507adef43972637","unresolved":false,"context_lines":[{"line_number":1576,"context_line":"        self.assertFalse(bury.called)"},{"line_number":1577,"context_line":"        self.assertTrue(br_destroy.called)"},{"line_number":1578,"context_line":""},{"line_number":1579,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":1580,"context_line":"            lambda instance:"},{"line_number":1581,"context_line":"            instance.uuid \u003d\u003d self.params[\u0027build_requests\u0027][0].instance_uuid)"},{"line_number":1582,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_3d2519ab","line":1579,"updated":"2017-02-28 19:17:28.000000000","message":"_assert_delete_notification?","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"106c40b92ae2dfc2e4ee3a73b58a4d8574f104c1","unresolved":false,"context_lines":[{"line_number":1576,"context_line":"        self.assertFalse(bury.called)"},{"line_number":1577,"context_line":"        self.assertTrue(br_destroy.called)"},{"line_number":1578,"context_line":""},{"line_number":1579,"context_line":"        match_by_instance_uuid \u003d test_utils.CustomMockCallMatcher("},{"line_number":1580,"context_line":"            lambda instance:"},{"line_number":1581,"context_line":"            instance.uuid \u003d\u003d self.params[\u0027build_requests\u0027][0].instance_uuid)"},{"line_number":1582,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba2be162_b3b1d491","line":1579,"in_reply_to":"ba2be162_3d2519ab","updated":"2017-03-02 14:35:34.000000000","message":"Done","commit_id":"221a0e8e66ecca0613ceee102802f4368f8d19b9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c8741bf87da15bf1d7e3502acb4ac706cc1ac2f","unresolved":false,"context_lines":[{"line_number":1576,"context_line":""},{"line_number":1577,"context_line":"        def fake_destroy():"},{"line_number":1578,"context_line":"            # reset the mock so that destroy only fail once"},{"line_number":1579,"context_line":"            instance_destroy.side_effect \u003d None"},{"line_number":1580,"context_line":"            raise exc.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":1581,"context_line":"                                        reason\u003d\u0027host changed\u0027)"},{"line_number":1582,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9a30ddce_292e3fa5","line":1579,"updated":"2017-03-09 17:50:41.000000000","message":"If you set side_effect to a list, it will do the things in order. Mucking with the mock at runtime like this seems dangerous.","commit_id":"5895416354c299c14822915b5ef0fcd7abe0f66f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1c8741bf87da15bf1d7e3502acb4ac706cc1ac2f","unresolved":false,"context_lines":[{"line_number":1585,"context_line":""},{"line_number":1586,"context_line":"        self.start_service(\u0027compute\u0027, host\u003d\u0027fake-host\u0027)"},{"line_number":1587,"context_line":"        select_destinations.return_value \u003d [{\u0027host\u0027: \u0027fake-host\u0027,"},{"line_number":1588,"context_line":"                                             \u0027nodename\u0027: \u0027nodesarestupid\u0027,"},{"line_number":1589,"context_line":"                                             \u0027limits\u0027: None}]"},{"line_number":1590,"context_line":"        self.conductor.schedule_and_build_instances(**self.params)"},{"line_number":1591,"context_line":"        self.assertFalse(build_and_run.called)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a30ddce_090c1b40","line":1588,"range":{"start_line":1588,"start_character":58,"end_line":1588,"end_character":72},"updated":"2017-03-09 17:50:41.000000000","message":"They sure are! :P","commit_id":"5895416354c299c14822915b5ef0fcd7abe0f66f"}],"nova/tests/unit/utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14c06535235b15e2c656f0303723c72e2fd76d7f","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        mock.call(expected_notifier,"},{"line_number":315,"context_line":"                  expected_context,"},{"line_number":316,"context_line":"                  match_by_instance_uuid,"},{"line_number":317,"context_line":"                  \u0027delete.start\u0027),"},{"line_number":318,"context_line":"        mock.call(expected_notifier,"},{"line_number":319,"context_line":"                  expected_context,"},{"line_number":320,"context_line":"                  match_by_instance_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_75ed61ee","line":317,"range":{"start_line":317,"start_character":19,"end_line":317,"end_character":25},"updated":"2017-03-09 21:05:31.000000000","message":"This is encoding the delete_type, which could be \u0027delete\u0027 or \u0027soft_delete\u0027 when deleting through the API. So this seems a bit brittle and shows that we\u0027re not testing the soft delete case.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3d7e7fa1d03bfd3b70b5b172a8cc75177f609614","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        mock.call(expected_notifier,"},{"line_number":315,"context_line":"                  expected_context,"},{"line_number":316,"context_line":"                  match_by_instance_uuid,"},{"line_number":317,"context_line":"                  \u0027delete.start\u0027),"},{"line_number":318,"context_line":"        mock.call(expected_notifier,"},{"line_number":319,"context_line":"                  expected_context,"},{"line_number":320,"context_line":"                  match_by_instance_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_6172034b","line":317,"range":{"start_line":317,"start_character":19,"end_line":317,"end_character":25},"in_reply_to":"9a30ddce_75ed61ee","updated":"2017-03-09 22:17:13.000000000","message":"This is OK now.","commit_id":"d441fc40e1fe5a02d157aa06af972d2cbb650370"}]}
