)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"54c39a478c8815e3f8fc8aa12766716a8a16927f","unresolved":false,"context_lines":[{"line_number":15,"context_line":"method is wrapped with a try/except block so we can"},{"line_number":16,"context_line":"attempt the rollback via the virt driver."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Co-Authored-By: Matt Riedemann \u003cmriedem@us.ibm.com\u003e"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-bug: #1488435"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":12,"id":"5a2ca52d_f0458642","line":18,"updated":"2015-10-16 18:30:33.000000000","message":"Since you went back to a previous version, I don\u0027t need any credit here.","commit_id":"ef5f666fe2178540fd66803388220c2321f7c2b8"}],"nova/compute/manager.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"f92a9f113f09d145cf92dc030418a579ebc71885","unresolved":false,"context_lines":[{"line_number":5441,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5442,"context_line":"                                                    self.host, teardown\u003dTrue)"},{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            LOG.error(_LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5445,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_390d7490","line":5444,"updated":"2015-09-28 18:06:24.000000000","message":"* Maybe a bit more information would help. For example, what is the impact of this error? Can we recover manually from it?\n\n* Is \"error\" the right log level for that? Since the system seems to be not in immediate danger, maybe \"WARN\" is enough?","commit_id":"6a9abf8ac6babacd4e31ab4d35a9ebd208cbee8c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a32b34f59e77fd306086e6272a79e3313a78f8b4","unresolved":false,"context_lines":[{"line_number":5441,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5442,"context_line":"                                                    self.host, teardown\u003dTrue)"},{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            LOG.error(_LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5445,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_619d6abb","line":5444,"in_reply_to":"9a1a9d01_390d7490","updated":"2015-09-29 00:35:02.000000000","message":"The way this is written, I think it should be a warning at most.","commit_id":"6a9abf8ac6babacd4e31ab4d35a9ebd208cbee8c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"698a859723640926cb4ddae0e40bd4422e998863","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_0249c7cf","line":5447,"updated":"2015-09-30 12:35:25.000000000","message":"I\u0027m not sure it\u0027s the right way to handle this, in particular by catching-all any exception that could come.\nBy doing that, we could go into an inconsistent state on the compute manager because the driver could be doing the necessary stuff and we could still have the attached networks not cleaned up.\n\nInstead of that, we should rather wonder *why* sometimes the network is failing and fix that instead of hiding it.","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6c1e49a0ee71be5453257f3dec32e729252e7e88","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_51f45859","line":5447,"in_reply_to":"9a1a9d01_016c6433","updated":"2015-09-30 18:27:20.000000000","message":"I was thinking the same thing -- if we could simply change the ordering to driver rollback before network teardown instead of catching Exception.","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"08f6b2693510b3b5bfe89aff4235c1d5360abc91","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_fd1c726b","line":5447,"in_reply_to":"9a1a9d01_0249c7cf","updated":"2015-09-30 12:41:32.000000000","message":"It could be anything, why network fail. This problem is already hidden and already we will go into inconsistent state, only grepping through compute.log will help. The problem here that if you decide to re-roll live-migration again you will get exception because instance folder already exists on destination node, because driver\u0027s rollback wasn\u0027t happened.","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b2c6292179cb49d1dbc4331d7e3be144e506a754","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_05e77aac","line":5447,"in_reply_to":"9a1a9d01_3aa419b8","updated":"2015-09-30 20:08:21.000000000","message":"I like that idea too. Put the driver rollback into a private function and something like:\n\n try:\n     network_teardown\n except Exception:\n     with save_and_reraise:\n         LOG.error(...)\n         self._driver_rollback(...)\n\n self._driver_rollback(...)\n\nAnd also if we\u0027re reraising, I think the log level should be changed back to ERROR","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"456ecb59139832ae7551c196835f1e1b19cff173","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_bfb25b4a","line":5447,"in_reply_to":"9a1a9d01_51f45859","updated":"2015-09-30 18:59:49.000000000","message":"i could smth like try/except/finally... but here is the problem, if exception raised in finally section it will shadow original one.","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e57d07077562fbab8e6ad09d3154ecf683f573a1","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_3aa419b8","line":5447,"in_reply_to":"9a1a9d01_bfb25b4a","updated":"2015-09-30 19:31:52.000000000","message":"Why not use https://github.com/openstack/oslo.utils/blob/master/oslo_utils/excutils.py#L140 in here somewhere?","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fdd1ffc4f6b2f6f35a45dea620f7572c86f756f4","unresolved":false,"context_lines":[{"line_number":5444,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5445,"context_line":"            # try to rollback live migration on destination."},{"line_number":5446,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5447,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5448,"context_line":""},{"line_number":5449,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5450,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_016c6433","line":5447,"in_reply_to":"9a1a9d01_fd1c726b","updated":"2015-09-30 13:17:06.000000000","message":"Maybe it would be better to move this after the driver rollback?\n\nThe problem here is that you do hide this error from lots of importnant error handling:\n\n* @wrap_exception()\n* @wrap_instance_event\n* @wrap_instance_fault\n\nCertainly want to see the error re-raised from any failures in this method, but it would be good to try all clean ups, rather than skip a clean up.","commit_id":"1302e2631bfd34304b03b068a03c1eede2bf908b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a68533bde916658b05a78ee4ed4624ce081b4fb9","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"                      context, instance, \"live_migration.rollback.dest.start\","},{"line_number":5441,"context_line":"                      network_info\u003dnetwork_info)"},{"line_number":5442,"context_line":"        try:"},{"line_number":5443,"context_line":"            self._rollback_live_migration_on_destination_network(context,"},{"line_number":5444,"context_line":"                                                                 instance)"},{"line_number":5445,"context_line":"        except Exception:"},{"line_number":5446,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_860aa124","line":5443,"updated":"2015-10-01 08:46:36.000000000","message":"the method name does not really make sense - below we are still doing rollback operations - for example self.driver.rollback_live_migration_at_destination","commit_id":"5aacf46e9b7519afcdfe922bdb3064a696e8dcc3"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"3d27ac770fa26e08aeec4b28b14d2cfa58caf4ce","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"                      context, instance, \"live_migration.rollback.dest.start\","},{"line_number":5441,"context_line":"                      network_info\u003dnetwork_info)"},{"line_number":5442,"context_line":"        try:"},{"line_number":5443,"context_line":"            self._rollback_live_migration_on_destination_network(context,"},{"line_number":5444,"context_line":"                                                                 instance)"},{"line_number":5445,"context_line":"        except Exception:"},{"line_number":5446,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_e9a32eb0","line":5443,"in_reply_to":"9a1a9d01_860aa124","updated":"2015-10-01 08:57:34.000000000","message":"method was renamed in next patchset, also I\u0027ve added note about this splitting","commit_id":"5aacf46e9b7519afcdfe922bdb3064a696e8dcc3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a68533bde916658b05a78ee4ed4624ce081b4fb9","unresolved":false,"context_lines":[{"line_number":5466,"context_line":"                                                        instance):"},{"line_number":5467,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5468,"context_line":"        self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5469,"context_line":"                                                    self.host, teardown\u003dTrue)"},{"line_number":5470,"context_line":""},{"line_number":5471,"context_line":"    @periodic_task.periodic_task("},{"line_number":5472,"context_line":"        spacing\u003dCONF.heal_instance_info_cache_interval)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_e901ee05","line":5469,"updated":"2015-10-01 08:46:36.000000000","message":"dodgy indentations","commit_id":"5aacf46e9b7519afcdfe922bdb3064a696e8dcc3"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"3d27ac770fa26e08aeec4b28b14d2cfa58caf4ce","unresolved":false,"context_lines":[{"line_number":5466,"context_line":"                                                        instance):"},{"line_number":5467,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5468,"context_line":"        self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5469,"context_line":"                                                    self.host, teardown\u003dTrue)"},{"line_number":5470,"context_line":""},{"line_number":5471,"context_line":"    @periodic_task.periodic_task("},{"line_number":5472,"context_line":"        spacing\u003dCONF.heal_instance_info_cache_interval)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_29c7e664","line":5469,"in_reply_to":"9a1a9d01_e901ee05","updated":"2015-10-01 08:57:34.000000000","message":"Done","commit_id":"5aacf46e9b7519afcdfe922bdb3064a696e8dcc3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0c47523de98ae7688a43a617504565cb06409937","unresolved":false,"context_lines":[{"line_number":5448,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5449,"context_line":"            # try to rollback live migration on destination."},{"line_number":5450,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5451,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5454,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_5a577657","line":5451,"updated":"2015-10-01 10:18:33.000000000","message":"Why not try just calling the driver method here, as mentioned in the previous comments, wrapped around with a re-raise exception decorator.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"417ac0e422cd1c4905f46ed643688bec98bf9b5b","unresolved":false,"context_lines":[{"line_number":5448,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5449,"context_line":"            # try to rollback live migration on destination."},{"line_number":5450,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5451,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5454,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_b17a7076","line":5451,"in_reply_to":"9a1a9d01_26f068c9","updated":"2015-10-01 13:47:20.000000000","message":"What I dislike with that approach is that we have 2 methods calling the same rollback_live_migration_at_destination() but we don\u0027t know if the network has been allocated...\n\nSo, giving a way to avoid an Exception on teardown networks means that we could have a problem because we don\u0027t know if it failed because of a RPC problem, a network problem or just because the network wasn\u0027t yet allocated.\n\nI think we should really think about how to discriminate the exceptions given by the network API so we could say \"eh it\u0027s because X so Y\"","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d52e19d262d29e8bf604e13d28c8b3ec9935ef12","unresolved":false,"context_lines":[{"line_number":5448,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5449,"context_line":"            # try to rollback live migration on destination."},{"line_number":5450,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5451,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5454,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_c6716caa","line":5451,"in_reply_to":"9a1a9d01_3a7ba2bf","updated":"2015-10-01 13:31:58.000000000","message":"Thats why folks said you should use the \"with save_and_reraise:\" because that will make sure the original failure will get raised, regardless of any future failures. That seems OK.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"8ed888c911762245918cb2d5a52cc12ec154b3a4","unresolved":false,"context_lines":[{"line_number":5448,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5449,"context_line":"            # try to rollback live migration on destination."},{"line_number":5450,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5451,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5454,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_3a7ba2bf","line":5451,"in_reply_to":"9a1a9d01_5a577657","updated":"2015-10-01 12:37:01.000000000","message":"what if driver\u0027s rollback fails too? I supposed we need to cover both.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3433d44006796baa3659491bed11892a1b4fce95","unresolved":false,"context_lines":[{"line_number":5448,"context_line":"            # NOTE(tdurakov): even if teardown networks fails driver should"},{"line_number":5449,"context_line":"            # try to rollback live migration on destination."},{"line_number":5450,"context_line":"            LOG.warning(_LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5451,"context_line":"                      instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5454,"context_line":"        #             from remote volumes if necessary"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_26f068c9","line":5451,"in_reply_to":"9a1a9d01_c6716caa","updated":"2015-10-01 13:36:30.000000000","message":"Hmm, looking at your comment on IRC, we could just move them both into methods with a separate decorators for each, that would work too.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0c47523de98ae7688a43a617504565cb06409937","unresolved":false,"context_lines":[{"line_number":5462,"context_line":"                        network_info\u003dnetwork_info)"},{"line_number":5463,"context_line":""},{"line_number":5464,"context_line":"    @wrap_exception()"},{"line_number":5465,"context_line":"    @wrap_instance_event"},{"line_number":5466,"context_line":"    @wrap_instance_fault"},{"line_number":5467,"context_line":"    def _teardown_network_on_destination(self, context, instance):"},{"line_number":5468,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_5a70d60a","line":5465,"updated":"2015-10-01 10:18:33.000000000","message":"This uses the function name and creates a new event (I think), so this really breaks the concept here. It will still have a rollback event as successful.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"66926b69c8575bc9abb1418f57a00f5f5d047251","unresolved":false,"context_lines":[{"line_number":5463,"context_line":""},{"line_number":5464,"context_line":"    @wrap_exception()"},{"line_number":5465,"context_line":"    @wrap_instance_event"},{"line_number":5466,"context_line":"    @wrap_instance_fault"},{"line_number":5467,"context_line":"    def _teardown_network_on_destination(self, context, instance):"},{"line_number":5468,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5469,"context_line":"        self.network_api.setup_networks_on_host(context, instance,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_2b8a7664","line":5466,"updated":"2015-10-01 11:28:27.000000000","message":"because it\u0027s catching all exceptions at line 5447, do we really need those wraps?","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d52e19d262d29e8bf604e13d28c8b3ec9935ef12","unresolved":false,"context_lines":[{"line_number":5463,"context_line":""},{"line_number":5464,"context_line":"    @wrap_exception()"},{"line_number":5465,"context_line":"    @wrap_instance_event"},{"line_number":5466,"context_line":"    @wrap_instance_fault"},{"line_number":5467,"context_line":"    def _teardown_network_on_destination(self, context, instance):"},{"line_number":5468,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5469,"context_line":"        self.network_api.setup_networks_on_host(context, instance,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a1a9d01_46479c4b","line":5466,"in_reply_to":"9a1a9d01_2b8a7664","updated":"2015-10-01 13:31:58.000000000","message":"we should add instance faults and exceptions for the failures, its the instance_event that worries me really.","commit_id":"f25cc14f08d150d57963109d3869681e59929467"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7f46aaa522672ca70486ca23dc0538c7f4123ae8","unresolved":false,"context_lines":[{"line_number":5454,"context_line":"                                                 migrate_data)"},{"line_number":5455,"context_line":"        except Exception:"},{"line_number":5456,"context_line":"            LOG.warning(_LW(\u0027An error occurred while driver rollback.\u0027),"},{"line_number":5457,"context_line":"                        instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5458,"context_line":"        self._notify_about_instance_usage("},{"line_number":5459,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","},{"line_number":5460,"context_line":"                        network_info\u003dnetwork_info)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_55ea9f10","line":5457,"updated":"2015-10-14 16:23:45.000000000","message":"I think you should re-raise any exceptions here.","commit_id":"68189d51fd6f2b3013b353782aea7c3e32151eff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7f46aaa522672ca70486ca23dc0538c7f4123ae8","unresolved":false,"context_lines":[{"line_number":5455,"context_line":"        except Exception:"},{"line_number":5456,"context_line":"            LOG.warning(_LW(\u0027An error occurred while driver rollback.\u0027),"},{"line_number":5457,"context_line":"                        instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5458,"context_line":"        self._notify_about_instance_usage("},{"line_number":5459,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","},{"line_number":5460,"context_line":"                        network_info\u003dnetwork_info)"},{"line_number":5461,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_b5e3f332","line":5458,"updated":"2015-10-14 16:23:45.000000000","message":"we should only send this on success.\n\nwe could send live_migration.rollback.dest.error on the error case, but for the moment I would prefer if we don\u0027t add any more notification, until we get them properly versioned.","commit_id":"68189d51fd6f2b3013b353782aea7c3e32151eff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7f46aaa522672ca70486ca23dc0538c7f4123ae8","unresolved":false,"context_lines":[{"line_number":5460,"context_line":"                        network_info\u003dnetwork_info)"},{"line_number":5461,"context_line":""},{"line_number":5462,"context_line":"    @wrap_exception()"},{"line_number":5463,"context_line":"    @wrap_instance_event"},{"line_number":5464,"context_line":"    @wrap_instance_fault"},{"line_number":5465,"context_line":"    def _teardown_network_on_destination(self, context, instance):"},{"line_number":5466,"context_line":"        # NOTE(tr3buchet): tear down networks on destination host"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_d5978f8e","line":5463,"updated":"2015-10-14 16:23:45.000000000","message":"I don\u0027t think we want an event for these sub tasks","commit_id":"68189d51fd6f2b3013b353782aea7c3e32151eff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"7f46aaa522672ca70486ca23dc0538c7f4123ae8","unresolved":false,"context_lines":[{"line_number":5468,"context_line":"                                                self.host, teardown\u003dTrue)"},{"line_number":5469,"context_line":""},{"line_number":5470,"context_line":"    @wrap_exception()"},{"line_number":5471,"context_line":"    @wrap_instance_event"},{"line_number":5472,"context_line":"    @wrap_instance_fault"},{"line_number":5473,"context_line":"    def _rollback_driver_on_destination(self, context, instance, network_info,"},{"line_number":5474,"context_line":"                                        destroy_disks, migrate_data):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_55d13f56","line":5471,"updated":"2015-10-14 16:23:45.000000000","message":"I don\u0027t think we want this here.","commit_id":"68189d51fd6f2b3013b353782aea7c3e32151eff"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ca3f626ee98c93780e14fab9078d9cb971ece51b","unresolved":false,"context_lines":[{"line_number":5446,"context_line":"                # NOTE(tdurakov): even if teardown networks fails driver"},{"line_number":5447,"context_line":"                # should try to rollback live migration on destination."},{"line_number":5448,"context_line":"                LOG.error("},{"line_number":5449,"context_line":"                    _LW(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5450,"context_line":"                    instance\u003dinstance)"},{"line_number":5451,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5452,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_10f435f0","line":5449,"updated":"2015-10-14 16:43:24.000000000","message":"oops..","commit_id":"c39d49e9019608b1565ff920722c9484f1546133"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0474cb53df6bd128900784484abc55b2d34af769","unresolved":false,"context_lines":[{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5445,"context_line":"                # NOTE(tdurakov): even if teardown networks fails driver"},{"line_number":5446,"context_line":"                # should try to rollback live migration on destination."},{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_abb5d031","line":5446,"updated":"2015-10-14 17:04:07.000000000","message":"Nit this comment doesn\u0027t quite fit where it is used now, but its OK.","commit_id":"8ea403ce4e91e4b09cbb33b5a9e666804f61a84f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4783d9d87c080e40d73f76455fd76aef16af706d","unresolved":false,"context_lines":[{"line_number":5439,"context_line":"        try:"},{"line_number":5440,"context_line":"            # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5441,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5442,"context_line":"                                                self.host, teardown\u003dTrue)"},{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5445,"context_line":"                # NOTE(tdurakov): even if teardown networks fails driver"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_2ac5275a","line":5442,"updated":"2015-10-15 05:03:57.000000000","message":"minor nit but the indentation here needs to be fixed","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4783d9d87c080e40d73f76455fd76aef16af706d","unresolved":false,"context_lines":[{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"},{"line_number":5450,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_caa273ae","line":5450,"updated":"2015-10-15 05:03:57.000000000","message":"why do we need the debug log of there is an error log above","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"606f161fcbed5425023278868fdfadcc1b8a2b22","unresolved":false,"context_lines":[{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"},{"line_number":5450,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_c379be83","line":5450,"in_reply_to":"5a2ca52d_2efc3671","updated":"2015-10-16 09:20:22.000000000","message":"I thought we wanted to keep traceback out of the error logs, hence the debug log to include the trace back.\n\nApparently, we decided on the opposite, which totally passed me by:\nhttp://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#stacktraces-in-logs\n\nLOG.exception it is.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"52dc249ad633480de75230a8783ba465b0b85ab1","unresolved":false,"context_lines":[{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"},{"line_number":5450,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_ea8c0f37","line":5450,"in_reply_to":"5a2ca52d_caa273ae","updated":"2015-10-15 08:02:40.000000000","message":"how about use exception level, then we also can get the trace.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05aa97178893f15fa56bc02dc0ac1f92eb0e69d7","unresolved":false,"context_lines":[{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"},{"line_number":5450,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_faf83dc5","line":5450,"in_reply_to":"5a2ca52d_ea8c0f37","updated":"2015-10-15 17:04:09.000000000","message":"Yeah we don\u0027t need both log.error and log.debug + exc_info\u003dTrue when LOG.exception would do both.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2cb34efda15bf8f125f5042b539142454c89d29c","unresolved":false,"context_lines":[{"line_number":5447,"context_line":"                LOG.error("},{"line_number":5448,"context_line":"                    _LE(\u0027An error occurred while deallocating network.\u0027),"},{"line_number":5449,"context_line":"                    instance\u003dinstance)"},{"line_number":5450,"context_line":"                LOG.debug(\u0027An error occurred while deallocating network.\u0027,"},{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_2efc3671","line":5450,"in_reply_to":"5a2ca52d_faf83dc5","updated":"2015-10-15 17:33:15.000000000","message":"setup_networks_on_host is not implemented for the neutron API in nova and for nova-network it\u0027s a call, but do we need the traceback?  I\u0027d think that just logging the error would be enough:\n\ntry:\n    self.network_api.setup_networks_on_host(...)\nexcept Exception as ex:\n    with excutils.save_and_reraise_exception\n        LOG.error(_LE(\u0027An error occurred while deallocating network on destination host after failed live migration. Error: %s\u0027, six.text_type(ex), instance\u003dinstance)\nfinally:\n    ...\n    self.driver.rollback_live_migration_at_destination(...)\n\nThis all seems kind of messy just to re-raise the original error.  This seems like a task for exception chaining which is only in python 3.  lifeless might have some ideas here, but couldn\u0027t we save off the first exception and just raise that up at the end?  I\u0027m wondering if six has something for re-raising a saved off exception.  I\u0027d have to check.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"759b72a3f2e8cd94e9415f122f43b4506cf4f56e","unresolved":false,"context_lines":[{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"},{"line_number":5454,"context_line":"            # always run this even if _teardown_network_on_destination fails"},{"line_number":5455,"context_line":"            # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_9a182920","line":5454,"updated":"2015-10-15 17:06:24.000000000","message":"_teardown_network_on_destination is not a method you\u0027re calling directly in here so it looks odd.  Maybe replace that with setup_networks_on_host which is the method you called above.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"606f161fcbed5425023278868fdfadcc1b8a2b22","unresolved":false,"context_lines":[{"line_number":5451,"context_line":"                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":5452,"context_line":""},{"line_number":5453,"context_line":"        finally:"},{"line_number":5454,"context_line":"            # always run this even if _teardown_network_on_destination fails"},{"line_number":5455,"context_line":"            # NOTE(vish): The mapping is passed in so the driver can disconnect"},{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_23f0b2fd","line":5454,"in_reply_to":"5a2ca52d_9a182920","updated":"2015-10-16 09:20:22.000000000","message":"+1","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a0927e0fbf2f5440953fe79b08b0379b5af91e7e","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_1acf392a","line":5459,"updated":"2015-10-15 17:13:14.000000000","message":"I\u0027m probably missing something, but why don\u0027t we just run this in the with excutils.save_and_reraise_exception block above?","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2cb34efda15bf8f125f5042b539142454c89d29c","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_cec34256","line":5459,"in_reply_to":"5a2ca52d_1acf392a","updated":"2015-10-15 17:33:15.000000000","message":"Nevermind that doesn\u0027t work because then you only run this code if setup_networks_on_host failed.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"606f161fcbed5425023278868fdfadcc1b8a2b22","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_43b7ee39","line":5459,"in_reply_to":"5a2ca52d_42338362","updated":"2015-10-16 09:20:22.000000000","message":"We don\u0027t want notify_about_instance_usage to run in the driver call fails.\n\nThe decorator gets an error notification in that case. We could add a different notification in the error case of \"live_migration.rollback.dest.error\" which would match other places, but I don\u0027t want to add new notifications until we get these all fixed up (spec is up for that).","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"e19905cd8d7066d77a96a09714b73ab87a07469d","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_42338362","line":5459,"in_reply_to":"5a2ca52d_a718691f","updated":"2015-10-15 18:59:46.000000000","message":"So this still has bugs right?\n\n\nlike\n\nnotify_about_instance_usage won\u0027t run if the driver call fails\n\nIts reminiscent of the bugs we saw in tearDown and setUp calls before cleanups were added. You could use fixtures.callmany.CallMany() here, or do a staircase try:finally: sequence.\n\nThe issue with reraise here is that the code to run after an exception is the same on both except: and else: blocks (thus its a \u0027finally\u0027) but we\u0027re only able to use reraise after an exception occurs, so I think the choices are only the two above - use CallMany directly, which will likely confuse folk a little since its api is LIFO, or staircase.\n\nYou could rewrite CallMany locally (and I imagine some folk will go \u0027argh argh argh fixtures is test code so you have to\u0027, though thats not my perspective on fixtures) and make it FIFO at the same time.\n\nThen you\u0027d get something like:\n\n with CallMany() as calls:\n     calls.add(network_api.setup_networks_on_host, context, instance, self.host, teardown\u003dTrue)\n     calls.add(....)","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c2cf024425594697abf8800328eba941c8d5884b","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_d1b44736","line":5459,"in_reply_to":"5a2ca52d_cec34256","updated":"2015-10-15 17:40:58.000000000","message":"Maybe we can do something like this?\n\nhttp://paste.openstack.org/show/476411/\n\nWhere the first exception is from setup_networks_on_host and the second exception is from rollback_live_migration_at_destination.","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14a83f84f7ad704bacbe0207768fce3a999298a0","unresolved":false,"context_lines":[{"line_number":5456,"context_line":"            #             from remote volumes if necessary"},{"line_number":5457,"context_line":"            block_device_info \u003d self._get_instance_block_device_info(context,"},{"line_number":5458,"context_line":"                                                                     instance)"},{"line_number":5459,"context_line":"            self.driver.rollback_live_migration_at_destination("},{"line_number":5460,"context_line":"                context, instance, network_info, block_device_info,"},{"line_number":5461,"context_line":"                destroy_disks\u003ddestroy_disks, migrate_data\u003dmigrate_data)"},{"line_number":5462,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_a718691f","line":5459,"in_reply_to":"5a2ca52d_d1b44736","updated":"2015-10-15 18:33:10.000000000","message":"Here is more specifically what I\u0027m thinking of:\n\nhttp://paste.openstack.org/show/476416/","commit_id":"749b2688c857dfaf92daec7bbdd9604e088fad1a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ae745e95b079dfc7b76ab05f5ebc10794a70a0e8","unresolved":false,"context_lines":[{"line_number":5470,"context_line":"        self._notify_about_instance_usage("},{"line_number":5471,"context_line":"                      context, instance, \"live_migration.rollback.dest.start\","},{"line_number":5472,"context_line":"                      network_info\u003dnetwork_info)"},{"line_number":5473,"context_line":"        first_failure \u003d None"},{"line_number":5474,"context_line":"        try:"},{"line_number":5475,"context_line":"            # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5476,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_63722a13","line":5473,"updated":"2015-10-16 09:24:33.000000000","message":"This seems to be used for both the first and second failure, maybe just exception_raised or something?","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1df168cdeaa0e609eb1e276db069a86e302bf7d8","unresolved":false,"context_lines":[{"line_number":5470,"context_line":"        self._notify_about_instance_usage("},{"line_number":5471,"context_line":"                      context, instance, \"live_migration.rollback.dest.start\","},{"line_number":5472,"context_line":"                      network_info\u003dnetwork_info)"},{"line_number":5473,"context_line":"        first_failure \u003d None"},{"line_number":5474,"context_line":"        try:"},{"line_number":5475,"context_line":"            # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5476,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_2d8885c4","line":5473,"in_reply_to":"5a2ca52d_63722a13","updated":"2015-10-16 18:26:38.000000000","message":"Yeah that could be cleaner.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"0fd4776766e8f82c5ded35ad7a499f59dd4720eb","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_d32f6786","line":5499,"updated":"2015-10-15 20:08:55.000000000","message":"blah.. fugly.  would it be better to generate a new exception from the previous exception and use all messages in the exception if there are multiple exceptions raised?","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6f50b7a70d76cc151519478fa735e0cc3c0a56bb","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_b31f4a6b","line":5499,"in_reply_to":"5a2ca52d_3356dbce","updated":"2015-10-15 20:59:24.000000000","message":"You could but I don\u0027t really see the benefit.  The exceptions might not be related, I wouldn\u0027t make that assumption.  And in general, telling people to check the logs is not something you should do.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1df168cdeaa0e609eb1e276db069a86e302bf7d8","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_6db8bd75","line":5499,"in_reply_to":"5a2ca52d_8356665a","updated":"2015-10-16 18:26:38.000000000","message":"Is there a specific reason why the driver.rollback failure is more important?","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ae745e95b079dfc7b76ab05f5ebc10794a70a0e8","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_8356665a","line":5499,"in_reply_to":"5a2ca52d_b31f4a6b","updated":"2015-10-16 09:24:33.000000000","message":"Honestly, in this case, I really want the driver.rollback exception, rather than the setup_networks one, if there happy to be two exceptions. Hence the original use of the finally clause letting this exception hide the original one (at least I think thats what it did).","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6a8076bab970a155249e59319f8c948b1626064a","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_d35d2716","line":5499,"in_reply_to":"5a2ca52d_d32f6786","updated":"2015-10-15 20:10:14.000000000","message":"You lose the traceback from the original if you do that.  python \u003c 3 doesn\u0027t have exception chaining, and this isn\u0027t like Java, so exception handling is a bit touchy.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"0032d0512754ec81df20308364b7fc6974a8fabf","unresolved":false,"context_lines":[{"line_number":5496,"context_line":"                LOG.exception(_LE(\u0027Rolling back live migration at destination \u0027"},{"line_number":5497,"context_line":"                                  \u0027failed.\u0027), instance\u003dinstance)"},{"line_number":5498,"context_line":"            else:"},{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_3356dbce","line":5499,"in_reply_to":"5a2ca52d_d35d2716","updated":"2015-10-15 20:14:25.000000000","message":"Is it possible to update the exception message to state there are additional details in the log?  The first exception could potentially cause the 2nd exception.  I would be nice if there were some way to tie the exceptions together when debugging.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"711fb6325bb9a78c3d662ddbb09f210ed473e4f8","unresolved":false,"context_lines":[{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"},{"line_number":5503,"context_line":""},{"line_number":5504,"context_line":"        self._notify_about_instance_usage("},{"line_number":5505,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_a9234957","line":5502,"updated":"2015-10-16 06:23:45.000000000","message":"why we must raise exception, we log the exception in two places looks like enough.  This is async call https://github.com/openstack/nova/blob/master/nova/compute/rpcapi.py#L762\n\nSo whatever we raise exception not, user only can check the log to know something wrong happened.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1df168cdeaa0e609eb1e276db069a86e302bf7d8","unresolved":false,"context_lines":[{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"},{"line_number":5503,"context_line":""},{"line_number":5504,"context_line":"        self._notify_about_instance_usage("},{"line_number":5505,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_eda4cd4b","line":5502,"in_reply_to":"5a2ca52d_06e49fde","updated":"2015-10-16 18:26:38.000000000","message":"Yeah, we don\u0027t get the fault associated with the instance if we don\u0027t raise the exception, and the fault is how the user finds out something failed with the cast async operation.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"5b1568f3bd4b30a399922e1603b37968e9af68fb","unresolved":false,"context_lines":[{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"},{"line_number":5503,"context_line":""},{"line_number":5504,"context_line":"        self._notify_about_instance_usage("},{"line_number":5505,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_06e49fde","line":5502,"in_reply_to":"5a2ca52d_982495c5","updated":"2015-10-16 11:44:00.000000000","message":"thanks, I missed that.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"39cc15a0947fb3b006d16934e593f19a2cb3e7a8","unresolved":false,"context_lines":[{"line_number":5499,"context_line":"                first_failure \u003d sys.exc_info()"},{"line_number":5500,"context_line":""},{"line_number":5501,"context_line":"        if first_failure:"},{"line_number":5502,"context_line":"            six.reraise(*first_failure)"},{"line_number":5503,"context_line":""},{"line_number":5504,"context_line":"        self._notify_about_instance_usage("},{"line_number":5505,"context_line":"                        context, instance, \"live_migration.rollback.dest.end\","}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_982495c5","line":5502,"in_reply_to":"5a2ca52d_a9234957","updated":"2015-10-16 09:08:55.000000000","message":"Its for all the decorators, its important there.","commit_id":"afd5c98fe8bf67985fcd72a0c999b8e53a1bf1c2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"80dd3d857ffa158b606d2ad096f057ac953dda2c","unresolved":false,"context_lines":[{"line_number":5439,"context_line":"        try:"},{"line_number":5440,"context_line":"            # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5441,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5442,"context_line":"                                                self.host, teardown\u003dTrue)"},{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5445,"context_line":"                # NOTE(tdurakov): even if teardown networks fails driver"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a2ca52d_d2c8a924","line":5442,"updated":"2015-10-16 10:11:36.000000000","message":"Nit: still got that indentation issue gary mentioned.","commit_id":"448fd4789b371826ad086d0339c7a8b95a20d933"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"a5b0f0ca0be0aaa5c595dc1963ae8e0bb0ebfa6f","unresolved":false,"context_lines":[{"line_number":5439,"context_line":"        try:"},{"line_number":5440,"context_line":"            # NOTE(tr3buchet): tear down networks on destination host"},{"line_number":5441,"context_line":"            self.network_api.setup_networks_on_host(context, instance,"},{"line_number":5442,"context_line":"                                                self.host, teardown\u003dTrue)"},{"line_number":5443,"context_line":"        except Exception:"},{"line_number":5444,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":5445,"context_line":"                # NOTE(tdurakov): even if teardown networks fails driver"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a2ca52d_35d6a7f1","line":5442,"in_reply_to":"5a2ca52d_d2c8a924","updated":"2015-10-16 10:29:14.000000000","message":"ah, lost this during change, thanks, done","commit_id":"448fd4789b371826ad086d0339c7a8b95a20d933"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"f92a9f113f09d145cf92dc030418a579ebc71885","unresolved":false,"context_lines":[{"line_number":5974,"context_line":"                side_effect\u003dtest.TestingException)"},{"line_number":5975,"context_line":"    @mock.patch(\u0027nova.virt.driver.ComputeDriver.\u0027"},{"line_number":5976,"context_line":"                \u0027rollback_live_migration_at_destination\u0027)"},{"line_number":5977,"context_line":"    def test_rollback_live_migration_at_destination_network_fails("},{"line_number":5978,"context_line":"            self, mock_rollback, net_mock):"},{"line_number":5979,"context_line":"        c \u003d context.get_admin_context()"},{"line_number":5980,"context_line":"        instance \u003d self._create_fake_instance_obj()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_992fe0f5","line":5977,"updated":"2015-09-28 18:06:24.000000000","message":"Shouldn\u0027t that test case be in \"test_manager.py\"?","commit_id":"6a9abf8ac6babacd4e31ab4d35a9ebd208cbee8c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a32b34f59e77fd306086e6272a79e3313a78f8b4","unresolved":false,"context_lines":[{"line_number":5974,"context_line":"                side_effect\u003dtest.TestingException)"},{"line_number":5975,"context_line":"    @mock.patch(\u0027nova.virt.driver.ComputeDriver.\u0027"},{"line_number":5976,"context_line":"                \u0027rollback_live_migration_at_destination\u0027)"},{"line_number":5977,"context_line":"    def test_rollback_live_migration_at_destination_network_fails("},{"line_number":5978,"context_line":"            self, mock_rollback, net_mock):"},{"line_number":5979,"context_line":"        c \u003d context.get_admin_context()"},{"line_number":5980,"context_line":"        instance \u003d self._create_fake_instance_obj()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_96c24233","line":5977,"in_reply_to":"9a1a9d01_992fe0f5","updated":"2015-09-29 00:35:02.000000000","message":"I think it should be, technically, but the existing test_rollback_live_migration_at_destination_correctly is in this file, so it makes some sense to keep them together","commit_id":"6a9abf8ac6babacd4e31ab4d35a9ebd208cbee8c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"54c39a478c8815e3f8fc8aa12766716a8a16927f","unresolved":false,"context_lines":[{"line_number":5974,"context_line":"                side_effect\u003dtest.TestingException)"},{"line_number":5975,"context_line":"    @mock.patch(\u0027nova.virt.driver.ComputeDriver.\u0027"},{"line_number":5976,"context_line":"                \u0027rollback_live_migration_at_destination\u0027)"},{"line_number":5977,"context_line":"    def test_rollback_live_migration_at_destination_network_fails("},{"line_number":5978,"context_line":"            self, mock_rollback, net_mock):"},{"line_number":5979,"context_line":"        c \u003d context.get_admin_context()"},{"line_number":5980,"context_line":"        instance \u003d self._create_fake_instance_obj()"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a2ca52d_1045a244","line":5977,"updated":"2015-10-16 18:30:33.000000000","message":"I sort of feel like you should have an additional test case that has both operations failing and verifying that the latter (from driver.rollback) is the one that\u0027s raised up, but I\u0027m kind of exhausted with this change by now and don\u0027t really care either.","commit_id":"ef5f666fe2178540fd66803388220c2321f7c2b8"}]}
