)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"692d6d605698248e74b6fcde95f55df6f168c419","unresolved":false,"context_lines":[{"line_number":2271,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2272,"context_line":"                                           instance.uuid)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":"            except exception.VolumeAttachmentNotFound as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring VolumeAttachmentNotFound: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except exception.DiskNotFound as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_1d5bd32e","line":2274,"updated":"2017-04-21 20:12:45.000000000","message":"I\u0027m not crazy about all these specific catches here. Are they really needed? Can this all be squashed down to just \n\nexcept Exception as exc \n  LOG.warning(","commit_id":"cea0ca3a803eb2cee5b71260c272db24c0bdf551"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"d14fe4d05a1f6892fe6b6adc8b3f87e980dc19bf","unresolved":false,"context_lines":[{"line_number":2271,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2272,"context_line":"                                           instance.uuid)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":"            except exception.VolumeAttachmentNotFound as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring VolumeAttachmentNotFound: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except exception.DiskNotFound as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_f9e312d8","line":2274,"in_reply_to":"5ff73747_1d5bd32e","updated":"2017-04-27 05:01:22.000000000","message":"As the log levels are different for the different exceptions that explains why we have them listed separately. If we could decide on one log level then we could squash as you suggested.","commit_id":"cea0ca3a803eb2cee5b71260c272db24c0bdf551"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"be43dc3db4b3580a3592bd034d197ab963b38f0f","unresolved":false,"context_lines":[{"line_number":2271,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2272,"context_line":"                                           instance.uuid)"},{"line_number":2273,"context_line":""},{"line_number":2274,"context_line":"            except exception.VolumeAttachmentNotFound as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring VolumeAttachmentNotFound: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except exception.DiskNotFound as exc:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ff73747_b4b21a48","line":2274,"in_reply_to":"5ff73747_f9e312d8","updated":"2017-04-27 16:31:47.000000000","message":"So we can surely compress into a debug and warning.\n\nThe idea here is this:\nhttp://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html\n\nBasically, when we fail because the thing is already detached, it doesn\u0027t matter. That might have happened if we are re-trying the delete of an instance.\n\nIf we fail for some crazy different reason, we should tell operators to work out what went wrong and maybe do some tidy up somewhere. We ignore the error as we don\u0027t want to put the instance into an error state.","commit_id":"cea0ca3a803eb2cee5b71260c272db24c0bdf551"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fccb3202798448f84979709f60597e92adf9afaa","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_eb209d9d","line":2273,"updated":"2017-04-28 13:25:13.000000000","message":"Nit: two changes in one here, so its a bit harder to review that we sometimes allow, but I like the tidy up, so I am fine with it.","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"4d844a9e412ffc06d545995d8883172410620b77","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_3d348292","line":2273,"in_reply_to":"5ff73747_eb209d9d","updated":"2017-04-28 18:38:33.000000000","message":"i\u0027d usually agree except that this change is adding a new exception to the list so it seemed appropriate to shorten the set of exceptions instead of expanding it.","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fccb3202798448f84979709f60597e92adf9afaa","unresolved":false,"context_lines":[{"line_number":3934,"context_line":"        for bdm in bdms:"},{"line_number":3935,"context_line":"            if bdm.is_volume:"},{"line_number":3936,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":3937,"context_line":"                                                     bdm.volume_id,"},{"line_number":3938,"context_line":"                                                     connector)"},{"line_number":3939,"context_line":""},{"line_number":3940,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_4b2f9187","line":3937,"updated":"2017-04-28 13:25:13.000000000","message":"Nit: shouldn\u0027t do unrelated whitespace changes in here.","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"4d844a9e412ffc06d545995d8883172410620b77","unresolved":false,"context_lines":[{"line_number":3934,"context_line":"        for bdm in bdms:"},{"line_number":3935,"context_line":"            if bdm.is_volume:"},{"line_number":3936,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":3937,"context_line":"                                                     bdm.volume_id,"},{"line_number":3938,"context_line":"                                                     connector)"},{"line_number":3939,"context_line":""},{"line_number":3940,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_8706a51f","line":3937,"in_reply_to":"5ff73747_4b2f9187","updated":"2017-04-28 18:38:33.000000000","message":"Done","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4259633cc34fdd3fc6e981cf48608ced13c3636","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_3fb55ace","line":2273,"range":{"start_line":2273,"start_character":30,"end_line":2273,"end_character":54},"updated":"2017-05-02 16:19:05.000000000","message":"Sorry I missed this before, we should really add a unit test to prove we handle this new exception correctly.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"9f0270504d46dd4ec1f4229644c8511088a90c6c","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_ceba41e0","line":2273,"range":{"start_line":2273,"start_character":30,"end_line":2273,"end_character":54},"in_reply_to":"5ff73747_3fb55ace","updated":"2017-05-02 20:00:46.000000000","message":"Done","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"80dcc65a92693a1de805f779b59b5742edebac05","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except Exception as exc:"},{"line_number":2278,"context_line":"                LOG.warning(\u0027Ignoring exception for volume %(volume_id)s: \u0027"},{"line_number":2279,"context_line":"                            \u0027%(exc)s\u0027,"},{"line_number":2280,"context_line":"                            {\u0027exc\u0027: exc, \u0027volume_id\u0027: bdm.volume_id},"},{"line_number":2281,"context_line":"                            instance\u003dinstance)"},{"line_number":2282,"context_line":"        if vol_bdms:"},{"line_number":2283,"context_line":"            LOG.info(_LI(\u0027Took %(time).2f seconds to detach %(num)s volumes \u0027"},{"line_number":2284,"context_line":"                         \u0027for instance.\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_4e24ea0d","line":2281,"range":{"start_line":2273,"start_character":12,"end_line":2281,"end_character":46},"updated":"2017-05-04 13:54:58.000000000","message":"This is an unrelated change, can we please do this either before or after the patch to use the new cinder API?","commit_id":"685e51664f220278effa6f601e4d89c4ebe39e16"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"c05f752653917814e3621ef3769462f7e7b18290","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except Exception as exc:"},{"line_number":2278,"context_line":"                LOG.warning(\u0027Ignoring exception for volume %(volume_id)s: \u0027"},{"line_number":2279,"context_line":"                            \u0027%(exc)s\u0027,"},{"line_number":2280,"context_line":"                            {\u0027exc\u0027: exc, \u0027volume_id\u0027: bdm.volume_id},"},{"line_number":2281,"context_line":"                            instance\u003dinstance)"},{"line_number":2282,"context_line":"        if vol_bdms:"},{"line_number":2283,"context_line":"            LOG.info(_LI(\u0027Took %(time).2f seconds to detach %(num)s volumes \u0027"},{"line_number":2284,"context_line":"                         \u0027for instance.\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_5a55c04f","line":2281,"range":{"start_line":2273,"start_character":12,"end_line":2281,"end_character":46},"in_reply_to":"3f044301_4e24ea0d","updated":"2017-05-04 17:03:38.000000000","message":"I thought this was related since I already needed to add a new exception (VolumeAttachmentNotFound) and felt that instead of adding to this list of exceptions, I should consolidate them into something simpler. But if you\u0027d like them separate, I will just add the new exception to the list.","commit_id":"685e51664f220278effa6f601e4d89c4ebe39e16"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c806bc2c8cf71eb3118b04decd5ad3a7b34795b7","unresolved":false,"context_lines":[{"line_number":2270,"context_line":"                    self.volume_api.detach(context, bdm.volume_id,"},{"line_number":2271,"context_line":"                                           instance.uuid)"},{"line_number":2272,"context_line":""},{"line_number":2273,"context_line":"            except (exception.VolumeAttachmentNotFound, exception.DiskNotFound,"},{"line_number":2274,"context_line":"                    exception.VolumeNotFound) as exc:"},{"line_number":2275,"context_line":"                LOG.debug(\u0027Ignoring exception: %s\u0027, exc,"},{"line_number":2276,"context_line":"                          instance\u003dinstance)"},{"line_number":2277,"context_line":"            except Exception as exc:"},{"line_number":2278,"context_line":"                LOG.warning(\u0027Ignoring exception for volume %(volume_id)s: \u0027"},{"line_number":2279,"context_line":"                            \u0027%(exc)s\u0027,"},{"line_number":2280,"context_line":"                            {\u0027exc\u0027: exc, \u0027volume_id\u0027: bdm.volume_id},"},{"line_number":2281,"context_line":"                            instance\u003dinstance)"},{"line_number":2282,"context_line":"        if vol_bdms:"},{"line_number":2283,"context_line":"            LOG.info(_LI(\u0027Took %(time).2f seconds to detach %(num)s volumes \u0027"},{"line_number":2284,"context_line":"                         \u0027for instance.\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_5ea34a9f","line":2281,"range":{"start_line":2273,"start_character":12,"end_line":2281,"end_character":46},"in_reply_to":"3f044301_5a55c04f","updated":"2017-05-05 20:46:19.000000000","message":"It\u0027s best to keep changes as small and focused as possible. The better way to handle this would be to make your refactor/consolidation change in a patch before this one, which doesn\u0027t change anything else, and then in this change you just need to add your new exception to the proper list.","commit_id":"685e51664f220278effa6f601e4d89c4ebe39e16"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fccb3202798448f84979709f60597e92adf9afaa","unresolved":false,"context_lines":[{"line_number":10205,"context_line":"                  \u0027destination_type\u0027: \u0027volume\u0027,"},{"line_number":10206,"context_line":"                  \u0027attachment_id\u0027: attachment_id"},{"line_number":10207,"context_line":"                  }"},{"line_number":10208,"context_line":"        db.block_device_mapping_create(admin, values)"},{"line_number":10209,"context_line":""},{"line_number":10210,"context_line":"        mock_elevated.return_value \u003d admin"},{"line_number":10211,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":10212,"context_line":"                admin, instance[\u0027uuid\u0027])"},{"line_number":10213,"context_line":""},{"line_number":10214,"context_line":"        self.compute.terminate_instance(admin, instance, bdms, [])"},{"line_number":10215,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_eb6e5dc7","line":10212,"range":{"start_line":10208,"start_character":0,"end_line":10212,"end_character":40},"updated":"2017-04-28 13:25:13.000000000","message":"I don\u0027t really like the use of the database here, it seems better for a unit test to just mock it out. They get really slow if we do this everywhere.","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"4d844a9e412ffc06d545995d8883172410620b77","unresolved":false,"context_lines":[{"line_number":10205,"context_line":"                  \u0027destination_type\u0027: \u0027volume\u0027,"},{"line_number":10206,"context_line":"                  \u0027attachment_id\u0027: attachment_id"},{"line_number":10207,"context_line":"                  }"},{"line_number":10208,"context_line":"        db.block_device_mapping_create(admin, values)"},{"line_number":10209,"context_line":""},{"line_number":10210,"context_line":"        mock_elevated.return_value \u003d admin"},{"line_number":10211,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":10212,"context_line":"                admin, instance[\u0027uuid\u0027])"},{"line_number":10213,"context_line":""},{"line_number":10214,"context_line":"        self.compute.terminate_instance(admin, instance, bdms, [])"},{"line_number":10215,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5ff73747_bd71b278","line":10212,"range":{"start_line":10208,"start_character":0,"end_line":10212,"end_character":40},"in_reply_to":"5ff73747_eb6e5dc7","updated":"2017-04-28 18:38:33.000000000","message":"Done","commit_id":"696a762b2bf2909629ff7126d4173db9c202881a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4259633cc34fdd3fc6e981cf48608ced13c3636","unresolved":false,"context_lines":[{"line_number":10186,"context_line":"            mock_detach.assert_called_once_with(mock.ANY, \u0027fake-id\u0027,"},{"line_number":10187,"context_line":"                                                instance.uuid, None)"},{"line_number":10188,"context_line":""},{"line_number":10189,"context_line":"    @mock.patch(\u0027nova.compute.manager.LOG\u0027)"},{"line_number":10190,"context_line":"    @mock.patch.object(context.RequestContext, \u0027elevated\u0027)"},{"line_number":10191,"context_line":"    @mock.patch.object(cinder.API, \u0027attachment_delete\u0027)"},{"line_number":10192,"context_line":"    @mock.patch.object(compute_manager.ComputeManager,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_ffd7f24e","line":10189,"updated":"2017-05-02 16:19:05.000000000","message":"Why did you mock this? I think this is likely to hide nasty bugs we would otherwise catch.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"9f0270504d46dd4ec1f4229644c8511088a90c6c","unresolved":false,"context_lines":[{"line_number":10186,"context_line":"            mock_detach.assert_called_once_with(mock.ANY, \u0027fake-id\u0027,"},{"line_number":10187,"context_line":"                                                instance.uuid, None)"},{"line_number":10188,"context_line":""},{"line_number":10189,"context_line":"    @mock.patch(\u0027nova.compute.manager.LOG\u0027)"},{"line_number":10190,"context_line":"    @mock.patch.object(context.RequestContext, \u0027elevated\u0027)"},{"line_number":10191,"context_line":"    @mock.patch.object(cinder.API, \u0027attachment_delete\u0027)"},{"line_number":10192,"context_line":"    @mock.patch.object(compute_manager.ComputeManager,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_700d51e7","line":10189,"in_reply_to":"5ff73747_ffd7f24e","updated":"2017-05-02 20:00:46.000000000","message":"I had seen it done in some other tests and thought it had been done to make tests faster. I\u0027ll unmock it.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4259633cc34fdd3fc6e981cf48608ced13c3636","unresolved":false,"context_lines":[{"line_number":10187,"context_line":"                                                instance.uuid, None)"},{"line_number":10188,"context_line":""},{"line_number":10189,"context_line":"    @mock.patch(\u0027nova.compute.manager.LOG\u0027)"},{"line_number":10190,"context_line":"    @mock.patch.object(context.RequestContext, \u0027elevated\u0027)"},{"line_number":10191,"context_line":"    @mock.patch.object(cinder.API, \u0027attachment_delete\u0027)"},{"line_number":10192,"context_line":"    @mock.patch.object(compute_manager.ComputeManager,"},{"line_number":10193,"context_line":"                       \u0027_get_instance_block_device_info\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_9fd0ee55","line":10190,"updated":"2017-05-02 16:19:05.000000000","message":"Nit: Not sure I like mocking this out, but I guess its so you can assert we pass the correct context.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"9f0270504d46dd4ec1f4229644c8511088a90c6c","unresolved":false,"context_lines":[{"line_number":10187,"context_line":"                                                instance.uuid, None)"},{"line_number":10188,"context_line":""},{"line_number":10189,"context_line":"    @mock.patch(\u0027nova.compute.manager.LOG\u0027)"},{"line_number":10190,"context_line":"    @mock.patch.object(context.RequestContext, \u0027elevated\u0027)"},{"line_number":10191,"context_line":"    @mock.patch.object(cinder.API, \u0027attachment_delete\u0027)"},{"line_number":10192,"context_line":"    @mock.patch.object(compute_manager.ComputeManager,"},{"line_number":10193,"context_line":"                       \u0027_get_instance_block_device_info\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_10904d4e","line":10190,"in_reply_to":"5ff73747_9fd0ee55","updated":"2017-05-02 20:00:46.000000000","message":"Yes, I needed to mock it because the volume_api.attachment_delete takes the context as an arg, and it was the only way to ensure that the test\u0027s assert_called_once_with can be provided with a deterministic value.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f4259633cc34fdd3fc6e981cf48608ced13c3636","unresolved":false,"context_lines":[{"line_number":10211,"context_line":""},{"line_number":10212,"context_line":"        mock_elevated.return_value \u003d admin"},{"line_number":10213,"context_line":""},{"line_number":10214,"context_line":"        bdms \u003d [objects.BlockDeviceMapping(**vol_bdm)]"},{"line_number":10215,"context_line":""},{"line_number":10216,"context_line":"        self.compute._shutdown_instance(admin, instance, bdms)"},{"line_number":10217,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_5fa9468e","line":10214,"range":{"start_line":10214,"start_character":43,"end_line":10214,"end_character":52},"updated":"2017-05-02 16:19:05.000000000","message":"Nit: why not just pass these as arguments here, rather than creating a separate dict? I guess its not a big deal either way.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"9f0270504d46dd4ec1f4229644c8511088a90c6c","unresolved":false,"context_lines":[{"line_number":10211,"context_line":""},{"line_number":10212,"context_line":"        mock_elevated.return_value \u003d admin"},{"line_number":10213,"context_line":""},{"line_number":10214,"context_line":"        bdms \u003d [objects.BlockDeviceMapping(**vol_bdm)]"},{"line_number":10215,"context_line":""},{"line_number":10216,"context_line":"        self.compute._shutdown_instance(admin, instance, bdms)"},{"line_number":10217,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5ff73747_908d7d33","line":10214,"range":{"start_line":10214,"start_character":43,"end_line":10214,"end_character":52},"in_reply_to":"5ff73747_5fa9468e","updated":"2017-05-02 20:00:46.000000000","message":"Again, it was a pattern I had seen in another test (test_terminate_deletes_all_bdms). I\u0027ll use one of the other patterns. \n\nI appreciate the feedback. It\u0027s um, interesting writing nova tests for the first time. There is a wide variety of patterns to choose from.","commit_id":"93a4c5bb56ad73d4c6aa6937b38c6a1a21c64640"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"80dcc65a92693a1de805f779b59b5742edebac05","unresolved":false,"context_lines":[{"line_number":10245,"context_line":"        # get last call to LOG.debug and verify args to debug log"},{"line_number":10246,"context_line":"        log_args \u003d mock_debug_log.call_args[0]"},{"line_number":10247,"context_line":"        self.assertIn(\u0027Ignoring exception\u0027, log_args[0])"},{"line_number":10248,"context_line":"        self.assertEqual(exception.VolumeAttachmentNotFound,"},{"line_number":10249,"context_line":"                         log_args[1].__class__)"},{"line_number":10250,"context_line":""},{"line_number":10251,"context_line":"    def test_terminate_with_volumes(self):"},{"line_number":10252,"context_line":"        # Make sure that volumes get detached during instance termination."}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_8eee7286","line":10249,"range":{"start_line":10248,"start_character":8,"end_line":10249,"end_character":47},"updated":"2017-05-04 13:54:58.000000000","message":"Ew, can we just use self.assertIsInstance(logs_args[1], exception.VolumeAttachmentNotFound) instead?\n\nOr just use the LoggingFixture and verify the message you expect is in the output like I do here:\n\nhttps://review.openstack.org/#/c/458958/2/nova/tests/unit/compute/test_compute.py","commit_id":"685e51664f220278effa6f601e4d89c4ebe39e16"},{"author":{"_account_id":17386,"name":"Steve Noyes","email":"steve.noyes@oracle.com","username":"ssn1ssn"},"change_message_id":"628509d3c9581b33dae770cee8a72989505caac3","unresolved":false,"context_lines":[{"line_number":10245,"context_line":"        # get last call to LOG.debug and verify args to debug log"},{"line_number":10246,"context_line":"        log_args \u003d mock_debug_log.call_args[0]"},{"line_number":10247,"context_line":"        self.assertIn(\u0027Ignoring exception\u0027, log_args[0])"},{"line_number":10248,"context_line":"        self.assertEqual(exception.VolumeAttachmentNotFound,"},{"line_number":10249,"context_line":"                         log_args[1].__class__)"},{"line_number":10250,"context_line":""},{"line_number":10251,"context_line":"    def test_terminate_with_volumes(self):"},{"line_number":10252,"context_line":"        # Make sure that volumes get detached during instance termination."}],"source_content_type":"text/x-python","patch_set":6,"id":"3f044301_94ab18d5","line":10249,"range":{"start_line":10248,"start_character":8,"end_line":10249,"end_character":47},"in_reply_to":"3f044301_8eee7286","updated":"2017-05-04 19:05:57.000000000","message":"The FakeLogger doesn\u0027t have debug level msgs in it; I\u0027ll use self.assertIsInstance- that is much better.","commit_id":"685e51664f220278effa6f601e4d89c4ebe39e16"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"07641079ea2b7ef4590f53d68bf617a496a45ec8","unresolved":false,"context_lines":[{"line_number":10257,"context_line":"        bdms \u003d [vol_bdm]"},{"line_number":10258,"context_line":""},{"line_number":10259,"context_line":"        mock_attach_delete.side_effect \u003d \\"},{"line_number":10260,"context_line":"            exception.VolumeAttachmentNotFound(attachment_id)"},{"line_number":10261,"context_line":""},{"line_number":10262,"context_line":"        self.compute._shutdown_instance(admin, instance, bdms)"},{"line_number":10263,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f044301_7e8606de","line":10260,"range":{"start_line":10260,"start_character":47,"end_line":10260,"end_character":60},"updated":"2017-05-05 20:58:52.000000000","message":"This would actually be a kwarg, otherwise it\u0027s overwriting the message. Not a huge deal for a test but it\u0027s not the correct way to raise exceptions in Nova.","commit_id":"f48191dfbddb618bbdcba71505dec3827664a154"}]}
