)]}'
{"nova/tests/virt/libvirt/test_libvirt.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0f36cbd6ebb4caa2fec38193f3e507471e7a4d5a","unresolved":false,"context_lines":[{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        def fake_lookup_by_name(instance_name):"},{"line_number":6728,"context_line":"            raise exception.InstanceNotFound(instance_id\u003dinstance_name)"},{"line_number":6729,"context_line":""},{"line_number":6730,"context_line":"        def fake_volume_driver_method(method_name, connection_info,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_6773e715","line":6727,"updated":"2014-05-21 12:28:13.000000000","message":"Can you please use mock instead of mox. It was decided that we should use that for new tests.","commit_id":"7a7ad50b5739acf99b652e2dadd65c327c954316"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0b47a6f9915b45b39e283236cf2808c0a394f92","unresolved":false,"context_lines":[{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        def fake_lookup_by_name(instance_name):"},{"line_number":6728,"context_line":"            raise exception.InstanceNotFound(instance_id\u003dinstance_name)"},{"line_number":6729,"context_line":""},{"line_number":6730,"context_line":"        def fake_volume_driver_method(method_name, connection_info,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_42732be7","line":6727,"in_reply_to":"7adec928_6773e715","updated":"2014-05-21 20:08:29.000000000","message":"+1, for reference:\n\nhttps://wiki.openstack.org/wiki/ReviewChecklist#Common_Review_Checklist\n\nSee #4.\n\nThis is not a big test so should be trivial to use mock with a side_effect to raise the InstanceNotFound and mock out \u0027volume_driver_method\u0027.","commit_id":"7a7ad50b5739acf99b652e2dadd65c327c954316"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"61a91cb3ab27bb50cbacc92baacdc1bcbbbfbbf6","unresolved":false,"context_lines":[{"line_number":6721,"context_line":"                          conn.get_spice_console, self.context, instance)"},{"line_number":6722,"context_line":""},{"line_number":6723,"context_line":"    def test_detach_volume_with_instance_not_found(self):"},{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        instance \u003d {\u0027name\u0027: \u0027zhaoqin\u0027}"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_a5e780e3","line":6724,"updated":"2014-05-22 14:41:46.000000000","message":"We actually don\u0027t want to use doc strings in test cases because when they fail it can mess with the output, so generally just comment blocks with # are preferred.","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"f924ec060b0dd2f805bd349f89e968dfe25c7df5","unresolved":false,"context_lines":[{"line_number":6721,"context_line":"                          conn.get_spice_console, self.context, instance)"},{"line_number":6722,"context_line":""},{"line_number":6723,"context_line":"    def test_detach_volume_with_instance_not_found(self):"},{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        instance \u003d {\u0027name\u0027: \u0027zhaoqin\u0027}"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_901ba47f","line":6724,"in_reply_to":"7adec928_a5e780e3","updated":"2014-05-22 15:11:51.000000000","message":"Done","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"61a91cb3ab27bb50cbacc92baacdc1bcbbbfbbf6","unresolved":false,"context_lines":[{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        instance \u003d {\u0027name\u0027: \u0027zhaoqin\u0027}"},{"line_number":6728,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)"},{"line_number":6729,"context_line":""},{"line_number":6730,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_8507e480","line":6727,"updated":"2014-05-22 14:41:46.000000000","message":"We should be testing with instance objects, e.g.\n\ninstance \u003d self.create_instance_obj(self.context)","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"f924ec060b0dd2f805bd349f89e968dfe25c7df5","unresolved":false,"context_lines":[{"line_number":6724,"context_line":"        \"\"\"Test that detach_volume() method does not raise exception,"},{"line_number":6725,"context_line":"        if the instance does not exist."},{"line_number":6726,"context_line":"        \"\"\""},{"line_number":6727,"context_line":"        instance \u003d {\u0027name\u0027: \u0027zhaoqin\u0027}"},{"line_number":6728,"context_line":"        conn \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)"},{"line_number":6729,"context_line":""},{"line_number":6730,"context_line":"        with contextlib.nested("}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_f00b0829","line":6727,"in_reply_to":"7adec928_8507e480","updated":"2014-05-22 15:11:51.000000000","message":"Done","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"61a91cb3ab27bb50cbacc92baacdc1bcbbbfbbf6","unresolved":false,"context_lines":[{"line_number":6733,"context_line":"                                  instance_id\u003dinstance[\u0027name\u0027])),"},{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_05d674c3","line":6736,"updated":"2014-05-22 14:41:46.000000000","message":"nit: would prefer passing in something like \u0027fake-connection-info\u0027 rather than None for the first arg so it\u0027s more explicit even though it\u0027s not used.","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"f924ec060b0dd2f805bd349f89e968dfe25c7df5","unresolved":false,"context_lines":[{"line_number":6733,"context_line":"                                  instance_id\u003dinstance[\u0027name\u0027])),"},{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_50011c05","line":6736,"in_reply_to":"7adec928_05d674c3","updated":"2014-05-22 15:11:51.000000000","message":"Done","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"61a91cb3ab27bb50cbacc92baacdc1bcbbbfbbf6","unresolved":false,"context_lines":[{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"},{"line_number":6740,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_05fd943b","line":6737,"updated":"2014-05-22 14:41:46.000000000","message":"Use _lookup_by_name.assert_called_once_with(instance.name) instead so it enforces that it\u0027s only called once.","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"f924ec060b0dd2f805bd349f89e968dfe25c7df5","unresolved":false,"context_lines":[{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"},{"line_number":6740,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_6bff0902","line":6737,"in_reply_to":"7adec928_05fd943b","updated":"2014-05-22 15:11:51.000000000","message":"Done","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"61a91cb3ab27bb50cbacc92baacdc1bcbbbfbbf6","unresolved":false,"context_lines":[{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"},{"line_number":6740,"context_line":""},{"line_number":6741,"context_line":"    def _test_attach_detach_interface_get_config(self, method_name):"},{"line_number":6742,"context_line":"        \"\"\"Tests that the get_config() method is properly called in"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_458ebcd1","line":6739,"updated":"2014-05-22 14:41:46.000000000","message":"Pass fake connection info here rather than None also for clarity.","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"f924ec060b0dd2f805bd349f89e968dfe25c7df5","unresolved":false,"context_lines":[{"line_number":6736,"context_line":"            conn.detach_volume(None, instance, \u0027/dev/sda\u0027)"},{"line_number":6737,"context_line":"            _lookup_by_name.assert_has_calls(mock.call(instance[\u0027name\u0027]))"},{"line_number":6738,"context_line":"            volume_driver_method.assert_has_calls("},{"line_number":6739,"context_line":"                mock.call(\u0027disconnect_volume\u0027, None, \u0027sda\u0027))"},{"line_number":6740,"context_line":""},{"line_number":6741,"context_line":"    def _test_attach_detach_interface_get_config(self, method_name):"},{"line_number":6742,"context_line":"        \"\"\"Tests that the get_config() method is properly called in"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_cb0c9d3e","line":6739,"in_reply_to":"7adec928_458ebcd1","updated":"2014-05-22 15:11:51.000000000","message":"Done","commit_id":"62d8928bde94a73476806b2490ea0fb37da1e9ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f1d166fc6a2abbf0a3e6cc891fb4397e823340a","unresolved":false,"context_lines":[{"line_number":6730,"context_line":"        with contextlib.nested("},{"line_number":6731,"context_line":"            mock.patch.object(conn, \u0027_lookup_by_name\u0027,"},{"line_number":6732,"context_line":"                              side_effect\u003dexception.InstanceNotFound("},{"line_number":6733,"context_line":"                                  instance_id\u003dinstance[\u0027name\u0027])),"},{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            connection_info \u003d {\u0027driver_volume_type\u0027: \u0027fake\u0027}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_bdab1888","line":6733,"updated":"2014-05-22 15:51:33.000000000","message":"Should be instance.name since you\u0027re using an object now.","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"01e9144ed7e2e15dce96587d7ef1b67cfd701aa4","unresolved":false,"context_lines":[{"line_number":6730,"context_line":"        with contextlib.nested("},{"line_number":6731,"context_line":"            mock.patch.object(conn, \u0027_lookup_by_name\u0027,"},{"line_number":6732,"context_line":"                              side_effect\u003dexception.InstanceNotFound("},{"line_number":6733,"context_line":"                                  instance_id\u003dinstance[\u0027name\u0027])),"},{"line_number":6734,"context_line":"            mock.patch.object(conn, \u0027volume_driver_method\u0027)"},{"line_number":6735,"context_line":"        ) as (_lookup_by_name, volume_driver_method):"},{"line_number":6736,"context_line":"            connection_info \u003d {\u0027driver_volume_type\u0027: \u0027fake\u0027}"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_b358a7fb","line":6733,"in_reply_to":"7adec928_bdab1888","updated":"2014-05-22 16:48:35.000000000","message":"Done. Sorry....","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f1d166fc6a2abbf0a3e6cc891fb4397e823340a","unresolved":false,"context_lines":[{"line_number":6736,"context_line":"            connection_info \u003d {\u0027driver_volume_type\u0027: \u0027fake\u0027}"},{"line_number":6737,"context_line":"            conn.detach_volume(connection_info, instance, \u0027/dev/sda\u0027)"},{"line_number":6738,"context_line":"            _lookup_by_name.assert_called_once_with("},{"line_number":6739,"context_line":"                mock.call(instance[\u0027name\u0027]))"},{"line_number":6740,"context_line":"            volume_driver_method.assert_called_once_with("},{"line_number":6741,"context_line":"                mock.call(\u0027disconnect_volume\u0027, connection_info, \u0027sda\u0027))"},{"line_number":6742,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_9d8bbc1d","line":6739,"updated":"2014-05-22 15:51:33.000000000","message":"instance.name, also I don\u0027t think this will work since assert_called_once_with expects the parameters to the _lookup_by_name call, not a mock call object.  So you can just remove the mock.call here.","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"01e9144ed7e2e15dce96587d7ef1b67cfd701aa4","unresolved":false,"context_lines":[{"line_number":6736,"context_line":"            connection_info \u003d {\u0027driver_volume_type\u0027: \u0027fake\u0027}"},{"line_number":6737,"context_line":"            conn.detach_volume(connection_info, instance, \u0027/dev/sda\u0027)"},{"line_number":6738,"context_line":"            _lookup_by_name.assert_called_once_with("},{"line_number":6739,"context_line":"                mock.call(instance[\u0027name\u0027]))"},{"line_number":6740,"context_line":"            volume_driver_method.assert_called_once_with("},{"line_number":6741,"context_line":"                mock.call(\u0027disconnect_volume\u0027, connection_info, \u0027sda\u0027))"},{"line_number":6742,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_b30fc7e0","line":6739,"in_reply_to":"7adec928_9d8bbc1d","updated":"2014-05-22 16:48:35.000000000","message":"Done","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f1d166fc6a2abbf0a3e6cc891fb4397e823340a","unresolved":false,"context_lines":[{"line_number":6738,"context_line":"            _lookup_by_name.assert_called_once_with("},{"line_number":6739,"context_line":"                mock.call(instance[\u0027name\u0027]))"},{"line_number":6740,"context_line":"            volume_driver_method.assert_called_once_with("},{"line_number":6741,"context_line":"                mock.call(\u0027disconnect_volume\u0027, connection_info, \u0027sda\u0027))"},{"line_number":6742,"context_line":""},{"line_number":6743,"context_line":"    def _test_attach_detach_interface_get_config(self, method_name):"},{"line_number":6744,"context_line":"        \"\"\"Tests that the get_config() method is properly called in"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_5d713443","line":6741,"updated":"2014-05-22 15:51:33.000000000","message":"Remove the mock.call usage here since you\u0027re using assert_called_once_with.","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"01e9144ed7e2e15dce96587d7ef1b67cfd701aa4","unresolved":false,"context_lines":[{"line_number":6738,"context_line":"            _lookup_by_name.assert_called_once_with("},{"line_number":6739,"context_line":"                mock.call(instance[\u0027name\u0027]))"},{"line_number":6740,"context_line":"            volume_driver_method.assert_called_once_with("},{"line_number":6741,"context_line":"                mock.call(\u0027disconnect_volume\u0027, connection_info, \u0027sda\u0027))"},{"line_number":6742,"context_line":""},{"line_number":6743,"context_line":"    def _test_attach_detach_interface_get_config(self, method_name):"},{"line_number":6744,"context_line":"        \"\"\"Tests that the get_config() method is properly called in"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_3303b7b9","line":6741,"in_reply_to":"7adec928_5d713443","updated":"2014-05-22 16:48:35.000000000","message":"Done","commit_id":"d2f3d7e1505cc6f154974b234a4fe1862aa24ff4"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"f939ef954197ef811b55cfb60678c6ac957b6792","unresolved":false,"context_lines":[{"line_number":1383,"context_line":"                    encryptor \u003d self._get_volume_encryptor(connection_info,"},{"line_number":1384,"context_line":"                                                           encryption)"},{"line_number":1385,"context_line":"                    encryptor.detach_volume(**encryption)"},{"line_number":1386,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1387,"context_line":"            # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()"},{"line_number":1388,"context_line":"            #                will throw InstanceNotFound exception. Need to"},{"line_number":1389,"context_line":"            #                disconnect volume under this circumstance."}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_2c92cd4b","line":1386,"updated":"2014-05-20 08:21:44.000000000","message":"Looks good for me, what do you think about merging this line with 1386? you can use isinstance to check what is the kind of \u0027ex\u0027","commit_id":"bd40a251eb3f5261e5dba4ce677e3b9bf20a95a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a475bf5a7586c00045e330803d3ed85ed711c23f","unresolved":false,"context_lines":[{"line_number":1383,"context_line":"                    encryptor \u003d self._get_volume_encryptor(connection_info,"},{"line_number":1384,"context_line":"                                                           encryption)"},{"line_number":1385,"context_line":"                    encryptor.detach_volume(**encryption)"},{"line_number":1386,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1387,"context_line":"            # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()"},{"line_number":1388,"context_line":"            #                will throw InstanceNotFound exception. Need to"},{"line_number":1389,"context_line":"            #                disconnect volume under this circumstance."}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_d8568029","line":1386,"in_reply_to":"7adec928_075c0a18","updated":"2014-05-20 13:52:07.000000000","message":"I\u0027m OK with explicitly handling InstanceNotFound to avoid isinstance logic in a common block.","commit_id":"bd40a251eb3f5261e5dba4ce677e3b9bf20a95a4"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"d6a90e94153bb229ca0d7d71a49e0a2e356b0e5a","unresolved":false,"context_lines":[{"line_number":1383,"context_line":"                    encryptor \u003d self._get_volume_encryptor(connection_info,"},{"line_number":1384,"context_line":"                                                           encryption)"},{"line_number":1385,"context_line":"                    encryptor.detach_volume(**encryption)"},{"line_number":1386,"context_line":"        except exception.InstanceNotFound:"},{"line_number":1387,"context_line":"            # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()"},{"line_number":1388,"context_line":"            #                will throw InstanceNotFound exception. Need to"},{"line_number":1389,"context_line":"            #                disconnect volume under this circumstance."}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_075c0a18","line":1386,"in_reply_to":"7adec928_2c92cd4b","updated":"2014-05-20 08:52:32.000000000","message":"Personally, I like to use \u0027try/except\u0027 structure to distinguish the exception type.\nIn fact, I am not quite sure if or not VIR_ERR_NO_DOMAIN can be thrown here. If the domain does not exist, _lookup_by_name() should throw the exception. If _lookup_by_name() succeed, I do not know why VIR_ERR_NO_DOMAIN will be thrown by the following operations.\nIf VIR_ERR_NO_DOMAIN can always be detected by _lookup_by_name(), I feel the lines made by vish can be replaced by the new code to handle InstanceNotFound.","commit_id":"bd40a251eb3f5261e5dba4ce677e3b9bf20a95a4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a475bf5a7586c00045e330803d3ed85ed711c23f","unresolved":false,"context_lines":[{"line_number":1387,"context_line":"            # NOTE(zhaoqin): If the instance does not exist, _lookup_by_name()"},{"line_number":1388,"context_line":"            #                will throw InstanceNotFound exception. Need to"},{"line_number":1389,"context_line":"            #                disconnect volume under this circumstance."},{"line_number":1390,"context_line":"            LOG.warn(_(\"During detach_volume, instance disappeared.\"))"},{"line_number":1391,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":1392,"context_line":"            # NOTE(vish): This is called to cleanup volumes after live"},{"line_number":1393,"context_line":"            #             migration, so we should still disconnect even if"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_38504431","line":1390,"updated":"2014-05-20 13:52:07.000000000","message":"Use the _LW annotation:\n\nhttps://wiki.openstack.org/wiki/LoggingStandards#Guidelines","commit_id":"bd40a251eb3f5261e5dba4ce677e3b9bf20a95a4"}]}
