)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This is the second step in implementing Cinders"},{"line_number":10,"context_line":"V3 attachment API. This patch adds the equivalent"},{"line_number":11,"context_line":"V3 call (attachment_update or attachment_delete)"},{"line_number":12,"context_line":"for each case of terminate_connection."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"The new methods are triggered by the presence of"},{"line_number":15,"context_line":"attachment_uuid in the BDM. This field will only"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7ffa3b31_b8dfc638","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":38},"updated":"2017-04-19 18:39:11.000000000","message":"This isn\u0027t true anymore.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     1106477b (Merge \"Revert \"Make server_groups determine deleted-ness from InstanceMappingList\"\")"},{"line_number":2,"context_line":"Author:     Steve Noyes \u003csteve.noyes@oracle.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2017-04-19 14:06:29 -0400"},{"line_number":4,"context_line":"Commit:     Steve Noyes \u003csteve.noyes@oracle.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-04-19 16:29:31 -0400"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"7ffa3b31_3aa60655","line":2,"range":{"start_line":2,"start_character":12,"end_line":2,"end_character":48},"updated":"2017-04-19 23:04:01.000000000","message":"This needs to go back to John Griffith as the original author:\n\njohn.griffith8@gmail.com \u003cjohn.griffith8@gmail.com\u003e\n\nYou are the committer.\n\nIf you want credit for co-author, then add this to the commit message at the bottom above the Change-Id:\n\nCo-Authored-By: Steve Noyes \u003csteve.noyes@oracle.com\u003e","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     1106477b (Merge \"Revert \"Make server_groups determine deleted-ness from InstanceMappingList\"\")"},{"line_number":2,"context_line":"Author:     Steve Noyes \u003csteve.noyes@oracle.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2017-04-19 14:06:29 -0400"},{"line_number":4,"context_line":"Commit:     Steve Noyes \u003csteve.noyes@oracle.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-04-19 16:29:31 -0400"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"7ffa3b31_078758b7","line":2,"range":{"start_line":2,"start_character":12,"end_line":2,"end_character":48},"in_reply_to":"7ffa3b31_3aa60655","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"}],"nova/compute/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"15aa46c9283631e5fea5268ace36f6478d48afb1","unresolved":false,"context_lines":[{"line_number":2149,"context_line":"        for bdm in bdms:"},{"line_number":2150,"context_line":"            if bdm.is_volume:"},{"line_number":2151,"context_line":"                try:"},{"line_number":2152,"context_line":"                    if bdm.attachment_id:"},{"line_number":2153,"context_line":"                        self.volume_api.attachment_delete(context,"},{"line_number":2154,"context_line":"                                                          bdm.attachment_id)"},{"line_number":2155,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_bb45f472","line":2152,"updated":"2017-03-31 09:36:29.000000000","message":"It feels like this whole flow should live in the volume_api, and you just pass in the bdm?","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cb209a8a341e45d6c8d57d92e2ef8aeb5f5fa49f","unresolved":false,"context_lines":[{"line_number":2149,"context_line":"        for bdm in bdms:"},{"line_number":2150,"context_line":"            if bdm.is_volume:"},{"line_number":2151,"context_line":"                try:"},{"line_number":2152,"context_line":"                    if bdm.attachment_id:"},{"line_number":2153,"context_line":"                        self.volume_api.attachment_delete(context,"},{"line_number":2154,"context_line":"                                                          bdm.attachment_id)"},{"line_number":2155,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_477a8724","line":2152,"in_reply_to":"dfeb2761_bb45f472","updated":"2017-03-31 11:04:05.000000000","message":"or the BDM I guess.","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cb209a8a341e45d6c8d57d92e2ef8aeb5f5fa49f","unresolved":false,"context_lines":[{"line_number":2170,"context_line":"                        self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":2171,"context_line":"                                               instance.uuid)"},{"line_number":2172,"context_line":""},{"line_number":2173,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":2174,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":2175,"context_line":"                except Exception as exc:"},{"line_number":2176,"context_line":"                    err_str \u003d _LW(\"Ignoring volume cleanup failure due to %s\")"},{"line_number":2177,"context_line":"                    LOG.warning(err_str, exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_4e706473","line":2174,"range":{"start_line":2173,"start_character":20,"end_line":2174,"end_character":70},"updated":"2017-03-31 11:04:05.000000000","message":"seriously, it feels like the BDM should do this inside its detach logic, so we don\u0027t forget this bit in one of the many possible code paths.","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ef3473fc0c6f65047671e7f82f9fd12035a2970d","unresolved":false,"context_lines":[{"line_number":2171,"context_line":"                                               instance.uuid)"},{"line_number":2172,"context_line":""},{"line_number":2173,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":2174,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":2175,"context_line":"                except Exception as exc:"},{"line_number":2176,"context_line":"                    err_str \u003d _LW(\"Ignoring volume cleanup failure due to %s\")"},{"line_number":2177,"context_line":"                    LOG.warning(err_str, exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_794ab055","line":2174,"in_reply_to":"dfeb2761_03046e14","updated":"2017-04-01 19:34:10.000000000","message":"@Lee: I looked into it, it looks fine to me, I added one comment to fix.\n\nIf we decide that\u0027s the direction, I can put this patch on top of that. But I wouldn\u0027t do that before we\u0027re having consensus as rebasing a chain owned by multiple people is a real pain. :(","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e5ef6769e340e04351ca080db4fa9d4ae1c0e1e3","unresolved":false,"context_lines":[{"line_number":2171,"context_line":"                                               instance.uuid)"},{"line_number":2172,"context_line":""},{"line_number":2173,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":2174,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":2175,"context_line":"                except Exception as exc:"},{"line_number":2176,"context_line":"                    err_str \u003d _LW(\"Ignoring volume cleanup failure due to %s\")"},{"line_number":2177,"context_line":"                    LOG.warning(err_str, exc, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_03046e14","line":2174,"in_reply_to":"dfeb2761_4e706473","updated":"2017-03-31 13:20:32.000000000","message":"I5f7fc75dd1fbb2eb01689fefad64d4c72649e352 is my throw away attempt at moving the detach and terminate_connection calls into the driver BDM. Thoughts on that approach verses doing this all int he volume_api would be appreciated if anyone has time.","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"1d071c931cffb812e4b13bd6ece092f17e6b948b","unresolved":false,"context_lines":[{"line_number":2160,"context_line":"                                                                 bdm.volume_id,"},{"line_number":2161,"context_line":"                                                                 connector)"},{"line_number":2162,"context_line":"                        else:"},{"line_number":2163,"context_line":"                            LOG.debug("},{"line_number":2164,"context_line":"                                \u0027Unable to find connector for volume %s, \u0027"},{"line_number":2165,"context_line":"                                \u0027not attempting terminate_connection.\u0027,"},{"line_number":2166,"context_line":"                                bdm.volume_id, instance\u003dinstance)"},{"line_number":2167,"context_line":"                        # Attempt to detach the volume. If there was no"},{"line_number":2168,"context_line":"                        # connection made in the first place this is just"},{"line_number":2169,"context_line":"                        # cleaning up the volume state in the Cinder DB."}],"source_content_type":"text/x-python","patch_set":5,"id":"bff0334d_cb42af3e","line":2166,"range":{"start_line":2163,"start_character":0,"end_line":2166,"end_character":65},"updated":"2017-04-10 12:18:24.000000000","message":"supernit - can\u0027t we squash this down to the original three lines?","commit_id":"2dd372e37c91cee27a559c50e7b69a9e525e2b5a"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a6e63f0e3877d71770c1cb8f8d9c3a149d5be508","unresolved":false,"context_lines":[{"line_number":2160,"context_line":"                                                                 bdm.volume_id,"},{"line_number":2161,"context_line":"                                                                 connector)"},{"line_number":2162,"context_line":"                        else:"},{"line_number":2163,"context_line":"                            LOG.debug("},{"line_number":2164,"context_line":"                                \u0027Unable to find connector for volume %s, \u0027"},{"line_number":2165,"context_line":"                                \u0027not attempting terminate_connection.\u0027,"},{"line_number":2166,"context_line":"                                bdm.volume_id, instance\u003dinstance)"},{"line_number":2167,"context_line":"                        # Attempt to detach the volume. If there was no"},{"line_number":2168,"context_line":"                        # connection made in the first place this is just"},{"line_number":2169,"context_line":"                        # cleaning up the volume state in the Cinder DB."}],"source_content_type":"text/x-python","patch_set":5,"id":"bff0334d_594183a8","line":2166,"range":{"start_line":2163,"start_character":0,"end_line":2166,"end_character":65},"in_reply_to":"bff0334d_cb42af3e","updated":"2017-04-12 11:26:13.000000000","message":"Done","commit_id":"2dd372e37c91cee27a559c50e7b69a9e525e2b5a"}],"nova/compute/manager.py":[{"author":{"_account_id":17814,"name":"fengzhr","email":"fengzhr@awcloud.com","username":"space"},"change_message_id":"d7a1b5882d192e5f4dbc68d8fd6b428d55effe61","unresolved":false,"context_lines":[{"line_number":5001,"context_line":"                # where we actually have two attaches at the same time."},{"line_number":5002,"context_line":""},{"line_number":5003,"context_line":"                if bdm.attachment_id:"},{"line_number":5004,"context_line":"                    self.volume_api.update_attachment(\"tbd\")"},{"line_number":5005,"context_line":"                    self.volume_api.attachment_update(context,"},{"line_number":5006,"context_line":"                                                      bdm.attachment_id,"},{"line_number":5007,"context_line":"                                                      None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffe62b97_5e42adac","line":5004,"range":{"start_line":5004,"start_character":36,"end_line":5004,"end_character":53},"updated":"2017-03-29 03:41:14.000000000","message":"Where is this api,please? I could not find it in nova/volume/cinder.py.","commit_id":"4c7a1b21b3cf2678d97a27be4c72ae4c9d656ba1"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"1d071c931cffb812e4b13bd6ece092f17e6b948b","unresolved":false,"context_lines":[{"line_number":2267,"context_line":"                    self.volume_api.terminate_connection(context,"},{"line_number":2268,"context_line":"                                                         bdm.volume_id,"},{"line_number":2269,"context_line":"                                                         connector)"},{"line_number":2270,"context_line":"                    self.volume_api.detach(context,"},{"line_number":2271,"context_line":"                                           bdm.volume_id,"},{"line_number":2272,"context_line":"                                           instance.uuid)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bff0334d_eb80d348","line":2272,"range":{"start_line":2270,"start_character":0,"end_line":2272,"end_character":57},"updated":"2017-04-10 12:18:24.000000000","message":"supernit - this should fit on 2 lines?","commit_id":"2dd372e37c91cee27a559c50e7b69a9e525e2b5a"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a6e63f0e3877d71770c1cb8f8d9c3a149d5be508","unresolved":false,"context_lines":[{"line_number":2267,"context_line":"                    self.volume_api.terminate_connection(context,"},{"line_number":2268,"context_line":"                                                         bdm.volume_id,"},{"line_number":2269,"context_line":"                                                         connector)"},{"line_number":2270,"context_line":"                    self.volume_api.detach(context,"},{"line_number":2271,"context_line":"                                           bdm.volume_id,"},{"line_number":2272,"context_line":"                                           instance.uuid)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"}],"source_content_type":"text/x-python","patch_set":5,"id":"bff0334d_592aa3da","line":2272,"range":{"start_line":2270,"start_character":0,"end_line":2272,"end_character":57},"in_reply_to":"bff0334d_eb80d348","updated":"2017-04-12 11:26:13.000000000","message":"Done","commit_id":"2dd372e37c91cee27a559c50e7b69a9e525e2b5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8cb234e8d62820aaa0faa62fcc340e89d15c67f5","unresolved":false,"context_lines":[{"line_number":5540,"context_line":""},{"line_number":5541,"context_line":"            # remove the volume connection without detaching from hypervisor"},{"line_number":5542,"context_line":"            # because the instance is not running anymore on the current host"},{"line_number":5543,"context_line":"            if bdm.is_volume:"},{"line_number":5544,"context_line":"                if bdm.attachment_id:"},{"line_number":5545,"context_line":"                    self.volume_api.attachment_update(ctxt,"},{"line_number":5546,"context_line":"                                                      bdm.attachment_id,"},{"line_number":5547,"context_line":"                                                      None)"},{"line_number":5548,"context_line":"                else:"},{"line_number":5549,"context_line":"                    self.volume_api.terminate_connection(ctxt, bdm.volume_id,"},{"line_number":5550,"context_line":"                                                         connector)"},{"line_number":5551,"context_line":""},{"line_number":5552,"context_line":"        # Releasing vlan."},{"line_number":5553,"context_line":"        # (not necessary in current implementation?)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ff52f3f_048ebd77","line":5550,"range":{"start_line":5543,"start_character":12,"end_line":5550,"end_character":67},"updated":"2017-04-13 16:11:25.000000000","message":"So at this point we have this super fun pattern of:\n\nif bdm.is_volume:\n  if bdm.attachment_id:\n    attachment_update (new flow)\n  else:\n    terminate_connection (old flow)\n\nThat\u0027s copied in several places. Can we please just move that into a private method?","commit_id":"f61956cf74fb333195d88ec97491a514f1a4cb8c"}],"nova/tests/unit/virt/test_block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def test_call_wait_no_delete_volume(self):"},{"line_number":388,"context_line":"        self._test_call_wait_func(False)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def test_bdm_detach(self):"},{"line_number":391,"context_line":"        attachment_id \u003d uuids.attachment"},{"line_number":392,"context_line":"        driver_bdm \u003d self.driver_classes[\u0027volume\u0027](self.volume_bdm)"},{"line_number":393,"context_line":"        driver_bdm[\u0027attachment_id\u0027] \u003d attachment_id"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_b837c64d","line":390,"range":{"start_line":390,"start_character":8,"end_line":390,"end_character":23},"updated":"2017-04-19 18:39:11.000000000","message":"Can we name this something else to indicate it\u0027s for the new flow? Maybe test_volume_detach_delete_attachment or something.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":387,"context_line":"    def test_call_wait_no_delete_volume(self):"},{"line_number":388,"context_line":"        self._test_call_wait_func(False)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"    def test_bdm_detach(self):"},{"line_number":391,"context_line":"        attachment_id \u003d uuids.attachment"},{"line_number":392,"context_line":"        driver_bdm \u003d self.driver_classes[\u0027volume\u0027](self.volume_bdm)"},{"line_number":393,"context_line":"        driver_bdm[\u0027attachment_id\u0027] \u003d attachment_id"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_cba87a8d","line":390,"range":{"start_line":390,"start_character":8,"end_line":390,"end_character":23},"in_reply_to":"7ffa3b31_b837c64d","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":981,"context_line":"                                                   self.virt_driver)"},{"line_number":982,"context_line":"                self.assertEqual(\u0027fake-volume-id-2\u0027, test_bdm.volume_id)"},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    def test_convert_block_devices(self):"},{"line_number":985,"context_line":"        bdms \u003d objects.BlockDeviceMappingList("},{"line_number":986,"context_line":"                objects\u003d[self.volume_bdm, self.ephemeral_bdm])"},{"line_number":987,"context_line":"        converted \u003d driver_block_device._convert_block_devices("},{"line_number":988,"context_line":"            self.driver_classes[\u0027volume\u0027], bdms)"},{"line_number":989,"context_line":"        self.assertEqual([self.volume_driver_bdm], converted)"},{"line_number":990,"context_line":""},{"line_number":991,"context_line":"    def test_convert_all_volumes(self):"},{"line_number":992,"context_line":"        converted \u003d driver_block_device.convert_all_volumes()"},{"line_number":993,"context_line":"        self.assertEqual([], converted)"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"        converted \u003d driver_block_device.convert_all_volumes("},{"line_number":996,"context_line":"            self.volume_bdm, self.ephemeral_bdm, self.image_bdm,"},{"line_number":997,"context_line":"            self.blank_bdm, self.snapshot_bdm)"},{"line_number":998,"context_line":"        self.assertEqual([self.volume_driver_bdm,"},{"line_number":999,"context_line":"                          self.image_driver_bdm,"},{"line_number":1000,"context_line":"                          self.blank_driver_bdm,"},{"line_number":1001,"context_line":"                          self.snapshot_driver_bdm], converted)"},{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"    def test_convert_volume(self):"},{"line_number":1004,"context_line":"        self.assertIsNone(driver_block_device.convert_volume(self.swap_bdm))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_1816baa9","line":1001,"range":{"start_line":984,"start_character":4,"end_line":1001,"end_character":63},"updated":"2017-04-19 18:39:11.000000000","message":"Let\u0027s undo these changes since they aren\u0027t related.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":981,"context_line":"                                                   self.virt_driver)"},{"line_number":982,"context_line":"                self.assertEqual(\u0027fake-volume-id-2\u0027, test_bdm.volume_id)"},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    def test_convert_block_devices(self):"},{"line_number":985,"context_line":"        bdms \u003d objects.BlockDeviceMappingList("},{"line_number":986,"context_line":"                objects\u003d[self.volume_bdm, self.ephemeral_bdm])"},{"line_number":987,"context_line":"        converted \u003d driver_block_device._convert_block_devices("},{"line_number":988,"context_line":"            self.driver_classes[\u0027volume\u0027], bdms)"},{"line_number":989,"context_line":"        self.assertEqual([self.volume_driver_bdm], converted)"},{"line_number":990,"context_line":""},{"line_number":991,"context_line":"    def test_convert_all_volumes(self):"},{"line_number":992,"context_line":"        converted \u003d driver_block_device.convert_all_volumes()"},{"line_number":993,"context_line":"        self.assertEqual([], converted)"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"        converted \u003d driver_block_device.convert_all_volumes("},{"line_number":996,"context_line":"            self.volume_bdm, self.ephemeral_bdm, self.image_bdm,"},{"line_number":997,"context_line":"            self.blank_bdm, self.snapshot_bdm)"},{"line_number":998,"context_line":"        self.assertEqual([self.volume_driver_bdm,"},{"line_number":999,"context_line":"                          self.image_driver_bdm,"},{"line_number":1000,"context_line":"                          self.blank_driver_bdm,"},{"line_number":1001,"context_line":"                          self.snapshot_driver_bdm], converted)"},{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"    def test_convert_volume(self):"},{"line_number":1004,"context_line":"        self.assertIsNone(driver_block_device.convert_volume(self.swap_bdm))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_8e4cc042","line":1001,"range":{"start_line":984,"start_character":4,"end_line":1001,"end_character":63},"in_reply_to":"7ffa3b31_1816baa9","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"}],"nova/tests/unit/volume/test_cinder.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                                                    mode\u003d\u0027ro\u0027)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":284,"context_line":"    def test_attachment_delete(self, mock_cinderclient):"},{"line_number":285,"context_line":"        mock_attachments \u003d mock.MagicMock()"},{"line_number":286,"context_line":"        mock_cinderclient.return_value \u003d \\"},{"line_number":287,"context_line":"            mock.MagicMock(attachments\u003dmock_attachments)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_ba48d686","line":284,"updated":"2017-04-19 23:04:01.000000000","message":"Let\u0027s also have a test case for an error case where the delete method raises some cinderclient exception and we translate it, like the VolumeAttachmentNotFound (you have to add that yet).","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                                                    mode\u003d\u0027ro\u0027)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":284,"context_line":"    def test_attachment_delete(self, mock_cinderclient):"},{"line_number":285,"context_line":"        mock_attachments \u003d mock.MagicMock()"},{"line_number":286,"context_line":"        mock_cinderclient.return_value \u003d \\"},{"line_number":287,"context_line":"            mock.MagicMock(attachments\u003dmock_attachments)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_47a1e045","line":284,"in_reply_to":"7ffa3b31_ba48d686","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":286,"context_line":"        mock_cinderclient.return_value \u003d \\"},{"line_number":287,"context_line":"            mock.MagicMock(attachments\u003dmock_attachments)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        self.api.attachment_delete(self.ctx, \u0027id1\u0027)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        mock_cinderclient.assert_called_with(self.ctx)"},{"line_number":292,"context_line":"        mock_attachments.delete.assert_called_with(\u0027id1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_1a4eaa96","line":289,"range":{"start_line":289,"start_character":46,"end_line":289,"end_character":49},"updated":"2017-04-19 23:04:01.000000000","message":"This would be a uuid, so let\u0027s use the uuidsentinel and do something like uuids.attachment_id here.","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":286,"context_line":"        mock_cinderclient.return_value \u003d \\"},{"line_number":287,"context_line":"            mock.MagicMock(attachments\u003dmock_attachments)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        self.api.attachment_delete(self.ctx, \u0027id1\u0027)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        mock_cinderclient.assert_called_with(self.ctx)"},{"line_number":292,"context_line":"        mock_attachments.delete.assert_called_with(\u0027id1\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_cceab7d6","line":289,"range":{"start_line":289,"start_character":46,"end_line":289,"end_character":49},"in_reply_to":"7ffa3b31_1a4eaa96","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        self.api.attachment_delete(self.ctx, \u0027id1\u0027)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        mock_cinderclient.assert_called_with(self.ctx)"},{"line_number":292,"context_line":"        mock_attachments.delete.assert_called_with(\u0027id1\u0027)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":295,"context_line":"    def test_detach(self, mock_cinderclient):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_da43a26b","line":292,"range":{"start_line":292,"start_character":32,"end_line":292,"end_character":50},"updated":"2017-04-19 23:04:01.000000000","message":"Please use assert_called_once_with.","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        self.api.attachment_delete(self.ctx, \u0027id1\u0027)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"        mock_cinderclient.assert_called_with(self.ctx)"},{"line_number":292,"context_line":"        mock_attachments.delete.assert_called_with(\u0027id1\u0027)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":295,"context_line":"    def test_detach(self, mock_cinderclient):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_acbd2bd9","line":292,"range":{"start_line":292,"start_character":32,"end_line":292,"end_character":50},"in_reply_to":"7ffa3b31_da43a26b","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"}],"nova/virt/block_device.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"15aa46c9283631e5fea5268ace36f6478d48afb1","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                self._bdm_obj.connection_info)"},{"line_number":253,"context_line":"        except TypeError:"},{"line_number":254,"context_line":"            self[\u0027connection_info\u0027] \u003d None"},{"line_number":255,"context_line":"        if (self._bdm_obj.connection_info and"},{"line_number":256,"context_line":"            self._bdm_obj.connection_info !\u003d \u0027null\u0027):"},{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                self[\u0027attachment_id\u0027] \u003d \\"},{"line_number":259,"context_line":"                    jsonutils.loads("},{"line_number":260,"context_line":"                        self._bdm_obj.connection_info)[\u0027attachment_id\u0027]"},{"line_number":261,"context_line":"            except KeyError:"},{"line_number":262,"context_line":"                self[\u0027attachment_id\u0027] \u003d None"},{"line_number":263,"context_line":"        else:"},{"line_number":264,"context_line":"            self[\u0027attachment_id\u0027] \u003d None"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def _preserve_multipath_id(self, connection_info):"},{"line_number":267,"context_line":"        if self[\u0027connection_info\u0027] and \u0027data\u0027 in self[\u0027connection_info\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_0e601cce","line":264,"range":{"start_line":255,"start_character":0,"end_line":264,"end_character":40},"updated":"2017-03-31 09:36:29.000000000","message":"Surely we just read the attachment_id from here:\nhttps://github.com/openstack/nova/blob/master/nova/objects/block_device.py#L88","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"e5ef6769e340e04351ca080db4fa9d4ae1c0e1e3","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            except KeyError:"},{"line_number":262,"context_line":"                self[\u0027attachment_id\u0027] \u003d None"},{"line_number":263,"context_line":"        else:"},{"line_number":264,"context_line":"            self[\u0027attachment_id\u0027] \u003d None"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def _preserve_multipath_id(self, connection_info):"},{"line_number":267,"context_line":"        if self[\u0027connection_info\u0027] and \u0027data\u0027 in self[\u0027connection_info\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_ddfe6804","line":264,"in_reply_to":"dfeb2761_0e601cce","updated":"2017-03-31 13:20:32.000000000","message":"Yup, I don\u0027t understand why we would want to adjust this here at all.","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"2cb8cdfef3e1a6f60100c62462aecfa69c16e957","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            except KeyError:"},{"line_number":262,"context_line":"                self[\u0027attachment_id\u0027] \u003d None"},{"line_number":263,"context_line":"        else:"},{"line_number":264,"context_line":"            self[\u0027attachment_id\u0027] \u003d None"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def _preserve_multipath_id(self, connection_info):"},{"line_number":267,"context_line":"        if self[\u0027connection_info\u0027] and \u0027data\u0027 in self[\u0027connection_info\u0027]:"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfeb2761_5c66d0ef","line":264,"in_reply_to":"dfeb2761_ddfe6804","updated":"2017-03-31 16:58:33.000000000","message":"Sorry, that was me, it\u0027s not my favorite part of the code obviously... Will fix it.","commit_id":"4dd1ed1fa8c7b9cca76338283b67afba67e9a6d6"}],"nova/volume/cinder.py":[{"author":{"_account_id":20223,"name":"zhaolihui","email":"zhaolh@awcloud.com","username":"zhaolihui"},"change_message_id":"36b4b41da97b2996dc8835a8f4a90c5ec84cde68","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":502,"context_line":"        except cinder_exception.ClientException:"},{"line_number":503,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":504,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment\u0027),"},{"line_number":505,"context_line":"                          resource\u003d{\u0027type\u0027: \u0027attachment\u0027,"},{"line_number":506,"context_line":"                                    \u0027id\u0027: attachment_id})"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffe62b97_bbce927f","line":504,"range":{"start_line":504,"start_character":31,"end_line":504,"end_character":70},"updated":"2017-03-28 10:29:04.000000000","message":"\"Delete attachment failed for attachment\" ?\nMaybe \"Delete attachment failed for \" ?","commit_id":"4c7a1b21b3cf2678d97a27be4c72ae4c9d656ba1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    return wrapper"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"def translate_volume_exception(method):"},{"line_number":195,"context_line":"    \"\"\"Transforms the exception for the volume but keeps its traceback intact."},{"line_number":196,"context_line":"    \"\"\""},{"line_number":197,"context_line":"    def wrapper(self, ctx, volume_id, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_d8e4d2e2","line":194,"range":{"start_line":194,"start_character":4,"end_line":194,"end_character":30},"updated":"2017-04-19 18:39:11.000000000","message":"This is probably the wrong thing to use for attachment API failures. Note how it will use VolumeNotFound if we get a 404 from Cinder in case the attachment is not found.\n\nI\u0027d suggest we write a similar decorator called translate_attachment_exception and use new exceptions that are appropriate for those errors, like a VolumeAttachmentNotFound error.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":482,"context_line":"        )"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    @translate_volume_exception"},{"line_number":485,"context_line":"    def attachment_update(self, context, attachment_id, connector):"},{"line_number":486,"context_line":"        try:"},{"line_number":487,"context_line":"            attachment_info \u003d cinderclient("},{"line_number":488,"context_line":"                context).attachments.update(attachment_id, connector)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_38997678","line":485,"updated":"2017-04-19 18:39:11.000000000","message":"This isn\u0027t used in this change. We should add it in when we actually need to use it.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":482,"context_line":"        )"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    @translate_volume_exception"},{"line_number":485,"context_line":"    def attachment_update(self, context, attachment_id, connector):"},{"line_number":486,"context_line":"        try:"},{"line_number":487,"context_line":"            attachment_info \u003d cinderclient("},{"line_number":488,"context_line":"                context).attachments.update(attachment_id, connector)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_eb7c5684","line":485,"in_reply_to":"7ffa3b31_38997678","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        return attachment_info"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    @translate_volume_exception"},{"line_number":501,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":502,"context_line":"        try:"},{"line_number":503,"context_line":"            cinderclient("},{"line_number":504,"context_line":"                context).attachments.delete(attachment_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_f890ae4c","line":501,"updated":"2017-04-19 18:39:11.000000000","message":"You need a direct unit test for this.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        return attachment_info"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    @translate_volume_exception"},{"line_number":501,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":502,"context_line":"        try:"},{"line_number":503,"context_line":"            cinderclient("},{"line_number":504,"context_line":"                context).attachments.delete(attachment_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_ee3d848f","line":501,"in_reply_to":"7ffa3b31_f890ae4c","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"26563d389221809523c85a1ebab3be51b0d7a9fe","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        return attachment_info"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    @translate_volume_exception"},{"line_number":501,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":502,"context_line":"        try:"},{"line_number":503,"context_line":"            cinderclient("},{"line_number":504,"context_line":"                context).attachments.delete(attachment_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_9829aae7","line":501,"in_reply_to":"7ffa3b31_f890ae4c","updated":"2017-04-19 18:39:54.000000000","message":"In here:\n\nhttps://github.com/openstack/nova/blob/master/nova/tests/unit/volume/test_cinder.py","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":504,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":505,"context_line":"        except cinder_exception.ClientException:"},{"line_number":506,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":507,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment\u0027),"},{"line_number":508,"context_line":"                          resource\u003d{\u0027type\u0027: \u0027attachment\u0027,"},{"line_number":509,"context_line":"                                    \u0027id\u0027: attachment_id})"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_18ba3ac0","line":507,"range":{"start_line":507,"start_character":31,"end_line":507,"end_character":70},"updated":"2017-04-19 18:39:11.000000000","message":"Put the error and the attachment_id in here for context. I don\u0027t think LOG.error will log the original exception, only LOG.exception does that.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":504,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":505,"context_line":"        except cinder_exception.ClientException:"},{"line_number":506,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":507,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment\u0027),"},{"line_number":508,"context_line":"                          resource\u003d{\u0027type\u0027: \u0027attachment\u0027,"},{"line_number":509,"context_line":"                                    \u0027id\u0027: attachment_id})"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_ebd9f656","line":507,"range":{"start_line":507,"start_character":31,"end_line":507,"end_character":70},"in_reply_to":"7ffa3b31_18ba3ac0","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2d5631aea22ffb783e9fd44c4e67f4b002069e80","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        except cinder_exception.ClientException:"},{"line_number":506,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":507,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment\u0027),"},{"line_number":508,"context_line":"                          resource\u003d{\u0027type\u0027: \u0027attachment\u0027,"},{"line_number":509,"context_line":"                                    \u0027id\u0027: attachment_id})"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_98a40aa8","line":509,"range":{"start_line":508,"start_character":26,"end_line":509,"end_character":56},"updated":"2017-04-19 18:39:11.000000000","message":"This isn\u0027t something we use in logging in nova.","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"b2fe5e8bd831b4d178b31144d33f1b0dd0403f54","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        except cinder_exception.ClientException:"},{"line_number":506,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":507,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment\u0027),"},{"line_number":508,"context_line":"                          resource\u003d{\u0027type\u0027: \u0027attachment\u0027,"},{"line_number":509,"context_line":"                                    \u0027id\u0027: attachment_id})"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ffa3b31_0bd5421c","line":509,"range":{"start_line":508,"start_character":26,"end_line":509,"end_character":56},"in_reply_to":"7ffa3b31_98a40aa8","updated":"2017-04-19 20:33:14.000000000","message":"Done","commit_id":"a6e6dd3229354834061a4da12f7461bc3917e4fb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":481,"context_line":"             \u0027progress\u0027: \u002790%\u0027}"},{"line_number":482,"context_line":"        )"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    @translate_volume_exception"},{"line_number":485,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":486,"context_line":"        try:"},{"line_number":487,"context_line":"            cinderclient("}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_fa377efe","line":484,"range":{"start_line":484,"start_character":5,"end_line":484,"end_character":31},"updated":"2017-04-19 23:04:01.000000000","message":"See my comment in patch set 9 about this, but we\u0027ll want a new decorator that\u0027s similar to this but is specific to volume attachments, and you\u0027ll probably need to add a VolumeAttachmentNotFound exception in nova.exceptions.","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":481,"context_line":"             \u0027progress\u0027: \u002790%\u0027}"},{"line_number":482,"context_line":"        )"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    @translate_volume_exception"},{"line_number":485,"context_line":"    def attachment_delete(self, context, attachment_id):"},{"line_number":486,"context_line":"        try:"},{"line_number":487,"context_line":"            cinderclient("}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_676a9ced","line":484,"range":{"start_line":484,"start_character":5,"end_line":484,"end_character":31},"in_reply_to":"7ffa3b31_fa377efe","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":489,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":490,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":491,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment \u0027"},{"line_number":492,"context_line":"                              \u0027%(id)s. Error: %(msg)s Code: %(code)s\u0027),"},{"line_number":493,"context_line":"                          {\u0027id\u0027: attachment_id,"},{"line_number":494,"context_line":"                           \u0027msg\u0027: six.text_type(ex),"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_9a263ace","line":491,"range":{"start_line":491,"start_character":26,"end_line":491,"end_character":29},"updated":"2017-04-19 23:04:01.000000000","message":"Drop the _LE marker, we don\u0027t use those anymore.","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":489,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":490,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":491,"context_line":"                LOG.error(_LE(\u0027Delete attachment failed for attachment \u0027"},{"line_number":492,"context_line":"                              \u0027%(id)s. Error: %(msg)s Code: %(code)s\u0027),"},{"line_number":493,"context_line":"                          {\u0027id\u0027: attachment_id,"},{"line_number":494,"context_line":"                           \u0027msg\u0027: six.text_type(ex),"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_c67a96b8","line":491,"range":{"start_line":491,"start_character":26,"end_line":491,"end_character":29},"in_reply_to":"7ffa3b31_9a263ace","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8ed6fd66d2480eea99ae005ec718455fea9350e3","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                              \u0027%(id)s. Error: %(msg)s Code: %(code)s\u0027),"},{"line_number":493,"context_line":"                          {\u0027id\u0027: attachment_id,"},{"line_number":494,"context_line":"                           \u0027msg\u0027: six.text_type(ex),"},{"line_number":495,"context_line":"                           \u0027code\u0027: ex.code})"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_5a2c32ab","line":495,"range":{"start_line":495,"start_character":35,"end_line":495,"end_character":42},"updated":"2017-04-19 23:04:01.000000000","message":"We should be careful about this, so maybe use getattr(ex, \u0027code\u0027, None).","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"09919c7e065407b5d7934eda5f3c8b260e976753","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                              \u0027%(id)s. Error: %(msg)s Code: %(code)s\u0027),"},{"line_number":493,"context_line":"                          {\u0027id\u0027: attachment_id,"},{"line_number":494,"context_line":"                           \u0027msg\u0027: six.text_type(ex),"},{"line_number":495,"context_line":"                           \u0027code\u0027: ex.code})"}],"source_content_type":"text/x-python","patch_set":10,"id":"7ffa3b31_0cc41f90","line":495,"range":{"start_line":495,"start_character":35,"end_line":495,"end_character":42},"in_reply_to":"7ffa3b31_5a2c32ab","updated":"2017-04-20 15:14:15.000000000","message":"Done","commit_id":"96a72ac1310787b7b6cf823d6adccb3ecc2c69a6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"10a5ce702eac5b39cc19391950b127c10c8deeac","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_63ef291e","line":323,"updated":"2017-04-20 17:06:20.000000000","message":"We call this method in both the old and the new flow, I believe that will not work.\n\nIn the old flow this gives us improved API experience for folks that are detaching a volume. If you call detach once, and call it again, the second call fails saying detach is in progress.\n\nIn the new flow, it seems we will have to track this in the BDM? I am not sure. That BDM update would have to be made atomic compare and swap type of thing somehow.","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5402a7f68b0c3003352f81041fdfa3eeb4cbc0ed","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_63426dad","line":323,"in_reply_to":"7ffa3b31_4020a048","updated":"2017-04-21 14:05:45.000000000","message":"My problem is it being used in the API layer when we originally said we shouldn\u0027t call begin_detaching in the new flow.\n\nSeems it should work fine for now, so lets do it.","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b2c7382dcf6deb34afea8a37b0c0ef9c064f66e0","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_c69a6fb7","line":323,"in_reply_to":"7ffa3b31_63426dad","updated":"2017-04-21 14:24:09.000000000","message":"Today begin_detaching just works on the volume, so if you had multiple attachments and called begin_detaching, you\u0027d have volume status changes like:\n\nin-use \u003e detaching \u003e in-use\n\nWhich is confusing. And means you can only detach one attachment at a time.\n\nWhat we\u0027ll probably need for the new flows at some point is a begin_detaching action on the attachments API in Cinder, which would only affect the volume status when the last attachment is detaching, i.e.:\n\n2 attachments, both currently attached, volume status is in-use\n\n1. begin_detaching(attachment1), volume status is still in-use because attachment2 is \u0027attached\u0027 status; compute deletes attachment1, volume status is unchanged (in-use).\n\n2. begin_detaching(attachment2), volume status changes to \u0027detaching\u0027 since the last attachment is now \u0027detaching\u0027; compute deletes attachment2, volume status changes to \u0027available\u0027.\n\nI\u0027ll amend the spec with this.","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dc95981ddf3bf99ae5c3cfd901bbf306cc8d1ec","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_be6aea7d","line":323,"in_reply_to":"7ffa3b31_63ef291e","updated":"2017-04-20 17:48:14.000000000","message":"I\u0027m not sure why this is a concern right now. This is being used in the API to change the volume status from in-use to \u0027detaching\u0027. Somehow that helps with races for concurrent detaches, I guess just to kick the first one out as the volume is already being detached from the first request that gets in. Ultimately when we get down into the compute to do the actual terminate_connection and detach calls, that\u0027s where we care about deleting the attachment to change the volume status from \u0027detaching\u0027 to \u0027available\u0027.","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"627571a05bde82ebaadf123d61580e1ffb84f192","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_4020a048","line":323,"in_reply_to":"7ffa3b31_be6aea7d","updated":"2017-04-20 18:27:12.000000000","message":"Agree with Matt on this. It is used in the API layer, which means that we have the early fail in case multiple attempts to detach are happening at the same time. So by the time we get to decide whether we want to detach with the old or new flow it should be all sorted out.\n\nSo I would say there is no direct connections between those two in this sense.","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1b0710f758fb52797dad761075f860ca9680a38","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        cinderclient(context).volumes.unreserve(volume_id)"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @translate_volume_exception"},{"line_number":323,"context_line":"    def begin_detaching(self, context, volume_id):"},{"line_number":324,"context_line":"        cinderclient(context).volumes.begin_detaching(volume_id)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"5ff73747_35da1be9","line":323,"in_reply_to":"7ffa3b31_c69a6fb7","updated":"2017-04-23 22:33:36.000000000","message":"Here is the spec update: https://review.openstack.org/#/c/459134/","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"acc9ab93379aa53c5508ec7c716afc0507c13efc","unresolved":false,"context_lines":[{"line_number":501,"context_line":"                context).attachments.delete(attachment_id)"},{"line_number":502,"context_line":"        except cinder_exception.ClientException as ex:"},{"line_number":503,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":504,"context_line":"                LOG.error((\u0027Delete attachment failed for attachment \u0027"},{"line_number":505,"context_line":"                           \u0027%(id)s. Error: %(msg)s Code: %(code)s\u0027),"},{"line_number":506,"context_line":"                          {\u0027id\u0027: attachment_id,"},{"line_number":507,"context_line":"                           \u0027msg\u0027: six.text_type(ex),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ffa3b31_af73da15","line":504,"range":{"start_line":504,"start_character":26,"end_line":504,"end_character":27},"updated":"2017-04-20 15:47:40.000000000","message":"nit: you don\u0027t technically need the inner ( ) since you\u0027re already in LOG.error().","commit_id":"39e2760f3599497cd2cc76e265800a424c356a4b"}]}
