)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"https://review.openstack.org/#/c/85856/"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"cinder:"},{"line_number":36,"context_line":"https://review.openstack.org/#/c/85847/"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Change-Id: I3cdc49924acbdd21d1e6678a3bb4cf7de7f1db1a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a7e1126_853b2aeb","line":36,"updated":"2015-12-17 11:38:25.000000000","message":"Nit: true for all these patches, I really don\u0027t like us including all these links in there. Git will record the history better than including them like this.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":33,"context_line":"https://review.openstack.org/#/c/85856/"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"cinder:"},{"line_number":36,"context_line":"https://review.openstack.org/#/c/85847/"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Change-Id: I3cdc49924acbdd21d1e6678a3bb4cf7de7f1db1a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a7e1126_c43b5b37","line":36,"in_reply_to":"3a7e1126_853b2aeb","updated":"2015-12-17 18:35:10.000000000","message":"I will remove the REST API reference. I think the Cinder ones are good to have as those are quite old, so that can be hard to find.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"401a1c2729c2ac52ad20833be981c54cc597623b","unresolved":false,"context_lines":[{"line_number":16,"context_line":"attachments. The Nova API is not modified in this patch, it returns the data"},{"line_number":17,"context_line":"of the first attachment in the list."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"For more information on how Cinder handles the attachments see"},{"line_number":20,"context_line":"the reference to the Cinder and the Cinder client patches below."},{"line_number":21,"context_line":"Also for further details on volume attachment on Nova side please"},{"line_number":22,"context_line":"check the blueprint."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The API patch is part of a follow up spec that captures only the"},{"line_number":25,"context_line":"API changes in Nova."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"APIImpact This patch allows to attach a volume to multiple VM instances"},{"line_number":28,"context_line":"if the \u0027multiattach\u0027 flag on the volume is set to true."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Boot from existing volume is disabled, when \u0027destination_type\u0027 is set to"},{"line_number":31,"context_line":"volume and the volume enables multi-attach."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":64,"id":"da6ed579_8be9f21c","line":28,"range":{"start_line":19,"start_character":0,"end_line":28,"end_character":55},"updated":"2016-01-12 20:48:44.000000000","message":"This is all boilerplate and can probably be removed.","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":16,"context_line":"attachments. The Nova API is not modified in this patch, it returns the data"},{"line_number":17,"context_line":"of the first attachment in the list."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"For more information on how Cinder handles the attachments see"},{"line_number":20,"context_line":"the reference to the Cinder and the Cinder client patches below."},{"line_number":21,"context_line":"Also for further details on volume attachment on Nova side please"},{"line_number":22,"context_line":"check the blueprint."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The API patch is part of a follow up spec that captures only the"},{"line_number":25,"context_line":"API changes in Nova."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"APIImpact This patch allows to attach a volume to multiple VM instances"},{"line_number":28,"context_line":"if the \u0027multiattach\u0027 flag on the volume is set to true."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Boot from existing volume is disabled, when \u0027destination_type\u0027 is set to"},{"line_number":31,"context_line":"volume and the volume enables multi-attach."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":64,"id":"da6ed579_b1f46887","line":28,"range":{"start_line":19,"start_character":0,"end_line":28,"end_character":55},"in_reply_to":"da6ed579_8be9f21c","updated":"2016-01-12 22:18:32.000000000","message":"Done","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"401a1c2729c2ac52ad20833be981c54cc597623b","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Partially-implements: blueprint multi-attach-volume"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Related patches:"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"python-cinderclient:"},{"line_number":41,"context_line":"https://review.openstack.org/#/c/85856/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"cinder:"},{"line_number":44,"context_line":"https://review.openstack.org/#/c/85847/"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"Partial-Bug: #1528548"},{"line_number":47,"context_line":"Change-Id: I3cdc49924acbdd21d1e6678a3bb4cf7de7f1db1a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":64,"id":"da6ed579_6bf83ee6","line":44,"range":{"start_line":38,"start_character":0,"end_line":44,"end_character":39},"updated":"2016-01-12 20:48:44.000000000","message":"Can probably safely remove this.","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Partially-implements: blueprint multi-attach-volume"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"Related patches:"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"python-cinderclient:"},{"line_number":41,"context_line":"https://review.openstack.org/#/c/85856/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"cinder:"},{"line_number":44,"context_line":"https://review.openstack.org/#/c/85847/"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"Partial-Bug: #1528548"},{"line_number":47,"context_line":"Change-Id: I3cdc49924acbdd21d1e6678a3bb4cf7de7f1db1a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":64,"id":"da6ed579_112c5401","line":44,"range":{"start_line":38,"start_character":0,"end_line":44,"end_character":39},"in_reply_to":"da6ed579_6bf83ee6","updated":"2016-01-12 22:18:32.000000000","message":"Done","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Pass attachment_id to Cinder when detach a volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Cinder needs the attachment_id to properly identify which atachment"},{"line_number":10,"context_line":"of a volume to detach. This patch adapts the Cinder driver to pass"},{"line_number":11,"context_line":"the required information. The attachment_id is necessary for volumes"},{"line_number":12,"context_line":"that enable multiple attachments in order to terminate the connection"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":75,"id":"ba63e191_3dc159e5","line":9,"updated":"2016-01-18 23:04:30.000000000","message":"s/atachment/attachment/","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Pass attachment_id to Cinder when detach a volume"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Cinder needs the attachment_id to properly identify which atachment"},{"line_number":10,"context_line":"of a volume to detach. This patch adapts the Cinder driver to pass"},{"line_number":11,"context_line":"the required information. The attachment_id is necessary for volumes"},{"line_number":12,"context_line":"that enable multiple attachments in order to terminate the connection"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":75,"id":"ba63e191_23637a1c","line":9,"in_reply_to":"ba63e191_3dc159e5","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":13,"context_line":"properly. The attachment_id is retrieved in the API layer where"},{"line_number":14,"context_line":"available and sent through RPC, the RPC version is bumped to 4.7."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Also the translation functions are modified to retrieve all nacassary"},{"line_number":17,"context_line":"information for the volume info coming from Cinder including the multiple"},{"line_number":18,"context_line":"attachments. The Nova API returns the volume info in the same format"},{"line_number":19,"context_line":"as earlier."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":75,"id":"ba63e191_ddb59d7e","line":16,"updated":"2016-01-18 23:04:30.000000000","message":"s/nacassary/necessary/","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":13,"context_line":"properly. The attachment_id is retrieved in the API layer where"},{"line_number":14,"context_line":"available and sent through RPC, the RPC version is bumped to 4.7."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Also the translation functions are modified to retrieve all nacassary"},{"line_number":17,"context_line":"information for the volume info coming from Cinder including the multiple"},{"line_number":18,"context_line":"attachments. The Nova API returns the volume info in the same format"},{"line_number":19,"context_line":"as earlier."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":75,"id":"ba63e191_4368eef5","line":16,"in_reply_to":"ba63e191_ddb59d7e","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"}],"nova/api/ec2/cloud.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":916,"context_line":"        ec2_attach_status \u003d ec2utils.status_to_ec2_attach_status(volume)"},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"        return {\u0027attachTime\u0027: volume[\u0027attach_time\u0027],"},{"line_number":919,"context_line":"                \u0027device\u0027: volume[\u0027mountpoint\u0027],"},{"line_number":920,"context_line":"                \u0027instanceId\u0027: ec2utils.id_to_ec2_inst_id(instance_uuid),"},{"line_number":921,"context_line":"                \u0027requestId\u0027: context.request_id,"},{"line_number":922,"context_line":"                \u0027status\u0027: ec2_attach_status,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_68493531","side":"PARENT","line":919,"updated":"2015-12-17 11:38:25.000000000","message":"Why can\u0027t we just keep using mountpoint here, I guess I will discover why in a bit.","commit_id":"6769d057d52d0cd01a6f264c230e7256c09478f1"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":916,"context_line":"        ec2_attach_status \u003d ec2utils.status_to_ec2_attach_status(volume)"},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"        return {\u0027attachTime\u0027: volume[\u0027attach_time\u0027],"},{"line_number":919,"context_line":"                \u0027device\u0027: volume[\u0027mountpoint\u0027],"},{"line_number":920,"context_line":"                \u0027instanceId\u0027: ec2utils.id_to_ec2_inst_id(instance_uuid),"},{"line_number":921,"context_line":"                \u0027requestId\u0027: context.request_id,"},{"line_number":922,"context_line":"                \u0027status\u0027: ec2_attach_status,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_1cab0f76","side":"PARENT","line":919,"in_reply_to":"3a7e1126_68493531","updated":"2015-12-17 12:21:38.000000000","message":"\u0027mountpoint\u0027 is not under volume[\u0027mountpoint\u0027] anymore, but stored with the attachment information under volume[\u0027attachments\u0027].","commit_id":"6769d057d52d0cd01a6f264c230e7256c09478f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":957,"context_line":"        ec2_attach_status \u003d ec2utils.status_to_ec2_attach_status(resp_volume)"},{"line_number":958,"context_line":""},{"line_number":959,"context_line":"        return {\u0027attachTime\u0027: volume[\u0027attach_time\u0027],"},{"line_number":960,"context_line":"                \u0027device\u0027: None,"},{"line_number":961,"context_line":"                \u0027instanceId\u0027: None,"},{"line_number":962,"context_line":"                \u0027requestId\u0027: context.request_id,"},{"line_number":963,"context_line":"                \u0027status\u0027: ec2_attach_status,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_e8d52543","line":960,"updated":"2015-12-17 11:38:25.000000000","message":"doesn\u0027t this break the API?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":957,"context_line":"        ec2_attach_status \u003d ec2utils.status_to_ec2_attach_status(resp_volume)"},{"line_number":958,"context_line":""},{"line_number":959,"context_line":"        return {\u0027attachTime\u0027: volume[\u0027attach_time\u0027],"},{"line_number":960,"context_line":"                \u0027device\u0027: None,"},{"line_number":961,"context_line":"                \u0027instanceId\u0027: None,"},{"line_number":962,"context_line":"                \u0027requestId\u0027: context.request_id,"},{"line_number":963,"context_line":"                \u0027status\u0027: ec2_attach_status,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_9cedbf8d","line":960,"in_reply_to":"3a7e1126_e8d52543","updated":"2015-12-17 12:21:38.000000000","message":"After detaching the volume I would assume not. Although I don\u0027t have EC2 env, so I can rely on tempest only for this, but tests were ok after this change. I can retrieve this from the attachment info of the volume if it still exists, if you think that would be better here.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"}],"nova/api/openstack/compute/legacy_v2/contrib/volumes.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    d[\u0027availabilityZone\u0027] \u003d vol[\u0027availability_zone\u0027]"},{"line_number":59,"context_line":"    d[\u0027createdAt\u0027] \u003d vol[\u0027created_at\u0027]"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_5dfc4d3e","line":61,"updated":"2016-01-18 23:04:30.000000000","message":"verified that the code in nova/volume/cinder.py always returns an \u0027attachments\u0027 key if status is \u0027attached\u0027.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    d[\u0027availabilityZone\u0027] \u003d vol[\u0027availability_zone\u0027]"},{"line_number":59,"context_line":"    d[\u0027createdAt\u0027] \u003d vol[\u0027created_at\u0027]"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a0f8c07d","line":61,"in_reply_to":"ba63e191_5dfc4d3e","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"f0605ac8e3100396eff33478edf612f543867b6e","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_27a11b95","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"updated":"2016-01-19 15:56:06.000000000","message":"This can\u0027t be correct in the general case since order of keys is undefined...","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5bbb2908213349b00a12f229d71427a6c57de05f","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_6749538b","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_27a11b95","updated":"2016-01-19 15:58:55.000000000","message":"See my comment in the v2.1 code, I thought the same but it should actually work because the volume_api uses an OrderedDict, but I still don\u0027t like depending on that here.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ce36a1a6f83aa8ef447a8b93480222e3c0e0408d","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_e231b1ed","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_27a11b95","updated":"2016-01-19 16:05:54.000000000","message":"When we enable multiattach in the Nova API it has to be revisited. This patch only prepares Mitaka Nova for proper volume detach in order to avoid problems in a mixed environment. Also I created an ordered dict in the translation function and I put items in it by going through the list of attachments coming from Cinder. So this should return the same info as the original case, where we use the first item of the list in the translation function.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_d658ecfc","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_53e64eb5","updated":"2016-01-19 17:07:31.000000000","message":"Will add a comment here.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c5bead62e6bd6065a7ca40be4a9c8e0910ec6640","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_d0355446","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_623aa138","updated":"2016-01-19 16:21:47.000000000","message":"\"Also doesn\u0027t this switch out the instance_uuid for the attachment_id changing the response de-facto?\"\n\nNo, it\u0027s just confusing to look at. The vol[\u0027attachments\u0027] dict is now keyed off the instance uuid, so that\u0027s why she\u0027s just getting the first entry in the dict and using that key, which is the instance uuid, same as before. The attachment_id is in the sub-dict mapped to the instance uuid. I agree it\u0027s hard to follow though.\n\nI also don\u0027t like relying on the OrderedDict in the volume_api, we shouldn\u0027t rely on that and just get the first entry in the attachments dict as a separate local variable and pull values from that.\n\nAs per the confusion on the contents of the dict, maybe it doesn\u0027t need to be done here, but a namedtuple or some simple object might actually help.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"750f2bd2893ee2c5d1a99f45e69b3f1988600894","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_504c0470","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_623aa138","updated":"2016-01-19 16:12:36.000000000","message":"The translation function changes the Cinder way of representing a volume info in Nova. Using a dict was a suggestion from John in order to make the code more readable so that we don\u0027t have to use \u0027for\u0027 everywhere to find an attachment for an instance. Which worked out well. The code is tested even more than previously, so it will not make any further harm than what we\u0027ve done already in case of a change in the format of the Cinder volume.\n\nHow do you mean to switch out the instance_uuid?","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"76b4963fdf2eecea5bb956316c1bffc76a2e77ce","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_623aa138","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_6749538b","updated":"2016-01-19 16:06:33.000000000","message":"We really should not rely on that - it seems like a hack and whether that\u0027s an ordered dict or not is squarely an internal implementation detail of the cinder module - no way to test for breakage in the future :/\n\nThis is smelly code.\n\nAlso doesn\u0027t this switch out the instance_uuid for the attachment_id changing the response de-facto?","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"5815f7cc4dcb838a2f13405e227a5618dc090f90","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":63,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":64,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":65,"context_line":"    else:"},{"line_number":66,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_53e64eb5","line":63,"range":{"start_line":63,"start_character":31,"end_line":63,"end_character":40},"in_reply_to":"ba63e191_d0355446","updated":"2016-01-19 16:35:00.000000000","message":"We should at the very least have a big fat comment explaining the use of keys there...","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"59dc1dd88d8702d3733e1f7556d21e61ae33d2a2","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # Cinder sends is converted to an OrderedDict with the"},{"line_number":64,"context_line":"        # instance_uuid as key to make it easier for the multiattach"},{"line_number":65,"context_line":"        # feature to check the required information. Multiattach will"},{"line_number":66,"context_line":"        # be enable in the Nova API in Newton."},{"line_number":67,"context_line":"        # The format looks like the following:"},{"line_number":68,"context_line":"        # attachments \u003d {\u0027instance_uuid\u0027: {"},{"line_number":69,"context_line":"        #                   \u0027attachment_id\u0027: \u0027attachment_uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":79,"id":"ba63e191_f012cd61","line":66,"updated":"2016-01-19 19:29:53.000000000","message":"++ nice comment.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        #                    }"},{"line_number":72,"context_line":"        #                }"},{"line_number":73,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":74,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":75,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":76,"context_line":"    else:"},{"line_number":77,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_e439f342","line":74,"updated":"2016-01-20 15:39:57.000000000","message":"While the comment is nice, ndipanov and I asked in patch set 77 to not assume we have an OrderedDict and just pull an entry from the attachments dict and use that w/o relying on the ordering.\n\n\"We really should not rely on that - it seems like a hack and whether that\u0027s an ordered dict or not is squarely an internal implementation detail of the cinder module - no way to test for breakage in the future :/\"","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        #                    }"},{"line_number":72,"context_line":"        #                }"},{"line_number":73,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":74,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":75,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":76,"context_line":"    else:"},{"line_number":77,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_bf6a1d19","line":74,"in_reply_to":"9a68dd71_e439f342","updated":"2016-01-20 18:09:16.000000000","message":"I will get the whole first item and use that. The comment can remain to explain the format.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"}],"nova/api/openstack/compute/volumes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1fe982e6f63cb07127a49d98edd8656337c14e23","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":58,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":59,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":60,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_eb318eed","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":30},"updated":"2016-01-12 20:23:38.000000000","message":"I thought vol[\u0027attachments\u0027] was a list, but it looks like you\u0027re treating it like a dict.","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":58,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":59,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":60,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_b13b0838","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":30},"in_reply_to":"da6ed579_eb318eed","updated":"2016-01-12 22:18:32.000000000","message":"It\u0027s an ordered dict created at the translation function in cinder.py. It was a suggestion from John, the instance_uuid is used as key.","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"497270acb692895a7e3278882678dfd7e22a4f2a","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":58,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":59,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":60,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_c6ada189","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":40},"updated":"2016-01-12 21:08:17.000000000","message":"How is this passing in the instance_uuid from the first attachment in the list - plus vol[\u0027attachments\u0027] is a list right? So .keys() should blow up on this I\u0027d think.\n\nWe should probably also have some code comments here to explain why we\u0027re filtering.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5e59d806c1e087edb74f245b7af29388958d0c4b","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    if vol[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027 and vol[\u0027attachments\u0027]:"},{"line_number":58,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":59,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":60,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_914cc443","line":59,"range":{"start_line":59,"start_character":12,"end_line":59,"end_character":40},"in_reply_to":"da6ed579_c6ada189","updated":"2016-01-12 22:45:46.000000000","message":"And it returns only the first attachment in the dict to keep the API response the same as earlier until we decide what changes we should make on the API. I will add a comment about it here.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a73bbf8621fa073786ea6c767f3e9476c29a588b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # In Mitaka Nova only allows a single volume attachment."},{"line_number":60,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":61,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":62,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":63,"context_line":"    else:"},{"line_number":64,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_87c7a711","line":62,"range":{"start_line":62,"start_character":31,"end_line":62,"end_character":42},"updated":"2016-01-19 15:57:22.000000000","message":"This concerned me at first because I wasn\u0027t sure that we\u0027d get the same values out in the same order as the keys, but then I remembered that the volume_api translation method is storing this as an OrderedDict, so this should be OK. It\u0027s still a bit scary looking for my taste and I\u0027d prefer if we just took the first entry from the attachments dict and used that consistently, but it\u0027s not a blocker.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ce36a1a6f83aa8ef447a8b93480222e3c0e0408d","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # In Mitaka Nova only allows a single volume attachment."},{"line_number":60,"context_line":"        d[\u0027attachments\u0027] \u003d [_translate_attachment_detail_view(vol[\u0027id\u0027],"},{"line_number":61,"context_line":"            vol[\u0027attachments\u0027].keys()[0],"},{"line_number":62,"context_line":"            vol[\u0027attachments\u0027].values()[0].get(\u0027mountpoint\u0027))]"},{"line_number":63,"context_line":"    else:"},{"line_number":64,"context_line":"        d[\u0027attachments\u0027] \u003d [{}]"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_a2941937","line":62,"range":{"start_line":62,"start_character":31,"end_line":62,"end_character":42},"in_reply_to":"ba63e191_87c7a711","updated":"2016-01-19 16:05:54.000000000","message":"The OrderedDict should serve the purpose here until we do not figure out the API changes for multiattach in the next release. If this one is not a blocker here, I would appreciate if we could leave it like this.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/compute/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cd0c0c6b71ff3601cadf31ea1bda913f5a4b7a50","unresolved":false,"context_lines":[{"line_number":1758,"context_line":"                    volume \u003d self.volume_api.get(bdm.volume_id)"},{"line_number":1759,"context_line":"                    attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":1760,"context_line":"                        volume, instance.uuid)"},{"line_number":1761,"context_line":"                    self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":1762,"context_line":"                                           attachment[\u0027id\u0027])"},{"line_number":1763,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":1764,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_bcd28bfe","line":1761,"updated":"2015-07-28 17:27:46.000000000","message":"It feels like the volume_api should just take instance_uuid for all detach calls? Would that not be better, to keep this complexity inside the volume_api?","commit_id":"41c900c942e508e4b8c657398f3f4b22ad88e1dd"},{"author":{"_account_id":13002,"name":"Shyama","email":"shyvenug@in.ibm.com","username":"shyama"},"change_message_id":"e0c50464d6cdd3a4449e5adf7d6e07999febbfa7","unresolved":false,"context_lines":[{"line_number":1759,"context_line":"                    attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":1760,"context_line":"                        volume, instance.uuid)"},{"line_number":1761,"context_line":"                    self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":1762,"context_line":"                                           attachment[\u0027id\u0027])"},{"line_number":1763,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":1764,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":1765,"context_line":"                except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_7af7a7d3","line":1762,"updated":"2015-08-04 11:17:35.000000000","message":"Agree to the comment from John Garbutt. The volume_api.get_volume_attachment can be done in the volume_api.detach. If an instnace_uuid is passed in during detach use that to get the attachment id.","commit_id":"41c900c942e508e4b8c657398f3f4b22ad88e1dd"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cd0c0c6b71ff3601cadf31ea1bda913f5a4b7a50","unresolved":false,"context_lines":[{"line_number":3067,"context_line":""},{"line_number":3068,"context_line":"        # Volumes may be attached to multiple hosts and/or instances,"},{"line_number":3069,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":3070,"context_line":"        if volume[\u0027attachments\u0027]:"},{"line_number":3071,"context_line":"            for attachment in volume[\u0027attachments\u0027]:"},{"line_number":3072,"context_line":"                if attachment[\u0027instance_uuid\u0027] \u003d\u003d instance.uuid:"},{"line_number":3073,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_9c1a2fc5","line":3070,"updated":"2015-07-28 17:27:46.000000000","message":"I think this might be a backwards incompatible change that will break upgrade. We need this compute to talk the older RPC version that didn\u0027t have this extra data.\n\nAlthough I could be missing the details, I need to dig further.","commit_id":"41c900c942e508e4b8c657398f3f4b22ad88e1dd"},{"author":{"_account_id":8037,"name":"renminmin","email":"rmm0811@gmail.com","username":"renminmin"},"change_message_id":"c733597a300d86d3be23e0f9d727c39b32a691ab","unresolved":false,"context_lines":[{"line_number":1834,"context_line":"                    attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":1835,"context_line":"                        volume, instance.uuid)"},{"line_number":1836,"context_line":"                    self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":1837,"context_line":"                                           attachment[\u0027id\u0027])"},{"line_number":1838,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":1839,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":1840,"context_line":"                except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_7fc7b712","line":1837,"range":{"start_line":1837,"start_character":57,"end_line":1837,"end_character":60},"updated":"2015-12-17 09:30:38.000000000","message":"It should be attachment[\u0027attachment_id\u0027].","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":1834,"context_line":"                    attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":1835,"context_line":"                        volume, instance.uuid)"},{"line_number":1836,"context_line":"                    self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":1837,"context_line":"                                           attachment[\u0027id\u0027])"},{"line_number":1838,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":1839,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":1840,"context_line":"                except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_e209c496","line":1837,"range":{"start_line":1837,"start_character":57,"end_line":1837,"end_character":60},"in_reply_to":"3a7e1126_7fc7b712","updated":"2015-12-17 12:21:38.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":1834,"context_line":"                    attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":1835,"context_line":"                        volume, instance.uuid)"},{"line_number":1836,"context_line":"                    self.volume_api.detach(elevated, bdm.volume_id,"},{"line_number":1837,"context_line":"                                           attachment[\u0027id\u0027])"},{"line_number":1838,"context_line":"                    if bdm.delete_on_termination:"},{"line_number":1839,"context_line":"                        self.volume_api.delete(context, bdm.volume_id)"},{"line_number":1840,"context_line":"                except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_71827c02","line":1837,"range":{"start_line":1837,"start_character":57,"end_line":1837,"end_character":60},"in_reply_to":"3a7e1126_7fc7b712","updated":"2015-12-17 12:11:32.000000000","message":"See my comments in cinder.py, I feel this should be more like:\n\nvolume \u003d self.volume_api.get(bdm.volume_id)\n\nself.volume_api.detach(volume, instance.uuid)","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":3078,"context_line":"        This method is separated to make it easier for cells version"},{"line_number":3079,"context_line":"        to override."},{"line_number":3080,"context_line":"        \"\"\""},{"line_number":3081,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3082,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3083,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3084,"context_line":"                volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_b118e485","line":3081,"updated":"2015-12-17 12:11:32.000000000","message":"Oh, thats here I think this now needs to take instance.uuid here?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":3078,"context_line":"        This method is separated to make it easier for cells version"},{"line_number":3079,"context_line":"        to override."},{"line_number":3080,"context_line":"        \"\"\""},{"line_number":3081,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3082,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3083,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3084,"context_line":"                volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_ade60bb2","line":3081,"in_reply_to":"3a7e1126_b118e485","updated":"2016-01-05 07:31:35.000000000","message":"Done.\n\nI tried to refactor as much of the code as possible as there were several checks everywhere that could/should be done in \u0027check_detach\u0027 instead of the functions where we call it from.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":3081,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3082,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3083,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3084,"context_line":"                volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":3085,"context_line":""},{"line_number":3086,"context_line":"    @wrap_check_policy"},{"line_number":3087,"context_line":"    @check_instance_lock"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_fcb9632f","line":3084,"updated":"2015-12-17 12:11:32.000000000","message":"phew, volume doesn\u0027t go over RPC, so I think we are safe changing the format of the volume, in an upgrade worry sense.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":3103,"context_line":"            else:"},{"line_number":3104,"context_line":"                raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":3105,"context_line":"        else:"},{"line_number":3106,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"        self._detach_volume(context, instance, volume)"},{"line_number":3109,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_1191b8f0","line":3106,"updated":"2015-12-17 12:11:32.000000000","message":"Surely, this is similar to \"check_attach\" in volume/cinder.py? Feels like this should be in \"check_detach\" in a similar place?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":3103,"context_line":"            else:"},{"line_number":3104,"context_line":"                raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":3105,"context_line":"        else:"},{"line_number":3106,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":3107,"context_line":""},{"line_number":3108,"context_line":"        self._detach_volume(context, instance, volume)"},{"line_number":3109,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_cde1179c","line":3106,"in_reply_to":"3a7e1126_1191b8f0","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3ec08a1950744e26981970899e2ce43fe50ca56f","unresolved":false,"context_lines":[{"line_number":1488,"context_line":"                    bdm.get(\u0027destination_type\u0027) \u003d\u003d \u0027volume\u0027):"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"                    volume_id \u003d bdm.get(\u0027volume_id\u0027)"},{"line_number":1491,"context_line":"                    volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":1492,"context_line":"                    if volume and volume[\u0027multiattach\u0027]:"},{"line_number":1493,"context_line":"                        raise exception.BootFromVolumeNotSupported("},{"line_number":1494,"context_line":"                            volume_id\u003dvolume_id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_4641b10a","line":1491,"range":{"start_line":1491,"start_character":29,"end_line":1491,"end_character":68},"updated":"2016-01-12 21:00:42.000000000","message":"Doesn\u0027t this raise a VolumeNotFound if the volume isn\u0027t found?\n\nActually can\u0027t we just move this validation code to the _validate_bdm method, which seems like that\u0027d be a more natural place for this check.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5e59d806c1e087edb74f245b7af29388958d0c4b","unresolved":false,"context_lines":[{"line_number":1488,"context_line":"                    bdm.get(\u0027destination_type\u0027) \u003d\u003d \u0027volume\u0027):"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"                    volume_id \u003d bdm.get(\u0027volume_id\u0027)"},{"line_number":1491,"context_line":"                    volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":1492,"context_line":"                    if volume and volume[\u0027multiattach\u0027]:"},{"line_number":1493,"context_line":"                        raise exception.BootFromVolumeNotSupported("},{"line_number":1494,"context_line":"                            volume_id\u003dvolume_id)"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_d4e8ea7e","line":1491,"range":{"start_line":1491,"start_character":29,"end_line":1491,"end_character":68},"in_reply_to":"da6ed579_4641b10a","updated":"2016-01-12 22:45:46.000000000","message":"We have the BDM after transforming the block_device_mapping that comes with the instance. That call comes much later and check the transformed BDM, so I wouldn\u0027t move this check there, I think it belongs here more, where we still kind of validate the request itself.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f617fabdd023a88cc1ab0341c2e89d3cf320b94e","unresolved":false,"context_lines":[{"line_number":3281,"context_line":"    @wrap_check_policy"},{"line_number":3282,"context_line":"    def volume_snapshot_delete(self, context, volume_id, snapshot_id,"},{"line_number":3283,"context_line":"                               delete_info):"},{"line_number":3284,"context_line":"        bdm \u003d objects.BlockDeviceMapping.get_by_volume_id("},{"line_number":3285,"context_line":"                context, volume_id, expected_attrs\u003d[\u0027instance\u0027])"},{"line_number":3286,"context_line":"        self.compute_rpcapi.volume_snapshot_delete(context, bdm.instance,"},{"line_number":3287,"context_line":"                volume_id, snapshot_id, delete_info)"}],"source_content_type":"text/x-python","patch_set":69,"id":"da6ed579_4e7ae8f2","line":3284,"updated":"2016-01-13 20:35:42.000000000","message":"I\u0027d think we need the same check here for multiattach like we have above.","commit_id":"dbd175983019eff57d0d7497e6a9264c819d5e22"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":3024,"context_line":"        attachment_id \u003d None"},{"line_number":3025,"context_line":"        if attachments:"},{"line_number":3026,"context_line":"            attachment_id \u003d attachments.get(instance.uuid, {}).\\"},{"line_number":3027,"context_line":"                get(\u0027attachment_id\u0027)"},{"line_number":3028,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3029,"context_line":"                volume_id\u003dvolume[\u0027id\u0027], attachment_id\u003dattachment_id)"},{"line_number":3030,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_5daa0d1b","line":3027,"updated":"2016-01-18 23:04:30.000000000","message":"Lines 3025-3027 could be more cleanly expressed like so:\n\n if attachments and instance.uuid in attachments:\n   attachment_id \u003d attachments[instance.uuid][\u0027attachment_id\u0027]","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":3024,"context_line":"        attachment_id \u003d None"},{"line_number":3025,"context_line":"        if attachments:"},{"line_number":3026,"context_line":"            attachment_id \u003d attachments.get(instance.uuid, {}).\\"},{"line_number":3027,"context_line":"                get(\u0027attachment_id\u0027)"},{"line_number":3028,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3029,"context_line":"                volume_id\u003dvolume[\u0027id\u0027], attachment_id\u003dattachment_id)"},{"line_number":3030,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_60e5e8a6","line":3027,"in_reply_to":"ba63e191_5daa0d1b","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fb1fae6ca2479c403eaf4d45128432453a351e06","unresolved":false,"context_lines":[{"line_number":3051,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3052,"context_line":"        if not old_volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":3053,"context_line":"            msg \u003d _(\"Old volume is attached to a different instance.\")"},{"line_number":3054,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3055,"context_line":"        if new_volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":3056,"context_line":"            msg \u003d _(\"New volume must be detached in order to swap.\")"},{"line_number":3057,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_b4ff9e33","line":3054,"updated":"2016-01-19 01:41:01.000000000","message":"@ildiko: OK, fair enough point.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":3051,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3052,"context_line":"        if not old_volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":3053,"context_line":"            msg \u003d _(\"Old volume is attached to a different instance.\")"},{"line_number":3054,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3055,"context_line":"        if new_volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":3056,"context_line":"            msg \u003d _(\"New volume must be detached in order to swap.\")"},{"line_number":3057,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_7da7d14f","line":3054,"updated":"2016-01-18 23:04:30.000000000","message":"With multiattach, though, the old volume could very likely be attached to a different instance and that would be totally fine, right? I think this block of code needs to be removed like the block from detach_volume().","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":3051,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3052,"context_line":"        if not old_volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":3053,"context_line":"            msg \u003d _(\"Old volume is attached to a different instance.\")"},{"line_number":3054,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3055,"context_line":"        if new_volume[\u0027attach_status\u0027] \u003d\u003d \u0027attached\u0027:"},{"line_number":3056,"context_line":"            msg \u003d _(\"New volume must be detached in order to swap.\")"},{"line_number":3057,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_60aac81b","line":3054,"in_reply_to":"ba63e191_7da7d14f","updated":"2016-01-19 00:27:49.000000000","message":"I might be wrong here, but I think the use case requires here that the old volume is connected to this instance also.\n\nI tried to refactor this part, but due to the fact that at different parts of the code it checks and fails on things in a different order I ended up with changing the returned error. I wasn\u0027t sure how acceptable that is from API perspective. This patch does not add support for multiattach, that will finally be introduced in N, with a new API microversion. I think this change would be better there. What do you think?","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":3020,"context_line":"        \"\"\""},{"line_number":3021,"context_line":"        self.volume_api.check_detach(context, volume, instance\u003dinstance)"},{"line_number":3022,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3023,"context_line":"        attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":3024,"context_line":"        attachment_id \u003d None"},{"line_number":3025,"context_line":"        if attachments and instance.uuid in attachments:"},{"line_number":3026,"context_line":"            attachment_id \u003d attachments[instance.uuid][\u0027attachment_id\u0027]"},{"line_number":3027,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3028,"context_line":"                volume_id\u003dvolume[\u0027id\u0027], attachment_id\u003dattachment_id)"},{"line_number":3029,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b1cc6936","line":3026,"range":{"start_line":3023,"start_character":8,"end_line":3026,"end_character":71},"updated":"2016-01-19 15:30:19.000000000","message":"This logic is duplicated in the volume_api.detach method, maybe we should consider adding a static helper method to the volume_api that given a volume and an instance, it returns the attachment_id (or None).","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ae593cc0c499724b4ae46a61c443675adfab3198","unresolved":false,"context_lines":[{"line_number":3020,"context_line":"        \"\"\""},{"line_number":3021,"context_line":"        self.volume_api.check_detach(context, volume, instance\u003dinstance)"},{"line_number":3022,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3023,"context_line":"        attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":3024,"context_line":"        attachment_id \u003d None"},{"line_number":3025,"context_line":"        if attachments and instance.uuid in attachments:"},{"line_number":3026,"context_line":"            attachment_id \u003d attachments[instance.uuid][\u0027attachment_id\u0027]"},{"line_number":3027,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3028,"context_line":"                volume_id\u003dvolume[\u0027id\u0027], attachment_id\u003dattachment_id)"},{"line_number":3029,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_8ce90e1d","line":3026,"range":{"start_line":3023,"start_character":8,"end_line":3026,"end_character":71},"in_reply_to":"ba63e191_b1cc6936","updated":"2016-01-19 15:43:13.000000000","message":"It\u0027s actually not fully duplicated. Here we have the volume available from the API as there\u0027s a round trip to Cinder. In that case we pass the attachment_id through RPC and when it is available the code in volume_api does not run. That detach code is called from multiple places and we add a Warning log there if the volume enables multi-attach and the attachment_id cannot be retrieved.\n\nIn this sense I don\u0027t think we need a helper method to get one value out of a dict. Do you think it would be necessary?","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/compute/manager.py":[{"author":{"_account_id":13002,"name":"Shyama","email":"shyvenug@in.ibm.com","username":"shyama"},"change_message_id":"5ba29afcd33772976ceacf4409bb13b96a3d2d46","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"        if retries \u003e\u003d 1:"},{"line_number":1387,"context_line":"            attempts \u003d retries + 1"},{"line_number":1388,"context_line":"        for attempt in range(1, attempts + 1):"},{"line_number":1389,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1390,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1391,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1392,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_063b5bd2","line":1389,"updated":"2015-09-11 05:25:45.000000000","message":"Need to add a check here to allow in-use volumes to be attached when deploy using block-device","commit_id":"cc0d3bfe5ac1ccc535960798a768cf9d733a1a87"},{"author":{"_account_id":13002,"name":"Shyama","email":"shyvenug@in.ibm.com","username":"shyama"},"change_message_id":"4884f9b08fcfee27306441fe55fbdf6a0d3fe020","unresolved":false,"context_lines":[{"line_number":2313,"context_line":"                                                     bdm.volume_id,"},{"line_number":2314,"context_line":"                                                     connector)"},{"line_number":2315,"context_line":"                volume \u003d self.volume_api.get(context, bdm.volume_id)"},{"line_number":2316,"context_line":"                # find the attachment id for the instance."},{"line_number":2317,"context_line":"                attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":2318,"context_line":"                    volume, instance[\u0027uuid\u0027])"},{"line_number":2319,"context_line":"                self.volume_api.detach(context, bdm.volume_id,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a740942_83530939","line":2316,"updated":"2015-12-10 13:55:57.000000000","message":"There are lot of instances where we need to call get_volume_attachment and then volume_api detach with attahment id. May be we can pass in the instance id and move the logic to get attachment id to volume_api.","commit_id":"21e96bd49b9b5971c2ca6e5fd1fd5cc79bb99396"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"18137c0d730d2c7838bc8ad0ac0f027a14cc0060","unresolved":false,"context_lines":[{"line_number":2313,"context_line":"                                                     bdm.volume_id,"},{"line_number":2314,"context_line":"                                                     connector)"},{"line_number":2315,"context_line":"                volume \u003d self.volume_api.get(context, bdm.volume_id)"},{"line_number":2316,"context_line":"                # find the attachment id for the instance."},{"line_number":2317,"context_line":"                attachment \u003d self.volume_api.get_volume_attachment("},{"line_number":2318,"context_line":"                    volume, instance[\u0027uuid\u0027])"},{"line_number":2319,"context_line":"                self.volume_api.detach(context, bdm.volume_id,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7a740942_42016d69","line":2316,"in_reply_to":"7a740942_83530939","updated":"2015-12-11 08:12:57.000000000","message":"The voluma_api is mostly a proxy towards Cinder, so I would not add extra logic to the detach function there. We need to pass an extra param anyway, I think it\u0027s more clear this way.","commit_id":"21e96bd49b9b5971c2ca6e5fd1fd5cc79bb99396"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1410,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1411,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1412,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027 or volume_status \u003d\u003d \u0027in-use\u0027:"},{"line_number":1413,"context_line":"                    return attempt"},{"line_number":1414,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1415,"context_line":"                                \"created but its status is %(vol_status)s.\"),"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_9c5dbfeb","line":1412,"updated":"2015-12-17 12:11:32.000000000","message":"Really? Isn\u0027t this when we create the volume, we are waiting to see if it has been created?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1410,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1411,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1412,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027 or volume_status \u003d\u003d \u0027in-use\u0027:"},{"line_number":1413,"context_line":"                    return attempt"},{"line_number":1414,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1415,"context_line":"                                \"created but its status is %(vol_status)s.\"),"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_86651b1f","line":1412,"in_reply_to":"3a7e1126_9c5dbfeb","updated":"2016-01-05 07:31:35.000000000","message":"We create BDM per attachment and in this sense we can create it for volumes which are already \u0027in-use\u0027. Or do I miss something here?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":4713,"context_line":"        \"\"\""},{"line_number":4714,"context_line":""},{"line_number":4715,"context_line":"        bdm \u003d objects.BlockDeviceMapping.\\"},{"line_number":4716,"context_line":"                get_by_instance_and_volume_id(context, volume_id,"},{"line_number":4717,"context_line":"                                              instance.uuid)"},{"line_number":4718,"context_line":"        if CONF.volume_usage_poll_interval \u003e 0:"},{"line_number":4719,"context_line":"            vol_stats \u003d []"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_5ccc3789","line":4716,"updated":"2015-12-17 12:11:32.000000000","message":"see previous patch, I think we can keep the old method name here.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":4713,"context_line":"        \"\"\""},{"line_number":4714,"context_line":""},{"line_number":4715,"context_line":"        bdm \u003d objects.BlockDeviceMapping.\\"},{"line_number":4716,"context_line":"                get_by_instance_and_volume_id(context, volume_id,"},{"line_number":4717,"context_line":"                                              instance.uuid)"},{"line_number":4718,"context_line":"        if CONF.volume_usage_poll_interval \u003e 0:"},{"line_number":4719,"context_line":"            vol_stats \u003d []"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_cbffdfff","line":4716,"in_reply_to":"3a7e1126_5ccc3789","updated":"2015-12-17 18:35:10.000000000","message":"A-ha, right, by now I realized too that if I fix that note there than the extra function does not make sense anymore. So I will go back and fix that again. :)","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":4713,"context_line":"        \"\"\""},{"line_number":4714,"context_line":""},{"line_number":4715,"context_line":"        bdm \u003d objects.BlockDeviceMapping.\\"},{"line_number":4716,"context_line":"                get_by_instance_and_volume_id(context, volume_id,"},{"line_number":4717,"context_line":"                                              instance.uuid)"},{"line_number":4718,"context_line":"        if CONF.volume_usage_poll_interval \u003e 0:"},{"line_number":4719,"context_line":"            vol_stats \u003d []"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_47e2b130","line":4716,"in_reply_to":"3a7e1126_cbffdfff","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_9c3a9f35","line":4749,"updated":"2015-12-17 12:11:32.000000000","message":"I do worry about all the extra calls we need to make to Cinder here.\n\nI guess, we could pass the attachment_id over RPC, defaulting that to None, so we only need get the volume again for compatibility cases?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_ea7e2718","line":4749,"in_reply_to":"3a7e1126_4bde8f6e","updated":"2016-01-05 07:31:35.000000000","message":"I moved this call from here to the Cinder driver finally, this way it is centralized now.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"833577fa576b32a2384e8c5a5ea2aa2de8aae630","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_42d3b604","line":4749,"in_reply_to":"3a7e1126_4bde8f6e","updated":"2016-01-04 11:42:13.000000000","message":"We already get this from cinder in the API, I believe, so we could pass it down to the manager here, and only fetch it again if we didn\u0027t get passed that information.\n\nStoring the attachment_id in the DBM is another good way of doing that, I feel. Calling Cinder loads of times is going to hurt our scaleability.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_4bde8f6e","line":4749,"in_reply_to":"3a7e1126_9c3a9f35","updated":"2015-12-17 18:35:10.000000000","message":"Hmm, I might miss something here. So we do not store the attachment_id in Nova as far as I understand. In this sense for detaching a volume we need to get the info from Cinder at some point before calling out to detach as Cinder needs that information to perform the action. Or did you mean that we should do this call somewhere else in Nova?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_68079118","line":4749,"in_reply_to":"fa69d971_20f1be01","updated":"2016-01-05 07:31:35.000000000","message":"I can give it a try to pass the attachment_id to detach, when we have it from the API. That should decrease the number of round trips to Cinder.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"220ee9ed305d65effa02220028029b25e9cad6cd","unresolved":false,"context_lines":[{"line_number":4746,"context_line":""},{"line_number":4747,"context_line":"        self._driver_detach_volume(context, instance, bdm)"},{"line_number":4748,"context_line":"        connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":4749,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4750,"context_line":"        self.volume_api.terminate_connection(context, volume_id, connector)"},{"line_number":4751,"context_line":""},{"line_number":4752,"context_line":"        if destroy_bdm:"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_20f1be01","line":4749,"in_reply_to":"fa69d971_42d3b604","updated":"2016-01-04 22:28:12.000000000","message":"There was a spec proposed at one point to store the volume attachment ID in the nova database because the volume attachments API returns the volume ID for both the attachment id and the volume id:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/volumes.py#L203\n\nBut I think the spec was shot down because that\u0027s been around for a long time, it would have require an API microversion, possibly a database migration, and it was mostly unnecessary (not worth that amount of effort).\n\nBut maybe there is some justification for storing that now - however, that\u0027s assuming that information doesn\u0027t become stale somehow on the cinder side and then nova is working on bad information. Which then brings up the idea of something like the network info_cache on the instance which we use to store information from neutron (and nova-net), but that\u0027s also been buggy and racy, so as long as we\u0027re not hitting cinder all of the time (an extra hit to cinder on detach might not be terrible), maybe it\u0027s not the end of the world?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"a9c8e411498a0606e54fd9780e595e0f8f05246a","unresolved":false,"context_lines":[{"line_number":1416,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1417,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1418,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1419,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027 or volume_status \u003d\u003d \u0027in-use\u0027:"},{"line_number":1420,"context_line":"                    return attempt"},{"line_number":1421,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1422,"context_line":"                                \"created but its status is %(vol_status)s.\"),"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_6cc6a89b","line":1419,"range":{"start_line":1419,"start_character":52,"end_line":1419,"end_character":76},"updated":"2016-01-05 18:13:12.000000000","message":"When would this happen? We don\u0027t even know  the volume_id outside of this flow?","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"451dec29b08f083b1ef89be9eb42a1cbd66a807d","unresolved":false,"context_lines":[{"line_number":1416,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1417,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1418,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1419,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027 or volume_status \u003d\u003d \u0027in-use\u0027:"},{"line_number":1420,"context_line":"                    return attempt"},{"line_number":1421,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1422,"context_line":"                                \"created but its status is %(vol_status)s.\"),"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_9ec3fb56","line":1419,"range":{"start_line":1419,"start_character":52,"end_line":1419,"end_character":76},"in_reply_to":"fa69d971_6cc6a89b","updated":"2016-01-05 23:26:05.000000000","message":"The volume can already be attached to another instance before this call in multi-attach case. Or do I miss something here?","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ab93a5e0702c1ac2dd8e3a7556b75a51323c4d39","unresolved":false,"context_lines":[{"line_number":1418,"context_line":"            volume \u003d self.volume_api.get(context, vol_id)"},{"line_number":1419,"context_line":"            volume_status \u003d volume[\u0027status\u0027]"},{"line_number":1420,"context_line":"            if volume_status not in [\u0027creating\u0027, \u0027downloading\u0027]:"},{"line_number":1421,"context_line":"                if volume_status \u003d\u003d \u0027available\u0027 or volume_status \u003d\u003d \u0027in-use\u0027:"},{"line_number":1422,"context_line":"                    return attempt"},{"line_number":1423,"context_line":"                LOG.warning(_LW(\"Volume id: %(vol_id)s finished being \""},{"line_number":1424,"context_line":"                                \"created but its status is %(vol_status)s.\"),"}],"source_content_type":"text/x-python","patch_set":66,"id":"da6ed579_e683fcca","line":1421,"range":{"start_line":1421,"start_character":51,"end_line":1421,"end_character":76},"updated":"2016-01-13 01:34:32.000000000","message":"Shouldn\u0027t we check the multiattach flag in this case also?","commit_id":"ebb41e767872f9ad5287f897b4bb7581d0d4bfbb"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"a9c8e411498a0606e54fd9780e595e0f8f05246a","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        cctxt \u003d self.client.prepare(server\u003d_compute_host(None, instance),"},{"line_number":812,"context_line":"                version\u003dversion)"},{"line_number":813,"context_line":"        volume_bdm \u003d cctxt.call(ctxt, \u0027reserve_block_device_name\u0027, **kw)"},{"line_number":814,"context_line":"        bdm_cls \u003d objects.BlockDeviceMapping"},{"line_number":815,"context_line":"        if not isinstance(volume_bdm, bdm_cls):"},{"line_number":816,"context_line":"            volume_bdm \u003d bdm_cls.get_by_volume_id(ctxt, volume_id,"},{"line_number":817,"context_line":"                                                  instance.uuid)"},{"line_number":818,"context_line":"        return volume_bdm"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    def backup_instance(self, ctxt, instance, image_id, backup_type,"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_8c1f5c07","line":817,"range":{"start_line":814,"start_character":8,"end_line":817,"end_character":64},"updated":"2016-01-05 18:13:12.000000000","message":"This seems completely unrelated other than adding the instance_uuid (which should really be a kwarg, but see previous patch).","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"451dec29b08f083b1ef89be9eb42a1cbd66a807d","unresolved":false,"context_lines":[{"line_number":811,"context_line":"        cctxt \u003d self.client.prepare(server\u003d_compute_host(None, instance),"},{"line_number":812,"context_line":"                version\u003dversion)"},{"line_number":813,"context_line":"        volume_bdm \u003d cctxt.call(ctxt, \u0027reserve_block_device_name\u0027, **kw)"},{"line_number":814,"context_line":"        bdm_cls \u003d objects.BlockDeviceMapping"},{"line_number":815,"context_line":"        if not isinstance(volume_bdm, bdm_cls):"},{"line_number":816,"context_line":"            volume_bdm \u003d bdm_cls.get_by_volume_id(ctxt, volume_id,"},{"line_number":817,"context_line":"                                                  instance.uuid)"},{"line_number":818,"context_line":"        return volume_bdm"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    def backup_instance(self, ctxt, instance, image_id, backup_type,"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_9eb9bb17","line":817,"range":{"start_line":814,"start_character":8,"end_line":817,"end_character":64},"in_reply_to":"fa69d971_8c1f5c07","updated":"2016-01-05 23:26:05.000000000","message":"get_by_volume_id accepts instance_uuid already, that\u0027s not new. It\u0027s an optional argument of that function, so in this sense it should make no harm to add it here.","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        * ...  - Remove refresh_security_group_members()"},{"line_number":320,"context_line":"        * ...  - Remove refresh_security_group_rules()"},{"line_number":321,"context_line":"        * 4.6  - Add trigger_crash_dump()"},{"line_number":322,"context_line":"        * 4.7  - Add attachment_id argument to detach_volume()"},{"line_number":323,"context_line":"    \u0027\u0027\u0027"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    VERSION_ALIASES \u003d {"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_e2aa1170","line":322,"updated":"2016-01-19 16:17:37.000000000","message":"Technically we don\u0027t *need* to do this since the volume_api will look up the volume and try to match the attachment given the instance, so really this is just trying to save us the extra call to cinder. It does clutter up the code, which I don\u0027t like, but does reduce the additional call to cinder, which is a good thing. I\u0027m a bit torn on this one.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        * ...  - Remove refresh_security_group_members()"},{"line_number":320,"context_line":"        * ...  - Remove refresh_security_group_rules()"},{"line_number":321,"context_line":"        * 4.6  - Add trigger_crash_dump()"},{"line_number":322,"context_line":"        * 4.7  - Add attachment_id argument to detach_volume()"},{"line_number":323,"context_line":"    \u0027\u0027\u0027"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"    VERSION_ALIASES \u003d {"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_16d1a457","line":322,"in_reply_to":"ba63e191_e2aa1170","updated":"2016-01-19 17:07:31.000000000","message":"I don\u0027t have any better idea to save that round trip. :(","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/exception.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"993a473b0ad601b46856f0c3c85231786ffa0d64","unresolved":false,"context_lines":[{"line_number":319,"context_line":"                \"volume %(volume_id)s\")"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"class VolumeSnapshotNotSupported(Invalid):"},{"line_number":323,"context_line":"    msg_fmt \u003d _(\"Snapshot create failed for volume %(volume_id)s. \""},{"line_number":324,"context_line":"                \"Volume snapshot create is not supported for multi-attach \""},{"line_number":325,"context_line":"                \"volumes.\")"}],"source_content_type":"text/x-python","patch_set":69,"id":"da6ed579_c567a923","line":322,"range":{"start_line":322,"start_character":6,"end_line":322,"end_character":32},"updated":"2016-01-13 15:45:51.000000000","message":"Since this is specifically for multiattach, maybe we should call this \"VolumeMultiattachSnapshotNotSupported\".","commit_id":"dbd175983019eff57d0d7497e6a9264c819d5e22"}],"nova/objects/service.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    {\u0027compute_rpc\u0027: \u00274.6\u0027},"},{"line_number":61,"context_line":"    # Version 4: Add PciDevice.parent_addr (data migration needed)"},{"line_number":62,"context_line":"    {\u0027compute_rpc\u0027: \u00274.6\u0027},"},{"line_number":63,"context_line":"    # Version 5: Changes to detach_volume  signature in compute_rpc"},{"line_number":64,"context_line":"    {\u0027compute_rpc\u0027: \u00274.7\u0027},"},{"line_number":65,"context_line":")"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_1dbc956b","line":63,"updated":"2016-01-18 23:04:30.000000000","message":"Please be more specific here and say something like \u0027Added attachment_id kwarg to detach_volume()\u0027","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    {\u0027compute_rpc\u0027: \u00274.6\u0027},"},{"line_number":61,"context_line":"    # Version 4: Add PciDevice.parent_addr (data migration needed)"},{"line_number":62,"context_line":"    {\u0027compute_rpc\u0027: \u00274.6\u0027},"},{"line_number":63,"context_line":"    # Version 5: Changes to detach_volume  signature in compute_rpc"},{"line_number":64,"context_line":"    {\u0027compute_rpc\u0027: \u00274.7\u0027},"},{"line_number":65,"context_line":")"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_c074d4d0","line":63,"in_reply_to":"ba63e191_1dbc956b","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"}],"nova/tests/functional/api_sample_tests/test_volumes.py":[{"author":{"_account_id":8037,"name":"renminmin","email":"rmm0811@gmail.com","username":"renminmin"},"change_message_id":"c733597a300d86d3be23e0f9d727c39b32a691ab","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                  \u0027attachments\u0027: ["},{"line_number":132,"context_line":"                       {"},{"line_number":133,"context_line":"                        \u0027mountpoint\u0027: \u0027/\u0027,"},{"line_number":134,"context_line":"                        \u0027id\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027,"},{"line_number":135,"context_line":"                        \u0027instance_uuid\u0027:"},{"line_number":136,"context_line":"                            \u00273912f2b4-c5ba-4aec-9165-872876fe202e\u0027,"},{"line_number":137,"context_line":"                        \u0027volumeId\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_658888e8","line":134,"range":{"start_line":134,"start_character":67,"end_line":134,"end_character":69},"updated":"2015-12-17 09:30:38.000000000","message":"\u0027id\u0027 should be attachement_id","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                  \u0027attachments\u0027: ["},{"line_number":132,"context_line":"                       {"},{"line_number":133,"context_line":"                        \u0027mountpoint\u0027: \u0027/\u0027,"},{"line_number":134,"context_line":"                        \u0027id\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027,"},{"line_number":135,"context_line":"                        \u0027instance_uuid\u0027:"},{"line_number":136,"context_line":"                            \u00273912f2b4-c5ba-4aec-9165-872876fe202e\u0027,"},{"line_number":137,"context_line":"                        \u0027volumeId\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_174c48c6","line":134,"range":{"start_line":134,"start_character":67,"end_line":134,"end_character":69},"in_reply_to":"3a7e1126_658888e8","updated":"2015-12-17 12:11:32.000000000","message":"+1","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                  \u0027attachments\u0027: ["},{"line_number":132,"context_line":"                       {"},{"line_number":133,"context_line":"                        \u0027mountpoint\u0027: \u0027/\u0027,"},{"line_number":134,"context_line":"                        \u0027id\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027,"},{"line_number":135,"context_line":"                        \u0027instance_uuid\u0027:"},{"line_number":136,"context_line":"                            \u00273912f2b4-c5ba-4aec-9165-872876fe202e\u0027,"},{"line_number":137,"context_line":"                        \u0027volumeId\u0027: \u0027a26887c6-c47b-4654-abb5-dfadf7d3f803\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_02c5f03a","line":134,"range":{"start_line":134,"start_character":67,"end_line":134,"end_character":69},"in_reply_to":"3a7e1126_658888e8","updated":"2015-12-17 12:21:38.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                  \u0027snapshot_id\u0027: None,"},{"line_number":121,"context_line":"                  \u0027volume_type_id\u0027: \u0027fakevoltype\u0027,"},{"line_number":122,"context_line":"                  \u0027volume_metadata\u0027: [],"},{"line_number":123,"context_line":"                  \u0027volume_type\u0027: {\u0027name\u0027: \u0027Backup\u0027},"},{"line_number":124,"context_line":"                  \u0027attachments\u0027: {\u00273912f2b4-c5ba-4aec-9165-872876fe202e\u0027:"},{"line_number":125,"context_line":"                                  {\u0027mountpoint\u0027: \u0027/\u0027,"},{"line_number":126,"context_line":"                                   \u0027attachment_id\u0027:"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_7de271a1","line":123,"updated":"2016-01-18 23:04:30.000000000","message":"This is missing the \u0027multiattach\u0027 key. Did you intend that?","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                  \u0027snapshot_id\u0027: None,"},{"line_number":121,"context_line":"                  \u0027volume_type_id\u0027: \u0027fakevoltype\u0027,"},{"line_number":122,"context_line":"                  \u0027volume_metadata\u0027: [],"},{"line_number":123,"context_line":"                  \u0027volume_type\u0027: {\u0027name\u0027: \u0027Backup\u0027},"},{"line_number":124,"context_line":"                  \u0027attachments\u0027: {\u00273912f2b4-c5ba-4aec-9165-872876fe202e\u0027:"},{"line_number":125,"context_line":"                                  {\u0027mountpoint\u0027: \u0027/\u0027,"},{"line_number":126,"context_line":"                                   \u0027attachment_id\u0027:"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a00c4043","line":123,"in_reply_to":"ba63e191_7de271a1","updated":"2016-01-19 00:27:49.000000000","message":"Missed by mistake.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"}],"nova/tests/unit/api/openstack/compute/test_volumes.py":[{"author":{"_account_id":8037,"name":"renminmin","email":"rmm0811@gmail.com","username":"renminmin"},"change_message_id":"c733597a300d86d3be23e0f9d727c39b32a691ab","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027attachments\u0027: [{"},{"line_number":66,"context_line":"                \u0027instance_uuid\u0027: FAKE_UUID,"},{"line_number":67,"context_line":"                \u0027mountpoint\u0027: \u0027/dev/fake0\u0027,"},{"line_number":68,"context_line":"                \u0027id\u0027: FAKE_UUID,"},{"line_number":69,"context_line":"                \u0027volumeId\u0027: FAKE_UUID,"},{"line_number":70,"context_line":"            }]"},{"line_number":71,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_65bba873","line":68,"range":{"start_line":68,"start_character":31,"end_line":68,"end_character":32},"updated":"2015-12-17 09:30:38.000000000","message":"\u0027id\u0027 should be \u0027attachment_id\u0027","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027attachments\u0027: [{"},{"line_number":66,"context_line":"                \u0027instance_uuid\u0027: FAKE_UUID,"},{"line_number":67,"context_line":"                \u0027mountpoint\u0027: \u0027/dev/fake0\u0027,"},{"line_number":68,"context_line":"                \u0027id\u0027: FAKE_UUID,"},{"line_number":69,"context_line":"                \u0027volumeId\u0027: FAKE_UUID,"},{"line_number":70,"context_line":"            }]"},{"line_number":71,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_e2bb04c3","line":68,"range":{"start_line":68,"start_character":31,"end_line":68,"end_character":32},"in_reply_to":"3a7e1126_65bba873","updated":"2015-12-17 12:21:38.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"def fake_get_volume(self, context, id):"},{"line_number":63,"context_line":"    return {\u0027id\u0027: FAKE_UUID_A,"},{"line_number":64,"context_line":"            \u0027status\u0027: \u0027available\u0027,"},{"line_number":65,"context_line":"            \u0027attachments\u0027: {}"},{"line_number":66,"context_line":"            }"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_dde7ddaa","line":65,"updated":"2016-01-18 23:04:30.000000000","message":"A volume with a status of \u0027available\u0027 wouldn\u0027t have an \u0027attachments\u0027 key would it? Perhaps you should add the \u0027attach_status\u0027: \u0027detached\u0027 key here instead of the \u0027attachments\u0027 key?","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":62,"context_line":"def fake_get_volume(self, context, id):"},{"line_number":63,"context_line":"    return {\u0027id\u0027: FAKE_UUID_A,"},{"line_number":64,"context_line":"            \u0027status\u0027: \u0027available\u0027,"},{"line_number":65,"context_line":"            \u0027attachments\u0027: {}"},{"line_number":66,"context_line":"            }"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a33a0acc","line":65,"in_reply_to":"ba63e191_dde7ddaa","updated":"2016-01-19 00:27:49.000000000","message":"Right, will change to that.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"}],"nova/tests/unit/api/openstack/fakes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":587,"context_line":"        \u0027volume_type\u0027: {\u0027name\u0027: \u0027vol_type_name\u0027},"},{"line_number":588,"context_line":"        \u0027multiattach\u0027: True,"},{"line_number":589,"context_line":"        \u0027attachments\u0027: {\u0027fakeuuid\u0027: {\u0027mountpoint\u0027: \u0027/\u0027},"},{"line_number":590,"context_line":"                         \u0027fakeuuid2\u0027: {\u0027mountpoint\u0027: \u0027/dev/sdb\u0027}"},{"line_number":591,"context_line":"                         }}"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    volume.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_024085a4","line":590,"updated":"2016-01-19 16:17:37.000000000","message":"nit: please align the entries in the dict","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":587,"context_line":"        \u0027volume_type\u0027: {\u0027name\u0027: \u0027vol_type_name\u0027},"},{"line_number":588,"context_line":"        \u0027multiattach\u0027: True,"},{"line_number":589,"context_line":"        \u0027attachments\u0027: {\u0027fakeuuid\u0027: {\u0027mountpoint\u0027: \u0027/\u0027},"},{"line_number":590,"context_line":"                         \u0027fakeuuid2\u0027: {\u0027mountpoint\u0027: \u0027/dev/sdb\u0027}"},{"line_number":591,"context_line":"                         }}"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    volume.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_d620ec9d","line":590,"in_reply_to":"ba63e191_024085a4","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":369,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, lambda *a, **kw:"},{"line_number":370,"context_line":"                       {\u0027id\u0027: uuids.volume_id, \u0027size\u0027: 4,"},{"line_number":371,"context_line":"                        \u0027attach_status\u0027: \u0027detached\u0027,"},{"line_number":372,"context_line":"                        \u0027attachments\u0027: {}})"},{"line_number":373,"context_line":"        self.stubs.Set(self.compute.driver, \u0027get_volume_connector\u0027,"},{"line_number":374,"context_line":"                       lambda *a, **kw: None)"},{"line_number":375,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027initialize_connection\u0027,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_7df9114d","line":372,"updated":"2016-01-18 23:04:30.000000000","message":"The volume API specifically does *not* set an \u0027attachments\u0027 key if the attach_status is \u0027detached\u0027.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":369,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027get\u0027, lambda *a, **kw:"},{"line_number":370,"context_line":"                       {\u0027id\u0027: uuids.volume_id, \u0027size\u0027: 4,"},{"line_number":371,"context_line":"                        \u0027attach_status\u0027: \u0027detached\u0027,"},{"line_number":372,"context_line":"                        \u0027attachments\u0027: {}})"},{"line_number":373,"context_line":"        self.stubs.Set(self.compute.driver, \u0027get_volume_connector\u0027,"},{"line_number":374,"context_line":"                       lambda *a, **kw: None)"},{"line_number":375,"context_line":"        self.stubs.Set(self.compute.volume_api, \u0027initialize_connection\u0027,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_43878e61","line":372,"in_reply_to":"ba63e191_7df9114d","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"                        \u0027status\u0027: status,"},{"line_number":1091,"context_line":"                        \u0027attach_status\u0027: attach_status,"},{"line_number":1092,"context_line":"                        \u0027multiattach\u0027: False,"},{"line_number":1093,"context_line":"                        \u0027attachments\u0027: {}}"},{"line_number":1094,"context_line":"            self.stubs.Set(cinder.API, \u0027get\u0027, fake_volume_get)"},{"line_number":1095,"context_line":"            self.assertRaises(exception.InvalidVolume,"},{"line_number":1096,"context_line":"                              self.compute_api._validate_bdm,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_1d9575e3","line":1093,"updated":"2016-01-18 23:04:30.000000000","message":"The \u0027attachments\u0027 key should only be there if the attach_status is \u0027attached\u0027...","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"                        \u0027status\u0027: status,"},{"line_number":1091,"context_line":"                        \u0027attach_status\u0027: attach_status,"},{"line_number":1092,"context_line":"                        \u0027multiattach\u0027: False,"},{"line_number":1093,"context_line":"                        \u0027attachments\u0027: {}}"},{"line_number":1094,"context_line":"            self.stubs.Set(cinder.API, \u0027get\u0027, fake_volume_get)"},{"line_number":1095,"context_line":"            self.assertRaises(exception.InvalidVolume,"},{"line_number":1096,"context_line":"                              self.compute_api._validate_bdm,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a3ce8a81","line":1093,"in_reply_to":"ba63e191_1d9575e3","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"                    \u0027status\u0027: \u0027available\u0027,"},{"line_number":1115,"context_line":"                    \u0027attach_status\u0027: \u0027detached\u0027,"},{"line_number":1116,"context_line":"                    \u0027multiattach\u0027: False,"},{"line_number":1117,"context_line":"                    \u0027attachments\u0027: {}}"},{"line_number":1118,"context_line":"        self.stubs.Set(cinder.API, \u0027get\u0027, fake_volume_get_ok)"},{"line_number":1119,"context_line":""},{"line_number":1120,"context_line":"        self.compute_api._validate_bdm(self.context, self.instance,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_3d9ab915","line":1117,"updated":"2016-01-18 23:04:30.000000000","message":"ditto.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"                    \u0027status\u0027: \u0027available\u0027,"},{"line_number":1115,"context_line":"                    \u0027attach_status\u0027: \u0027detached\u0027,"},{"line_number":1116,"context_line":"                    \u0027multiattach\u0027: False,"},{"line_number":1117,"context_line":"                    \u0027attachments\u0027: {}}"},{"line_number":1118,"context_line":"        self.stubs.Set(cinder.API, \u0027get\u0027, fake_volume_get_ok)"},{"line_number":1119,"context_line":""},{"line_number":1120,"context_line":"        self.compute_api._validate_bdm(self.context, self.instance,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_03b996e9","line":1117,"in_reply_to":"ba63e191_3d9ab915","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1881,"context_line":"            pass"},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1884,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1885,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]:"},{"line_number":1886,"context_line":"                                    {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":1887,"context_line":"                                    }"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_dd9efd06","line":1884,"updated":"2016-01-18 23:04:30.000000000","message":"Should have \u0027attach_status\u0027: \u0027attached\u0027.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1881,"context_line":"            pass"},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1884,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1885,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]:"},{"line_number":1886,"context_line":"                                    {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":1887,"context_line":"                                    }"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_2337fab1","line":1884,"in_reply_to":"ba63e191_dd9efd06","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":9678,"context_line":"        called \u003d {}"},{"line_number":9679,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":9680,"context_line":"        # Set attach_status to \u0027fake\u0027 as nothing is reading the value."},{"line_number":9681,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027fake\u0027,"},{"line_number":9682,"context_line":"                  \u0027attachments\u0027: {instance[\u0027uuid\u0027]: {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":9683,"context_line":"                                  }"},{"line_number":9684,"context_line":"                  }"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_fda3c14d","line":9681,"updated":"2016-01-18 23:04:30.000000000","message":"If the attach_status is \u0027fake\u0027, there should not be an \u0027attachments\u0027 key.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":9678,"context_line":"        called \u003d {}"},{"line_number":9679,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":9680,"context_line":"        # Set attach_status to \u0027fake\u0027 as nothing is reading the value."},{"line_number":9681,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027fake\u0027,"},{"line_number":9682,"context_line":"                  \u0027attachments\u0027: {instance[\u0027uuid\u0027]: {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":9683,"context_line":"                                  }"},{"line_number":9684,"context_line":"                  }"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_43630eb2","line":9681,"in_reply_to":"ba63e191_fda3c14d","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":9712,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9713,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9714,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027detached\u0027, \u0027status\u0027: \u0027available\u0027,"},{"line_number":9715,"context_line":"                  \u0027attachments\u0027: {}}"},{"line_number":9716,"context_line":""},{"line_number":9717,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":9718,"context_line":"                          self.compute_api.detach_volume, self.context,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_9d8965cd","line":9715,"updated":"2016-01-18 23:04:30.000000000","message":"Should not have an \u0027attachments\u0027 key.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":9712,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9713,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9714,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027detached\u0027, \u0027status\u0027: \u0027available\u0027,"},{"line_number":9715,"context_line":"                  \u0027attachments\u0027: {}}"},{"line_number":9716,"context_line":""},{"line_number":9717,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":9718,"context_line":"                          self.compute_api.detach_volume, self.context,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_e357a2c8","line":9715,"in_reply_to":"ba63e191_9d8965cd","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":9727,"context_line":"                    \u0027launched_at\u0027: timeutils.utcnow(),"},{"line_number":9728,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9729,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9730,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027in-use\u0027, \u0027status\u0027: \u0027attached\u0027,"},{"line_number":9731,"context_line":"                  \u0027attachments\u0027: {\u0027fake_uuid\u0027: {\u0027attachment_id\u0027: \u0027fakeid\u0027}}}"},{"line_number":9732,"context_line":""},{"line_number":9733,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_bd86a9b7","line":9730,"updated":"2016-01-18 23:04:30.000000000","message":"The above is incorrect. The \u0027status\u0027 should be \u0027in-use\u0027 and the \u0027attach_status\u0027 should be \u0027attached\u0027. You have it reversed.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":9727,"context_line":"                    \u0027launched_at\u0027: timeutils.utcnow(),"},{"line_number":9728,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9729,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9730,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027in-use\u0027, \u0027status\u0027: \u0027attached\u0027,"},{"line_number":9731,"context_line":"                  \u0027attachments\u0027: {\u0027fake_uuid\u0027: {\u0027attachment_id\u0027: \u0027fakeid\u0027}}}"},{"line_number":9732,"context_line":""},{"line_number":9733,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_636c129d","line":9730,"in_reply_to":"ba63e191_bd86a9b7","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1889,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1890,"context_line":"                    \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":1891,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]:"},{"line_number":1892,"context_line":"                                    {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":1893,"context_line":"                                    }"},{"line_number":1894,"context_line":"                    }"},{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"        def fake_terminate_connection(self, context, volume_id, connector):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_8260f536","line":1893,"range":{"start_line":1891,"start_character":35,"end_line":1893,"end_character":37},"updated":"2016-01-19 16:17:37.000000000","message":"The formatting here hurts my eyes.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1889,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1890,"context_line":"                    \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":1891,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]:"},{"line_number":1892,"context_line":"                                    {\u0027attachment_id\u0027: \u0027abc123\u0027}"},{"line_number":1893,"context_line":"                                    }"},{"line_number":1894,"context_line":"                    }"},{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"        def fake_terminate_connection(self, context, volume_id, connector):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b321cab6","line":1893,"range":{"start_line":1891,"start_character":35,"end_line":1893,"end_character":37},"in_reply_to":"ba63e191_8260f536","updated":"2016-01-19 17:07:31.000000000","message":"Sorry. :)","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":9806,"context_line":"        # and manager gets to call bdm.destroy()"},{"line_number":9807,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":9808,"context_line":"            return {\u0027id\u0027: volume_id}"},{"line_number":9809,"context_line":"        self.stubs.Set(cinder.API, \"get\", fake_volume_get)"},{"line_number":9810,"context_line":""},{"line_number":9811,"context_line":"        with test.nested("},{"line_number":9812,"context_line":"            mock.patch.object(self.compute.driver, \u0027detach_volume\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_e24bf1ae","line":9809,"range":{"start_line":9809,"start_character":8,"end_line":9809,"end_character":22},"updated":"2016-01-19 16:17:37.000000000","message":"Please use self.stub_out for new testing, we are trying to stop using self.stubs.Set since it relies on mox which is racy with py34 testing.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":9806,"context_line":"        # and manager gets to call bdm.destroy()"},{"line_number":9807,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":9808,"context_line":"            return {\u0027id\u0027: volume_id}"},{"line_number":9809,"context_line":"        self.stubs.Set(cinder.API, \"get\", fake_volume_get)"},{"line_number":9810,"context_line":""},{"line_number":9811,"context_line":"        with test.nested("},{"line_number":9812,"context_line":"            mock.patch.object(self.compute.driver, \u0027detach_volume\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_361628a8","line":9809,"range":{"start_line":9809,"start_character":8,"end_line":9809,"end_character":22},"in_reply_to":"ba63e191_e24bf1ae","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1889,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1890,"context_line":"                    \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":1891,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]: {"},{"line_number":1892,"context_line":"                                       \u0027attachment_id\u0027: \u0027abc123\u0027"},{"line_number":1893,"context_line":"                                        }"},{"line_number":1894,"context_line":"                                    }"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_7fd10afb","line":1891,"range":{"start_line":1891,"start_character":36,"end_line":1891,"end_character":52},"updated":"2016-01-20 15:39:57.000000000","message":"instance is an object, so use dot notation:\n\ninstance.uuid\n\nWe are working on removing DictCompat from the objects so don\u0027t want to add more of this.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":1888,"context_line":"        def fake_volume_get(self, context, volume_id):"},{"line_number":1889,"context_line":"            return {\u0027id\u0027: volume_id,"},{"line_number":1890,"context_line":"                    \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":1891,"context_line":"                    \u0027attachments\u0027: {instance[\u0027uuid\u0027]: {"},{"line_number":1892,"context_line":"                                       \u0027attachment_id\u0027: \u0027abc123\u0027"},{"line_number":1893,"context_line":"                                        }"},{"line_number":1894,"context_line":"                                    }"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_829ca26a","line":1891,"range":{"start_line":1891,"start_character":36,"end_line":1891,"end_character":52},"in_reply_to":"9a68dd71_7fd10afb","updated":"2016-01-20 18:09:16.000000000","message":"Done","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":9827,"context_line":"        ) as (mock_detach_volume, mock_volume, mock_terminate_connection,"},{"line_number":9828,"context_line":"              mock_destroy, mock_notify, mock_detach, mock_volume_connector):"},{"line_number":9829,"context_line":"            self.compute.detach_volume(self.context, \u0027fake-id\u0027, instance,"},{"line_number":9830,"context_line":"                                       None)"},{"line_number":9831,"context_line":"            self.assertTrue(mock_detach_volume.called)"},{"line_number":9832,"context_line":"            mock_terminate_connection.assert_called_once_with(self.context,"},{"line_number":9833,"context_line":"                                                              \u0027fake-id\u0027,"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_bf34624a","line":9830,"range":{"start_line":9830,"start_character":39,"end_line":9830,"end_character":43},"updated":"2016-01-20 15:39:57.000000000","message":"This is an optional kwarg right? So we don\u0027t actually have to specify None here as it\u0027s the default.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":9827,"context_line":"        ) as (mock_detach_volume, mock_volume, mock_terminate_connection,"},{"line_number":9828,"context_line":"              mock_destroy, mock_notify, mock_detach, mock_volume_connector):"},{"line_number":9829,"context_line":"            self.compute.detach_volume(self.context, \u0027fake-id\u0027, instance,"},{"line_number":9830,"context_line":"                                       None)"},{"line_number":9831,"context_line":"            self.assertTrue(mock_detach_volume.called)"},{"line_number":9832,"context_line":"            mock_terminate_connection.assert_called_once_with(self.context,"},{"line_number":9833,"context_line":"                                                              \u0027fake-id\u0027,"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_73effeb0","line":9830,"range":{"start_line":9830,"start_character":39,"end_line":9830,"end_character":43},"in_reply_to":"9a68dd71_bf34624a","updated":"2016-01-20 18:09:16.000000000","message":"Done","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":9834,"context_line":"                                                              \u0027fake-connector\u0027)"},{"line_number":9835,"context_line":"            mock_destroy.assert_called_once_with()"},{"line_number":9836,"context_line":"            mock_detach.assert_called_once_with(mock.ANY, \u0027fake-id\u0027,"},{"line_number":9837,"context_line":"                                                instance.uuid, None)"},{"line_number":9838,"context_line":""},{"line_number":9839,"context_line":"    def test_terminate_with_volumes(self):"},{"line_number":9840,"context_line":"        # Make sure that volumes get detached during instance termination."}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_df391643","line":9837,"range":{"start_line":9837,"start_character":63,"end_line":9837,"end_character":67},"updated":"2016-01-20 15:39:57.000000000","message":"ditto","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":9834,"context_line":"                                                              \u0027fake-connector\u0027)"},{"line_number":9835,"context_line":"            mock_destroy.assert_called_once_with()"},{"line_number":9836,"context_line":"            mock_detach.assert_called_once_with(mock.ANY, \u0027fake-id\u0027,"},{"line_number":9837,"context_line":"                                                instance.uuid, None)"},{"line_number":9838,"context_line":""},{"line_number":9839,"context_line":"    def test_terminate_with_volumes(self):"},{"line_number":9840,"context_line":"        # Make sure that volumes get detached during instance termination."}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_b33c9630","line":9837,"range":{"start_line":9837,"start_character":63,"end_line":9837,"end_character":67},"in_reply_to":"9a68dd71_df391643","updated":"2016-01-20 18:09:16.000000000","message":"Assert needs it as the function is called with None.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":11459,"context_line":"        # make sure volumes attach, detach are called"},{"line_number":11460,"context_line":"        self.mox.StubOutWithMock(self.compute.volume_api, \u0027detach\u0027)"},{"line_number":11461,"context_line":"        self.compute.volume_api.detach(mox.IsA(self.context), mox.IgnoreArg(),"},{"line_number":11462,"context_line":"                                       mox.IgnoreArg(), None)"},{"line_number":11463,"context_line":""},{"line_number":11464,"context_line":"        self.mox.StubOutWithMock(self.compute, \u0027_prep_block_device\u0027)"},{"line_number":11465,"context_line":"        self.compute._prep_block_device(mox.IsA(self.context),"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_1f7ecee4","line":11462,"range":{"start_line":11462,"start_character":56,"end_line":11462,"end_character":60},"updated":"2016-01-20 15:39:57.000000000","message":"Is None needed here?","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":11459,"context_line":"        # make sure volumes attach, detach are called"},{"line_number":11460,"context_line":"        self.mox.StubOutWithMock(self.compute.volume_api, \u0027detach\u0027)"},{"line_number":11461,"context_line":"        self.compute.volume_api.detach(mox.IsA(self.context), mox.IgnoreArg(),"},{"line_number":11462,"context_line":"                                       mox.IgnoreArg(), None)"},{"line_number":11463,"context_line":""},{"line_number":11464,"context_line":"        self.mox.StubOutWithMock(self.compute, \u0027_prep_block_device\u0027)"},{"line_number":11465,"context_line":"        self.compute._prep_block_device(mox.IsA(self.context),"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_d30b4a7c","line":11462,"range":{"start_line":11462,"start_character":56,"end_line":11462,"end_character":60},"in_reply_to":"9a68dd71_1f7ecee4","updated":"2016-01-20 18:09:16.000000000","message":"It\u0027s needed here too.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"                                  \u0027size\u0027: 5,"},{"line_number":1802,"context_line":"                                  \u0027status\u0027: \u0027available\u0027,"},{"line_number":1803,"context_line":"                                  \u0027multiattach\u0027: False,"},{"line_number":1804,"context_line":"                                  \u0027attachments\u0027: {}}"},{"line_number":1805,"context_line":"        self.assertRaises(exception.InstanceInvalidState,"},{"line_number":1806,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":1807,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_fdec2191","line":1804,"updated":"2016-01-18 23:04:30.000000000","message":"Should not have \u0027attachments\u0027 key since attach_status is \u0027detached\u0027","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"                                  \u0027size\u0027: 5,"},{"line_number":1802,"context_line":"                                  \u0027status\u0027: \u0027available\u0027,"},{"line_number":1803,"context_line":"                                  \u0027multiattach\u0027: False,"},{"line_number":1804,"context_line":"                                  \u0027attachments\u0027: {}}"},{"line_number":1805,"context_line":"        self.assertRaises(exception.InstanceInvalidState,"},{"line_number":1806,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":1807,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_03b0b6f3","line":1804,"in_reply_to":"ba63e191_fdec2191","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fb1fae6ca2479c403eaf4d45128432453a351e06","unresolved":false,"context_lines":[{"line_number":1819,"context_line":""},{"line_number":1820,"context_line":"        # Should fail if old volume\u0027s instance_uuid is not that of the instance"},{"line_number":1821,"context_line":"        volumes[old_volume_id][\u0027attachments\u0027] \u003d {uuids.vol_instance_2:"},{"line_number":1822,"context_line":"                                                 {\u0027attachment_id\u0027: \u0027fakeid\u0027}}"},{"line_number":1823,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":1824,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":1825,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_74f9264d","line":1822,"updated":"2016-01-19 01:41:01.000000000","message":"@ildiko: Ah, gotcha.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1819,"context_line":""},{"line_number":1820,"context_line":"        # Should fail if old volume\u0027s instance_uuid is not that of the instance"},{"line_number":1821,"context_line":"        volumes[old_volume_id][\u0027attachments\u0027] \u003d {uuids.vol_instance_2:"},{"line_number":1822,"context_line":"                                                 {\u0027attachment_id\u0027: \u0027fakeid\u0027}}"},{"line_number":1823,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":1824,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":1825,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_9d02c53d","line":1822,"updated":"2016-01-18 23:04:30.000000000","message":"There should not be an \u0027attachments\u0027 key here since the old_volume above has a \u0027detached\u0027 attach_status.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1819,"context_line":""},{"line_number":1820,"context_line":"        # Should fail if old volume\u0027s instance_uuid is not that of the instance"},{"line_number":1821,"context_line":"        volumes[old_volume_id][\u0027attachments\u0027] \u003d {uuids.vol_instance_2:"},{"line_number":1822,"context_line":"                                                 {\u0027attachment_id\u0027: \u0027fakeid\u0027}}"},{"line_number":1823,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":1824,"context_line":"                          self.compute_api.swap_volume, self.context, instance,"},{"line_number":1825,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_438d4e30","line":1822,"in_reply_to":"ba63e191_9d02c53d","updated":"2016-01-19 00:27:49.000000000","message":"It\u0027s set to \u0027attached\u0027 in line 1818.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1825,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"},{"line_number":1826,"context_line":"        self.assertEqual(volumes[old_volume_id][\u0027status\u0027], \u0027in-use\u0027)"},{"line_number":1827,"context_line":"        self.assertEqual(volumes[new_volume_id][\u0027status\u0027], \u0027available\u0027)"},{"line_number":1828,"context_line":"        volumes[old_volume_id][\u0027attachments\u0027] \u003d {uuids.vol_instance:"},{"line_number":1829,"context_line":"                                                 {\u0027attachment_id\u0027: \u0027fakeid\u0027}}"},{"line_number":1830,"context_line":""},{"line_number":1831,"context_line":"        # Should fail if new volume is attached"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_bdff8933","line":1828,"updated":"2016-01-18 23:04:30.000000000","message":"ditto.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1825,"context_line":"                          volumes[old_volume_id], volumes[new_volume_id])"},{"line_number":1826,"context_line":"        self.assertEqual(volumes[old_volume_id][\u0027status\u0027], \u0027in-use\u0027)"},{"line_number":1827,"context_line":"        self.assertEqual(volumes[new_volume_id][\u0027status\u0027], \u0027available\u0027)"},{"line_number":1828,"context_line":"        volumes[old_volume_id][\u0027attachments\u0027] \u003d {uuids.vol_instance:"},{"line_number":1829,"context_line":"                                                 {\u0027attachment_id\u0027: \u0027fakeid\u0027}}"},{"line_number":1830,"context_line":""},{"line_number":1831,"context_line":"        # Should fail if new volume is attached"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_03875610","line":1828,"in_reply_to":"ba63e191_bdff8933","updated":"2016-01-19 00:27:49.000000000","message":"Same here","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":1790,"context_line":"                                  \u0027size\u0027: 5,"},{"line_number":1791,"context_line":"                                  \u0027status\u0027: \u0027in-use\u0027,"},{"line_number":1792,"context_line":"                                  \u0027multiattach\u0027: False,"},{"line_number":1793,"context_line":"                                  \u0027attachments\u0027: {uuids.vol_instance:"},{"line_number":1794,"context_line":"                                                  {\u0027attachment_id\u0027: \u0027fakeid\u0027}"},{"line_number":1795,"context_line":"                                                  }"},{"line_number":1796,"context_line":"                                  }"},{"line_number":1797,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1798,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_8263151a","line":1795,"range":{"start_line":1793,"start_character":49,"end_line":1795,"end_character":50},"updated":"2016-01-19 16:17:37.000000000","message":"Formatting could be better, something like this:\n\n  \u0027attachments\u0027: {uuids.vol_instance: {\n                    \u0027attachment_id\u0027: \u0027fakeid\u0027\n                 }\n  }","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":1790,"context_line":"                                  \u0027size\u0027: 5,"},{"line_number":1791,"context_line":"                                  \u0027status\u0027: \u0027in-use\u0027,"},{"line_number":1792,"context_line":"                                  \u0027multiattach\u0027: False,"},{"line_number":1793,"context_line":"                                  \u0027attachments\u0027: {uuids.vol_instance:"},{"line_number":1794,"context_line":"                                                  {\u0027attachment_id\u0027: \u0027fakeid\u0027}"},{"line_number":1795,"context_line":"                                                  }"},{"line_number":1796,"context_line":"                                  }"},{"line_number":1797,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1798,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_935fe640","line":1795,"range":{"start_line":1793,"start_character":49,"end_line":1795,"end_character":50},"in_reply_to":"ba63e191_8263151a","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1665,"context_line":"                                  \u0027display_name\u0027: \u0027old_volume\u0027,"},{"line_number":1666,"context_line":"                                  \u0027status\u0027: \u0027detaching\u0027,"},{"line_number":1667,"context_line":"                                  \u0027size\u0027: 1,"},{"line_number":1668,"context_line":"                                  \u0027attachments\u0027: {\u0027fake\u0027:"},{"line_number":1669,"context_line":"                                                  {\u0027attachment_id\u0027: \u0027abc123\u0027}}"},{"line_number":1670,"context_line":"                                  }"},{"line_number":1671,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_5d93edfa","line":1668,"updated":"2016-01-18 23:04:30.000000000","message":"this has no \u0027attach_status\u0027 so it\u0027s impossible to tell whether \u0027attachments\u0027 key should exist or not. Best to leave it off IMHO.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1665,"context_line":"                                  \u0027display_name\u0027: \u0027old_volume\u0027,"},{"line_number":1666,"context_line":"                                  \u0027status\u0027: \u0027detaching\u0027,"},{"line_number":1667,"context_line":"                                  \u0027size\u0027: 1,"},{"line_number":1668,"context_line":"                                  \u0027attachments\u0027: {\u0027fake\u0027:"},{"line_number":1669,"context_line":"                                                  {\u0027attachment_id\u0027: \u0027abc123\u0027}}"},{"line_number":1670,"context_line":"                                  }"},{"line_number":1671,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a3a3ea9d","line":1668,"in_reply_to":"ba63e191_5d93edfa","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":1671,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1672,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"},{"line_number":1673,"context_line":"                                  \u0027display_name\u0027: \u0027new_volume\u0027,"},{"line_number":1674,"context_line":"                                  \u0027status\u0027: \u0027available\u0027,"},{"line_number":1675,"context_line":"                                  \u0027size\u0027: 2,"},{"line_number":1676,"context_line":"                                  \u0027attachments\u0027: {}}"},{"line_number":1677,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_7d9031ed","line":1674,"updated":"2016-01-18 23:04:30.000000000","message":"No \u0027attach_status\u0027: \u0027attached\u0027 and therefore it\u0027s not clear whether there should be an \u0027attachments\u0027 key.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":1671,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1672,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"},{"line_number":1673,"context_line":"                                  \u0027display_name\u0027: \u0027new_volume\u0027,"},{"line_number":1674,"context_line":"                                  \u0027status\u0027: \u0027available\u0027,"},{"line_number":1675,"context_line":"                                  \u0027size\u0027: 2,"},{"line_number":1676,"context_line":"                                  \u0027attachments\u0027: {}}"},{"line_number":1677,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_8373464d","line":1674,"in_reply_to":"ba63e191_7d9031ed","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":1665,"context_line":"                                  \u0027display_name\u0027: \u0027old_volume\u0027,"},{"line_number":1666,"context_line":"                                  \u0027status\u0027: \u0027detaching\u0027,"},{"line_number":1667,"context_line":"                                  \u0027size\u0027: 1"},{"line_number":1668,"context_line":"                                  }"},{"line_number":1669,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1670,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"},{"line_number":1671,"context_line":"                                  \u0027display_name\u0027: \u0027new_volume\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_824a3582","line":1668,"updated":"2016-01-19 16:17:37.000000000","message":"This looks like an unnecessary change.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":1665,"context_line":"                                  \u0027display_name\u0027: \u0027old_volume\u0027,"},{"line_number":1666,"context_line":"                                  \u0027status\u0027: \u0027detaching\u0027,"},{"line_number":1667,"context_line":"                                  \u0027size\u0027: 1"},{"line_number":1668,"context_line":"                                  }"},{"line_number":1669,"context_line":"        new_volume_id \u003d uuidutils.generate_uuid()"},{"line_number":1670,"context_line":"        volumes[new_volume_id] \u003d {\u0027id\u0027: new_volume_id,"},{"line_number":1671,"context_line":"                                  \u0027display_name\u0027: \u0027new_volume\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_73683288","line":1668,"in_reply_to":"ba63e191_824a3582","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"        volume_id \u003d \u0027123\u0027"},{"line_number":2206,"context_line":"        inst_obj \u003d mock.Mock()"},{"line_number":2207,"context_line":"        inst_obj.uuid \u003d \u0027uuid\u0027"},{"line_number":2208,"context_line":"        attachment_id \u003d \u0027fake_id\u0027"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"        bdm \u003d mock.MagicMock(spec\u003dobjects.BlockDeviceMapping)"},{"line_number":2211,"context_line":"        bdm.device_name \u003d \u0027vdb\u0027"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_42443d73","line":2208,"range":{"start_line":2208,"start_character":25,"end_line":2208,"end_character":32},"updated":"2016-01-19 16:17:37.000000000","message":"nit: would be better to use a real uuid value, we\u0027re also moving to use real uuid values in our tests when possible.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":2205,"context_line":"        volume_id \u003d \u0027123\u0027"},{"line_number":2206,"context_line":"        inst_obj \u003d mock.Mock()"},{"line_number":2207,"context_line":"        inst_obj.uuid \u003d \u0027uuid\u0027"},{"line_number":2208,"context_line":"        attachment_id \u003d \u0027fake_id\u0027"},{"line_number":2209,"context_line":""},{"line_number":2210,"context_line":"        bdm \u003d mock.MagicMock(spec\u003dobjects.BlockDeviceMapping)"},{"line_number":2211,"context_line":"        bdm.device_name \u003d \u0027vdb\u0027"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_76e1009a","line":2208,"range":{"start_line":2208,"start_character":25,"end_line":2208,"end_character":32},"in_reply_to":"ba63e191_42443d73","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/tests/unit/compute/test_rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    def test_detach_volume(self):"},{"line_number":199,"context_line":"        self._test_compute_api(\u0027detach_volume\u0027, \u0027cast\u0027,"},{"line_number":200,"context_line":"                instance\u003dself.fake_instance_obj, volume_id\u003d\u0027id\u0027,"},{"line_number":201,"context_line":"                attachment_id\u003d\u0027fake_id\u0027, version\u003d\u00274.7\u0027)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def test_finish_resize(self):"},{"line_number":204,"context_line":"        self._test_compute_api(\u0027finish_resize\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_c22fcd9f","line":201,"updated":"2016-01-19 16:17:37.000000000","message":"We need a unit test for the \u003c4.7 compat code to make sure we are popping off the attachment_id.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":198,"context_line":"    def test_detach_volume(self):"},{"line_number":199,"context_line":"        self._test_compute_api(\u0027detach_volume\u0027, \u0027cast\u0027,"},{"line_number":200,"context_line":"                instance\u003dself.fake_instance_obj, volume_id\u003d\u0027id\u0027,"},{"line_number":201,"context_line":"                attachment_id\u003d\u0027fake_id\u0027, version\u003d\u00274.7\u0027)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def test_finish_resize(self):"},{"line_number":204,"context_line":"        self._test_compute_api(\u0027finish_resize\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_f37f4264","line":201,"in_reply_to":"ba63e191_c22fcd9f","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/tests/unit/fake_volume.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            \u0027provider_location\u0027: \u0027fake-location\u0027,"},{"line_number":68,"context_line":"            \u0027provider_auth\u0027: \u0027fake-auth\u0027,"},{"line_number":69,"context_line":"            \u0027volume_type_id\u0027: 99,"},{"line_number":70,"context_line":"            \u0027attachments\u0027: {},"},{"line_number":71,"context_line":"            \u0027multiattach\u0027: False"},{"line_number":72,"context_line":"            }"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_1deed58b","line":70,"updated":"2016-01-18 23:04:30.000000000","message":"attach_status is \u0027detached\u0027 and therefore \u0027attachments\u0027 key should not exist.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            \u0027provider_location\u0027: \u0027fake-location\u0027,"},{"line_number":68,"context_line":"            \u0027provider_auth\u0027: \u0027fake-auth\u0027,"},{"line_number":69,"context_line":"            \u0027volume_type_id\u0027: 99,"},{"line_number":70,"context_line":"            \u0027attachments\u0027: {},"},{"line_number":71,"context_line":"            \u0027multiattach\u0027: False"},{"line_number":72,"context_line":"            }"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_c3c7fe43","line":70,"in_reply_to":"ba63e191_1deed58b","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":227,"context_line":"        volume \u003d self.get(context, volume_id)"},{"line_number":228,"context_line":"        volume[\u0027status\u0027] \u003d \u0027available\u0027"},{"line_number":229,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":230,"context_line":"        volume[\u0027attachments\u0027] \u003d {}"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def initialize_connection(self, context, volume_id, connector):"},{"line_number":233,"context_line":"        return {\u0027driver_volume_type\u0027: \u0027iscsi\u0027, \u0027data\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_3df39975","line":230,"updated":"2016-01-18 23:04:30.000000000","message":"There should not be an \u0027attachments\u0027 key if attach_stats is \u0027detached\u0027.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":227,"context_line":"        volume \u003d self.get(context, volume_id)"},{"line_number":228,"context_line":"        volume[\u0027status\u0027] \u003d \u0027available\u0027"},{"line_number":229,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":230,"context_line":"        volume[\u0027attachments\u0027] \u003d {}"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def initialize_connection(self, context, volume_id, connector):"},{"line_number":233,"context_line":"        return {\u0027driver_volume_type\u0027: \u0027iscsi\u0027, \u0027data\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_e3e6c2e7","line":230,"in_reply_to":"ba63e191_3df39975","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                msg \u003d \"Instance and volume not in same availability_zone\""},{"line_number":195,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":198,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":199,"context_line":"            msg \u003d \"already detached\""},{"line_number":200,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        if volume[\u0027attach_status\u0027] \u003d\u003d \u0027detached\u0027:"},{"line_number":203,"context_line":"            msg \u003d \"Volume must be attached in order to detach.\""},{"line_number":204,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        if instance and not volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":207,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def attach(self, context, volume_id, instance_uuid, mountpoint, mode\u003d\u0027rw\u0027):"},{"line_number":210,"context_line":"        LOG.info(\u0027attaching volume %s\u0027, volume_id)"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_020de53d","line":207,"range":{"start_line":197,"start_character":4,"end_line":207,"end_character":68},"updated":"2016-01-19 16:17:37.000000000","message":"Wow, this is identical to the code that\u0027s actually in the volume_api, I\u0027m not sure why we even have this in here...","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                msg \u003d \"Instance and volume not in same availability_zone\""},{"line_number":195,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":198,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":199,"context_line":"            msg \u003d \"already detached\""},{"line_number":200,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        if volume[\u0027attach_status\u0027] \u003d\u003d \u0027detached\u0027:"},{"line_number":203,"context_line":"            msg \u003d \"Volume must be attached in order to detach.\""},{"line_number":204,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        if instance and not volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":207,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def attach(self, context, volume_id, instance_uuid, mountpoint, mode\u003d\u0027rw\u0027):"},{"line_number":210,"context_line":"        LOG.info(\u0027attaching volume %s\u0027, volume_id)"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_5363aedc","line":207,"range":{"start_line":197,"start_character":4,"end_line":207,"end_character":68},"in_reply_to":"ba63e191_020de53d","updated":"2016-01-19 17:07:31.000000000","message":"Just let me know what to do with it I followed the pattern that\u0027s given here. The only difference I could see is to remove the translation from msg...","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"}],"nova/tests/unit/volume/test_cinder.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def test_check_attach_volume_already_attached(self):"},{"line_number":137,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake\u0027, \u0027status\u0027: \u0027available\u0027,"},{"line_number":138,"context_line":"                  \u0027multiattach\u0027: False}"},{"line_number":139,"context_line":"        volume[\u0027attach_status\u0027] \u003d \"attached\""},{"line_number":140,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":141,"context_line":"                          self.api.check_attach, self.ctx, volume)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_96cfdeaf","line":138,"updated":"2015-12-17 11:38:25.000000000","message":"would be nice to have the unit tests that don\u0027t specify mutliattach, to model older cinders?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def test_check_attach_volume_already_attached(self):"},{"line_number":137,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake\u0027, \u0027status\u0027: \u0027available\u0027,"},{"line_number":138,"context_line":"                  \u0027multiattach\u0027: False}"},{"line_number":139,"context_line":"        volume[\u0027attach_status\u0027] \u003d \"attached\""},{"line_number":140,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":141,"context_line":"                          self.api.check_attach, self.ctx, volume)"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_cd02770b","line":138,"in_reply_to":"3a7e1126_171be873","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def test_check_attach_volume_already_attached(self):"},{"line_number":137,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake\u0027, \u0027status\u0027: \u0027available\u0027,"},{"line_number":138,"context_line":"                  \u0027multiattach\u0027: False}"},{"line_number":139,"context_line":"        volume[\u0027attach_status\u0027] \u003d \"attached\""},{"line_number":140,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":141,"context_line":"                          self.api.check_attach, self.ctx, volume)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_171be873","line":138,"in_reply_to":"3a7e1126_96cfdeaf","updated":"2015-12-17 12:21:38.000000000","message":"I will remove to set it directly to False.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                             availability_zone\u003d\u0027cinder\u0027)"},{"line_number":148,"context_line":"        volume[\u0027multiattach\u0027] \u003d True"},{"line_number":149,"context_line":"        volume[\u0027status\u0027] \u003d \u0027in-use\u0027"},{"line_number":150,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":151,"context_line":"        volume[\u0027attachments\u0027] \u003d [{\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":152,"context_line":"                               \u0027attach_status\u0027: \u0027attached\u0027}]"},{"line_number":153,"context_line":"        self.assertRaises(exception.InvalidVolume,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_16ef6ee9","line":150,"updated":"2015-12-17 11:38:25.000000000","message":"You haven\u0027t tested multi-attach and not \"available\", can we please add that test here.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                             availability_zone\u003d\u0027cinder\u0027)"},{"line_number":148,"context_line":"        volume[\u0027multiattach\u0027] \u003d True"},{"line_number":149,"context_line":"        volume[\u0027status\u0027] \u003d \u0027in-use\u0027"},{"line_number":150,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":151,"context_line":"        volume[\u0027attachments\u0027] \u003d [{\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":152,"context_line":"                               \u0027attach_status\u0027: \u0027attached\u0027}]"},{"line_number":153,"context_line":"        self.assertRaises(exception.InvalidVolume,"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_ad07eb1a","line":150,"in_reply_to":"3a7e1126_16ef6ee9","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":151,"context_line":"        volume[\u0027attachments\u0027] \u003d [{\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":152,"context_line":"                               \u0027attach_status\u0027: \u0027attached\u0027}]"},{"line_number":153,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":154,"context_line":"                          self.api.check_attach, self.ctx, volume, instance)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def test_check_attach_availability_zone_differs(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_d6e246d5","line":153,"updated":"2015-12-17 11:38:25.000000000","message":"You haven\u0027t got a unit test for the other case, where its valid to have multiple attaches, because the new attach is for a different instance-uuid.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"17f0c20e00861f0210c1155107c10d54ddb79581","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":151,"context_line":"        volume[\u0027attachments\u0027] \u003d [{\u0027instance_uuid\u0027: instance.uuid,"},{"line_number":152,"context_line":"                               \u0027attach_status\u0027: \u0027attached\u0027}]"},{"line_number":153,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":154,"context_line":"                          self.api.check_attach, self.ctx, volume, instance)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def test_check_attach_availability_zone_differs(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_9746f821","line":153,"in_reply_to":"3a7e1126_d6e246d5","updated":"2015-12-17 12:21:38.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        self.cinderclient.volumes.detach(\u0027id1\u0027, \u0027abc123\u0027)"},{"line_number":280,"context_line":"        self.mox.ReplayAll()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        self.api.detach(self.ctx, \u0027id1\u0027, \u0027abc123\u0027)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def test_initialize_connection(self):"},{"line_number":285,"context_line":"        cinder.cinderclient(self.ctx).AndReturn(self.cinderclient)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_36f94a81","line":282,"updated":"2015-12-17 11:38:25.000000000","message":"Erm, doesn\u0027t seem like you have tested get_volume_attachment method here, although honestly I would like to see that method hidden inside the detach.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        self.cinderclient.volumes.detach(\u0027id1\u0027, \u0027abc123\u0027)"},{"line_number":280,"context_line":"        self.mox.ReplayAll()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        self.api.detach(self.ctx, \u0027id1\u0027, \u0027abc123\u0027)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    def test_initialize_connection(self):"},{"line_number":285,"context_line":"        cinder.cinderclient(self.ctx).AndReturn(self.cinderclient)"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_6a91d746","line":282,"in_reply_to":"3a7e1126_36f94a81","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                  }"},{"line_number":191,"context_line":"        self.assertIsNone(self.api.check_detach(self.ctx, volume))"},{"line_number":192,"context_line":"        instance \u003d fake_instance_obj(self.ctx)"},{"line_number":193,"context_line":"        instance.uuid \u003d \u0027fake_uuid\u0027"},{"line_number":194,"context_line":"        self.assertIsNone(self.api.check_detach(self.ctx, volume, instance))"},{"line_number":195,"context_line":"        instance.uuid \u003d \u0027fake_uuid2\u0027"},{"line_number":196,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b092209e","line":193,"range":{"start_line":193,"start_character":8,"end_line":193,"end_character":35},"updated":"2016-01-19 16:17:37.000000000","message":"We should use real uuid\u0027s, we want to eventually make the Instance.uuid field in the object a UUID type, rather than free-form string.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                  }"},{"line_number":191,"context_line":"        self.assertIsNone(self.api.check_detach(self.ctx, volume))"},{"line_number":192,"context_line":"        instance \u003d fake_instance_obj(self.ctx)"},{"line_number":193,"context_line":"        instance.uuid \u003d \u0027fake_uuid\u0027"},{"line_number":194,"context_line":"        self.assertIsNone(self.api.check_detach(self.ctx, volume, instance))"},{"line_number":195,"context_line":"        instance.uuid \u003d \u0027fake_uuid2\u0027"},{"line_number":196,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b93d2bbd","line":193,"range":{"start_line":193,"start_character":8,"end_line":193,"end_character":35},"in_reply_to":"ba63e191_b092209e","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a3311bd011d99c1204b217394cb42f185e6ba7d7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":205,"context_line":"                          self.api.check_detach, self.ctx, volume)"},{"line_number":206,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":207,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":208,"context_line":"                          self.api.check_detach, self.ctx, volume)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def test_reserve_volume(self):"}],"source_content_type":"text/x-python","patch_set":82,"id":"9a68dd71_f71ad56d","line":207,"updated":"2016-01-21 09:50:38.000000000","message":"Micro Nit: I prefer one assert per test, for this kind of thing, so its easier to debug them.","commit_id":"cb3a6bfe1abde63c7e20524ed99b569d4a68d35e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ffdc23d25ac623a6cb00c5b6207c1defcc1f8f69","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":205,"context_line":"                          self.api.check_detach, self.ctx, volume)"},{"line_number":206,"context_line":"        volume[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":207,"context_line":"        self.assertRaises(exception.InvalidVolume,"},{"line_number":208,"context_line":"                          self.api.check_detach, self.ctx, volume)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def test_reserve_volume(self):"}],"source_content_type":"text/x-python","patch_set":82,"id":"9a68dd71_98dce1e5","line":207,"in_reply_to":"9a68dd71_f71ad56d","updated":"2016-01-21 12:28:07.000000000","message":"The swap_volume tests using the same structure like here, it\u0027s easier in the way that the tests/asserts are using almost the same input data. If it\u0027s an issue I can refactor this in a subsequent patch.","commit_id":"cb3a6bfe1abde63c7e20524ed99b569d4a68d35e"}],"nova/virt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"497270acb692895a7e3278882678dfd7e22a4f2a","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        \"has_imagecache\": False,"},{"line_number":168,"context_line":"        \"supports_recreate\": False,"},{"line_number":169,"context_line":"        \"supports_migrate_to_same_host\": False,"},{"line_number":170,"context_line":"        \"supports_multiattach\": False"},{"line_number":171,"context_line":"    }"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __init__(self, virtapi):"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_267a7d25","line":170,"range":{"start_line":170,"start_character":9,"end_line":170,"end_character":29},"updated":"2016-01-12 21:08:17.000000000","message":"Where is this checked?","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"176b0114b42c605bdebec1880f89772a012b46aa","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        \"has_imagecache\": False,"},{"line_number":168,"context_line":"        \"supports_recreate\": False,"},{"line_number":169,"context_line":"        \"supports_migrate_to_same_host\": False,"},{"line_number":170,"context_line":"        \"supports_multiattach\": False"},{"line_number":171,"context_line":"    }"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __init__(self, virtapi):"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_a67e6de2","line":170,"range":{"start_line":170,"start_character":9,"end_line":170,"end_character":29},"in_reply_to":"da6ed579_267a7d25","updated":"2016-01-12 21:12:50.000000000","message":"Oh I see it\u0027s in the 3rd change in the series:\n\nhttps://review.openstack.org/#/c/193135/74/nova/virt/block_device.py\n\nThat should probably be checked in this change where it\u0027s introduced - then the 3rd change is really just adding the support to the libvirt driver.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5e59d806c1e087edb74f245b7af29388958d0c4b","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        \"has_imagecache\": False,"},{"line_number":168,"context_line":"        \"supports_recreate\": False,"},{"line_number":169,"context_line":"        \"supports_migrate_to_same_host\": False,"},{"line_number":170,"context_line":"        \"supports_multiattach\": False"},{"line_number":171,"context_line":"    }"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __init__(self, virtapi):"}],"source_content_type":"text/x-python","patch_set":65,"id":"da6ed579_f4a2ce4a","line":170,"range":{"start_line":170,"start_character":9,"end_line":170,"end_character":29},"in_reply_to":"da6ed579_a67e6de2","updated":"2016-01-12 22:45:46.000000000","message":"As agreed on IRC earlier, I will move the definition of the flag to the next patch, where it is checked.","commit_id":"2f539dc90bf630cee86cb84e3b6506da314d9efe"}],"nova/volume/cinder.py":[{"author":{"_account_id":13002,"name":"Shyama","email":"shyvenug@in.ibm.com","username":"shyama"},"change_message_id":"e0c50464d6cdd3a4449e5adf7d6e07999febbfa7","unresolved":false,"context_lines":[{"line_number":390,"context_line":"            attachments \u003d volume[\u0027attachments\u0027]"},{"line_number":391,"context_line":"        else:"},{"line_number":392,"context_line":"            attachments \u003d {}"},{"line_number":393,"context_line":"            attach \u003d {}"},{"line_number":394,"context_line":"        for attach in attachments:"},{"line_number":395,"context_line":"            if attach.get(\u0027instance_uuid\u0027, None) \u003d\u003d instance_uuid:"},{"line_number":396,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_a5a43457","line":393,"updated":"2015-08-04 11:17:35.000000000","message":"attach needs to be initailized outside the else part.","commit_id":"41c900c942e508e4b8c657398f3f4b22ad88e1dd"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"46feeb67f26ad369627c1447497b3e16399bf3d4","unresolved":false,"context_lines":[{"line_number":364,"context_line":"        cinderclient(context).volumes.roll_detaching(volume_id)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    @translate_volume_exception"},{"line_number":367,"context_line":"    def attach(self, context, volume_id, instance_uuid, mountpoint, mode\u003d\u0027rw\u0027):"},{"line_number":368,"context_line":"        cinderclient(context).volumes.attach(volume_id, instance_uuid,"},{"line_number":369,"context_line":"                                             mountpoint, mode\u003dmode)"},{"line_number":370,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"5a710552_fc15c79a","line":367,"updated":"2015-12-15 22:52:09.000000000","message":"need to add host\u003dNone and pass in the host. from the \nvirt/block_device.py call to this method\n\nCinder will track the attaches to a host and not remove the target if there are more attaches left, to VMs on the same host.\n\nhttps://review.openstack.org/#/c/255595/","commit_id":"4186e750b08f47ab80a83d6844803ae0c20cee15"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"46feeb67f26ad369627c1447497b3e16399bf3d4","unresolved":false,"context_lines":[{"line_number":366,"context_line":"    @translate_volume_exception"},{"line_number":367,"context_line":"    def attach(self, context, volume_id, instance_uuid, mountpoint, mode\u003d\u0027rw\u0027):"},{"line_number":368,"context_line":"        cinderclient(context).volumes.attach(volume_id, instance_uuid,"},{"line_number":369,"context_line":"                                             mountpoint, mode\u003dmode)"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"    @translate_volume_exception"},{"line_number":372,"context_line":"    def get_volume_attachment(self, volume, instance_uuid):"}],"source_content_type":"text/x-python","patch_set":28,"id":"5a710552_bc0f3f87","line":369,"updated":"2015-12-15 22:52:09.000000000","message":"host_name\u003dhost","commit_id":"4186e750b08f47ab80a83d6844803ae0c20cee15"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        att \u003d vol.attachments[0]"},{"line_number":166,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":167,"context_line":"        d[\u0027instance_uuid\u0027] \u003d att[\u0027server_id\u0027]"},{"line_number":168,"context_line":"        d[\u0027mountpoint\u0027] \u003d att[\u0027device\u0027]"},{"line_number":169,"context_line":"    else:"},{"line_number":170,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":171,"context_line":"    # NOTE(dzyu) volume(cinder) v2 API uses \u0027name\u0027 instead of \u0027display_name\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_8b26db66","side":"PARENT","line":168,"updated":"2015-12-17 11:38:25.000000000","message":"I am really worried if this is going to cause online upgrade issues.\n\nAnyways, maybe we are lucky and this never goes across the RPC bus?","commit_id":"6769d057d52d0cd01a6f264c230e7256c09478f1"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        att \u003d vol.attachments[0]"},{"line_number":166,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":167,"context_line":"        d[\u0027instance_uuid\u0027] \u003d att[\u0027server_id\u0027]"},{"line_number":168,"context_line":"        d[\u0027mountpoint\u0027] \u003d att[\u0027device\u0027]"},{"line_number":169,"context_line":"    else:"},{"line_number":170,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027detached\u0027"},{"line_number":171,"context_line":"    # NOTE(dzyu) volume(cinder) v2 API uses \u0027name\u0027 instead of \u0027display_name\u0027,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_f0d3a65d","side":"PARENT","line":168,"in_reply_to":"3a7e1126_8b26db66","updated":"2015-12-17 18:35:10.000000000","message":"What would be the proper way to remove this? Should I leave it here and add the data from the first attachment and remove it finally in the next release?","commit_id":"6769d057d52d0cd01a6f264c230e7256c09478f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        d[\u0027attachments\u0027] \u003d []"},{"line_number":167,"context_line":"        for attach in vol.attachments:"},{"line_number":168,"context_line":"            attachment_id \u003d attach.get(\u0027attachment_id\u0027)"},{"line_number":169,"context_line":"            a \u003d {\u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":170,"context_line":"                 \u0027attachment_id\u0027: attachment_id,"},{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_eb875f5f","line":169,"updated":"2015-12-17 11:38:25.000000000","message":"Why have attach_status here? seems like its not in the API?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        d[\u0027attachments\u0027] \u003d []"},{"line_number":167,"context_line":"        for attach in vol.attachments:"},{"line_number":168,"context_line":"            attachment_id \u003d attach.get(\u0027attachment_id\u0027)"},{"line_number":169,"context_line":"            a \u003d {\u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":170,"context_line":"                 \u0027attachment_id\u0027: attachment_id,"},{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_b00c3e3c","line":169,"in_reply_to":"3a7e1126_eb875f5f","updated":"2015-12-17 18:35:10.000000000","message":"The EC2 API is using it for instance.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            attachment_id \u003d attach.get(\u0027attachment_id\u0027)"},{"line_number":169,"context_line":"            a \u003d {\u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":170,"context_line":"                 \u0027attachment_id\u0027: attachment_id,"},{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"},{"line_number":173,"context_line":"                 }"},{"line_number":174,"context_line":"            d[\u0027attachments\u0027].append(a)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_d66806f8","line":171,"updated":"2015-12-17 11:38:25.000000000","message":"I wonder if we want instance_uuid here, as technically it might not be a non-nova object that is attached to the volume. But I am probably over thinking that, instance_uuid is better than server_id, in the Nova context.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"833577fa576b32a2384e8c5a5ea2aa2de8aae630","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            attachment_id \u003d attach.get(\u0027attachment_id\u0027)"},{"line_number":169,"context_line":"            a \u003d {\u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":170,"context_line":"                 \u0027attachment_id\u0027: attachment_id,"},{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"},{"line_number":173,"context_line":"                 }"},{"line_number":174,"context_line":"            d[\u0027attachments\u0027].append(a)"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_a2395243","line":171,"in_reply_to":"3a7e1126_3047ee4c","updated":"2016-01-04 11:42:13.000000000","message":"I just wonder about going back to the same naming the cinder API uses, but yeah, it does work.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            attachment_id \u003d attach.get(\u0027attachment_id\u0027)"},{"line_number":169,"context_line":"            a \u003d {\u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":170,"context_line":"                 \u0027attachment_id\u0027: attachment_id,"},{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"},{"line_number":173,"context_line":"                 }"},{"line_number":174,"context_line":"            d[\u0027attachments\u0027].append(a)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_3047ee4c","line":171,"in_reply_to":"3a7e1126_d66806f8","updated":"2015-12-17 18:35:10.000000000","message":"If it\u0027s about the naming I think it is the best we can use here. The information is needed and as it is an id in the worst case it will not match with the filters when we search. So I don\u0027t see an issue with this.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"},{"line_number":173,"context_line":"                 }"},{"line_number":174,"context_line":"            d[\u0027attachments\u0027].append(a)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":177,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_2b4c87c6","line":174,"updated":"2015-12-17 11:38:25.000000000","message":"Why not use a dict with the instance_uuid as the key? I think that will simplify the code for all the usage of this new format.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                 \u0027instance_uuid\u0027: attach[\u0027server_id\u0027],"},{"line_number":172,"context_line":"                 \u0027mountpoint\u0027: attach[\u0027device\u0027],"},{"line_number":173,"context_line":"                 }"},{"line_number":174,"context_line":"            d[\u0027attachments\u0027].append(a)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        d[\u0027attach_status\u0027] \u003d \u0027attached\u0027"},{"line_number":177,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_f03ac697","line":174,"in_reply_to":"3a7e1126_2b4c87c6","updated":"2015-12-17 18:35:10.000000000","message":"I will give this a try, thanks for the hint.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"658d5c5832e9066648efc9b8c1198fdff38b090d","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":313,"context_line":"        # Cinder supports multi-attach when a volume"},{"line_number":314,"context_line":"        # has been marked as multiattach"},{"line_number":315,"context_line":"        if volume.get(\u0027multiattach\u0027, False):"},{"line_number":316,"context_line":"            if (volume[\u0027status\u0027] not in (\"available\", \u0027in-use\u0027)):"},{"line_number":317,"context_line":"                msg \u003d _(\"multiattach volume\u0027s status must be\""},{"line_number":318,"context_line":"                        \"\u0027available\u0027 or \u0027in-use\u0027\")"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_897340b1","line":315,"updated":"2015-12-17 12:15:12.000000000","message":"Is there not also a concept of the virt driver being \"multi-attach\" safe, before we actually allow the multiattach on the Nova side?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"833577fa576b32a2384e8c5a5ea2aa2de8aae630","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":313,"context_line":"        # Cinder supports multi-attach when a volume"},{"line_number":314,"context_line":"        # has been marked as multiattach"},{"line_number":315,"context_line":"        if volume.get(\u0027multiattach\u0027, False):"},{"line_number":316,"context_line":"            if (volume[\u0027status\u0027] not in (\"available\", \u0027in-use\u0027)):"},{"line_number":317,"context_line":"                msg \u003d _(\"multiattach volume\u0027s status must be\""},{"line_number":318,"context_line":"                        \"\u0027available\u0027 or \u0027in-use\u0027\")"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_02505e5c","line":315,"in_reply_to":"3a7e1126_30ffeeab","updated":"2016-01-04 11:42:13.000000000","message":"Maybe, although I think the compute driver might be a better place. We need something to check if the virt driver supports dealing with multi-attach really, and fail the operation if that is not one of the virt driver capabilities:\nhttps://github.com/openstack/nova/blob/master/nova/virt/driver.py#L167\n\nYou could pass the list of capabilities down into check_attach, I guess.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":313,"context_line":"        # Cinder supports multi-attach when a volume"},{"line_number":314,"context_line":"        # has been marked as multiattach"},{"line_number":315,"context_line":"        if volume.get(\u0027multiattach\u0027, False):"},{"line_number":316,"context_line":"            if (volume[\u0027status\u0027] not in (\"available\", \u0027in-use\u0027)):"},{"line_number":317,"context_line":"                msg \u003d _(\"multiattach volume\u0027s status must be\""},{"line_number":318,"context_line":"                        \"\u0027available\u0027 or \u0027in-use\u0027\")"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_30ffeeab","line":315,"in_reply_to":"3a7e1126_897340b1","updated":"2015-12-17 18:35:10.000000000","message":"Do you mean to move the checks to the virt driver instead?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e34db720889e051562b8a96a6aa1f244a90cdf4a","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":342,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def check_detach(self, context, volume):"},{"line_number":345,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":346,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":347,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_5c38b7d3","line":344,"updated":"2015-12-17 12:11:32.000000000","message":"Surely this needs to be updated to include instance_uuid, to check there is a valid attachment to remove?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":342,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def check_detach(self, context, volume):"},{"line_number":345,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":346,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":347,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_2da0db42","line":344,"in_reply_to":"3a7e1126_10f3d29f","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":342,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def check_detach(self, context, volume):"},{"line_number":345,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":346,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":347,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_10f3d29f","line":344,"in_reply_to":"3a7e1126_5c38b7d3","updated":"2015-12-17 18:35:10.000000000","message":"I will add a check here too, thanks for pointing out.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4ec92e856c5b8b850436103c26b0f6b9556a0acc","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        return attach"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    @translate_volume_exception"},{"line_number":384,"context_line":"    def detach(self, context, volume_id, attachment_id):"},{"line_number":385,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_8b6edbc7","line":384,"updated":"2015-12-17 11:38:25.000000000","message":"Why not just take a volume and instance_uuid, rather than a volume_id and attachement_id? That should hide the complexity from the callers.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"710c798a15e67c9bd3613b0378fc70dc10777a23","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        return attach"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    @translate_volume_exception"},{"line_number":384,"context_line":"    def detach(self, context, volume_id, attachment_id):"},{"line_number":385,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a7e1126_b0eafeaa","line":384,"in_reply_to":"3a7e1126_8b6edbc7","updated":"2015-12-17 18:35:10.000000000","message":"You mean to retrieve the attachment in this function instead of where we call it now?","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"abaabf70263f90b698c75a228b2a3229a5c40727","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        return attach"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    @translate_volume_exception"},{"line_number":384,"context_line":"    def detach(self, context, volume_id, attachment_id):"},{"line_number":385,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":32,"id":"1a7b0d38_4a9c1b5d","line":384,"in_reply_to":"3a7e1126_b0eafeaa","updated":"2016-01-05 07:31:35.000000000","message":"Done","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"833577fa576b32a2384e8c5a5ea2aa2de8aae630","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        return attach"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"    @translate_volume_exception"},{"line_number":384,"context_line":"    def detach(self, context, volume_id, attachment_id):"},{"line_number":385,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":32,"id":"fa69d971_428bb6c3","line":384,"in_reply_to":"3a7e1126_b0eafeaa","updated":"2016-01-04 11:42:13.000000000","message":"Yes, reduce the number of calls into the class. Seems odd to always have to call another function in the class to get the arguments to call this function. Although passing down the attachement_id, might stop that happening.","commit_id":"eea4c78f4120423d9b5d9c4bd72cfd011300a160"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"a9c8e411498a0606e54fd9780e595e0f8f05246a","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                                              \"status\": volume[\u0027status\u0027]}"},{"line_number":302,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def check_attach(self, context, volume, instance\u003dNone):"},{"line_number":305,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":306,"context_line":"        # Cinder supports multi-attach when a volume"},{"line_number":307,"context_line":"        # has been marked as multiattach"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_cc70f4a6","line":304,"range":{"start_line":304,"start_character":8,"end_line":304,"end_character":20},"updated":"2016-01-05 18:13:12.000000000","message":"I really don\u0027t like that we are using this method at all. We should be deprecating it due to the fact that it is racy, and be using reserve_volume instead. \n\nI think this is a good opportunity to fix this brokenness but don\u0027t want to block this work on this exclusively.","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"451dec29b08f083b1ef89be9eb42a1cbd66a807d","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                                              \"status\": volume[\u0027status\u0027]}"},{"line_number":302,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def check_attach(self, context, volume, instance\u003dNone):"},{"line_number":305,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":306,"context_line":"        # Cinder supports multi-attach when a volume"},{"line_number":307,"context_line":"        # has been marked as multiattach"}],"source_content_type":"text/x-python","patch_set":50,"id":"fa69d971_fe96b73c","line":304,"range":{"start_line":304,"start_character":8,"end_line":304,"end_character":20},"in_reply_to":"fa69d971_cc70f4a6","updated":"2016-01-05 23:26:05.000000000","message":"It wasn\u0027t marked as deprecated or anything like that. Should I add a comment here about this?\n\nAlso if there isn\u0027t already we can report a wishlist bug for this and fix in a subsequent patch.","commit_id":"e424bdea0de80039abc377a7a6e11f509e9b9650"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6d050ec17c264f3edc4e0f5fc1f018e50db0a16","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                        get(\u0027attachment_id\u0027)"},{"line_number":382,"context_line":"            return None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if not attachment_id:"},{"line_number":385,"context_line":"            attachment_id \u003d get_attachment_id(context, volume_id,"},{"line_number":386,"context_line":"                                              instance_uuid)"},{"line_number":387,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"}],"source_content_type":"text/x-python","patch_set":57,"id":"fa69d971_7fd070c9","line":384,"updated":"2016-01-06 10:14:24.000000000","message":"I wonder if we want this in the compute manager.\n\nBecause on the next major version of the compute manager, I think we can drop this code, as we will always get the attachment passed in.","commit_id":"dc8a641a49a6ebd84b010f100613e31ced12144c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"0ebd93e37118447b19b4d03620f068568e6522a3","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                        get(\u0027attachment_id\u0027)"},{"line_number":382,"context_line":"            return None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if not attachment_id:"},{"line_number":385,"context_line":"            attachment_id \u003d get_attachment_id(context, volume_id,"},{"line_number":386,"context_line":"                                              instance_uuid)"},{"line_number":387,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"}],"source_content_type":"text/x-python","patch_set":57,"id":"fa69d971_227c1bb4","line":384,"in_reply_to":"fa69d971_7fd070c9","updated":"2016-01-06 10:40:29.000000000","message":"There are cases where we don\u0027t have the volume info, so we will need to call out anyway. In this sense it\u0027s better to keep this here as calling out to Cinder everywhere we don\u0027t have the volume in place.","commit_id":"dc8a641a49a6ebd84b010f100613e31ced12144c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"401a1c2729c2ac52ad20833be981c54cc597623b","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                             mountpoint, mode\u003dmode)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @translate_volume_exception"},{"line_number":373,"context_line":"    def detach(self, context, volume_id, instance_uuid \u003d None,"},{"line_number":374,"context_line":"               attachment_id\u003dNone):"},{"line_number":375,"context_line":"        def get_attachment_id(self, context, volume_id, instance_uuid \u003d None):"},{"line_number":376,"context_line":"            if instance_uuid:"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_6b5fde72","line":373,"range":{"start_line":373,"start_character":41,"end_line":373,"end_character":61},"updated":"2016-01-12 20:48:44.000000000","message":"instance_uuid\u003dNone","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                                             mountpoint, mode\u003dmode)"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @translate_volume_exception"},{"line_number":373,"context_line":"    def detach(self, context, volume_id, instance_uuid \u003d None,"},{"line_number":374,"context_line":"               attachment_id\u003dNone):"},{"line_number":375,"context_line":"        def get_attachment_id(self, context, volume_id, instance_uuid \u003d None):"},{"line_number":376,"context_line":"            if instance_uuid:"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_b1222800","line":373,"range":{"start_line":373,"start_character":41,"end_line":373,"end_character":61},"in_reply_to":"da6ed579_6b5fde72","updated":"2016-01-12 22:18:32.000000000","message":"Bah, good catch I would\u0027ve never recognized. :S\n\nDone","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"401a1c2729c2ac52ad20833be981c54cc597623b","unresolved":false,"context_lines":[{"line_number":372,"context_line":"    @translate_volume_exception"},{"line_number":373,"context_line":"    def detach(self, context, volume_id, instance_uuid \u003d None,"},{"line_number":374,"context_line":"               attachment_id\u003dNone):"},{"line_number":375,"context_line":"        def get_attachment_id(self, context, volume_id, instance_uuid \u003d None):"},{"line_number":376,"context_line":"            if instance_uuid:"},{"line_number":377,"context_line":"                volume \u003d self.get(context, volume_id)"},{"line_number":378,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_6b3a7e38","line":375,"range":{"start_line":375,"start_character":56,"end_line":375,"end_character":76},"updated":"2016-01-12 20:48:44.000000000","message":"instance_uuid\u003dNone","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":372,"context_line":"    @translate_volume_exception"},{"line_number":373,"context_line":"    def detach(self, context, volume_id, instance_uuid \u003d None,"},{"line_number":374,"context_line":"               attachment_id\u003dNone):"},{"line_number":375,"context_line":"        def get_attachment_id(self, context, volume_id, instance_uuid \u003d None):"},{"line_number":376,"context_line":"            if instance_uuid:"},{"line_number":377,"context_line":"                volume \u003d self.get(context, volume_id)"},{"line_number":378,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_91036442","line":375,"range":{"start_line":375,"start_character":56,"end_line":375,"end_character":76},"in_reply_to":"da6ed579_6b3a7e38","updated":"2016-01-12 22:18:32.000000000","message":"Done","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"401a1c2729c2ac52ad20833be981c54cc597623b","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                if attachments:"},{"line_number":380,"context_line":"                    return attachments.get(instance_uuid, {}).\\"},{"line_number":381,"context_line":"                        get(\u0027attachment_id\u0027)"},{"line_number":382,"context_line":"            return None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if not attachment_id:"},{"line_number":385,"context_line":"            attachment_id \u003d get_attachment_id(context, volume_id,"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_2baec62e","line":382,"range":{"start_line":382,"start_character":11,"end_line":382,"end_character":23},"updated":"2016-01-12 20:48:44.000000000","message":"We should maybe log a warning in this case since we can\u0027t tell which attachment_id to use? Also, don\u0027t we only care about this if volume[\u0027multiattach\u0027] is True? So couldn\u0027t we get the volume first and if it\u0027s multiattach and we can\u0027t find an attachment_id, then we log the warning (since I\u0027m assuming cinder will fail with a 400).\n\nWhat am I missing here?","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6aec49c232917bbf877c02cba6a1a0fc4612388f","unresolved":false,"context_lines":[{"line_number":379,"context_line":"                if attachments:"},{"line_number":380,"context_line":"                    return attachments.get(instance_uuid, {}).\\"},{"line_number":381,"context_line":"                        get(\u0027attachment_id\u0027)"},{"line_number":382,"context_line":"            return None"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"        if not attachment_id:"},{"line_number":385,"context_line":"            attachment_id \u003d get_attachment_id(context, volume_id,"}],"source_content_type":"text/x-python","patch_set":64,"id":"da6ed579_1400c200","line":382,"range":{"start_line":382,"start_character":11,"end_line":382,"end_character":23},"in_reply_to":"da6ed579_2baec62e","updated":"2016-01-12 22:18:32.000000000","message":"Cinder will fail, that\u0027s correct. I will check multiattach first as you suggested.","commit_id":"0ef7d1b4d2a634e78b0ad36b4a02b568d1e51e55"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        # Note(ildikov):Preparation for multiattach support, when a volume"},{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance and not volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_fdbae16d","line":339,"updated":"2016-01-18 23:04:30.000000000","message":"According to the code above, volume[\u0027attachments\u0027] will always exist if status is \u0027attached\u0027, so it would be cleaner here to do:\n\n if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        # Note(ildikov):Preparation for multiattach support, when a volume"},{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance and not volume.get(\u0027attachments\u0027, {}).get(instance.uuid):"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_033af636","line":339,"in_reply_to":"ba63e191_fdbae16d","updated":"2016-01-19 00:27:49.000000000","message":"Done","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":363,"context_line":"    @translate_volume_exception"},{"line_number":364,"context_line":"    def detach(self, context, volume_id, instance_uuid\u003dNone,"},{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if not attachment_id:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_9db0858d","line":366,"updated":"2016-01-18 23:04:30.000000000","message":"Use:\n\n if attachment_id is not None:\n\nBecause attachment_id might be 0, right?","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":363,"context_line":"    @translate_volume_exception"},{"line_number":364,"context_line":"    def detach(self, context, volume_id, instance_uuid\u003dNone,"},{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if not attachment_id:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_a3268a14","line":366,"in_reply_to":"ba63e191_9db0858d","updated":"2016-01-19 00:27:49.000000000","message":"Would need to check, I assume it\u0027s a uuid, but better to play safe.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c76911eb99e2a4c5752f173c62807abe396b45a2","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if not attachment_id:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_bdad4933","line":368,"updated":"2016-01-18 23:04:30.000000000","message":"Is the \u0027multiattach\u0027 key guaranteed to always be in the returned volume dictionary? What if Nova is speaking with an older Cinder API endpoint? Would it be safer here to use volume.get(\u0027multiattach\u0027)?","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fb1fae6ca2479c403eaf4d45128432453a351e06","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if not attachment_id:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_54fc223e","line":368,"updated":"2016-01-19 01:41:01.000000000","message":"OK, thanks for checking on that.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c8d9ee77bdd2a1dbc211b4db0673ec0ad2658a17","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if not attachment_id:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":75,"id":"ba63e191_439a2e16","line":368,"in_reply_to":"ba63e191_bdad4933","updated":"2016-01-19 00:27:49.000000000","message":"The get call will return the translated dict, which ensures that \u0027multiattach\u0027 is there, but it will be False.","commit_id":"6d39aed877b2796cb3d83a8f4d847fd39297aa7c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6a13c083ca65bdb91ec5a71d051f8119383e259b","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                            get(\u0027attachment_id\u0027)"},{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                LOG.warn(self.msg)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":76,"id":"ba63e191_ef7223ad","line":380,"updated":"2016-01-19 01:51:16.000000000","message":"I just noticed that if there is no instance_uuid and no attachment_id, there will be two identical consecutive WARNING messages in the log. I think you need to remove line 380. Also, if cinderclient cannot detach() the volume if an attachment ID is not provided, why not raise an exception instead of proceeding to just try the call to cinderclient.volumes.detach()?","commit_id":"4e7b1165bb503d8b781f283e1170e13cc96bc717"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"990f1ff298b4861e7172456922fc589b1ffe9b38","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                            get(\u0027attachment_id\u0027)"},{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                LOG.warn(self.msg)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-python","patch_set":76,"id":"ba63e191_f0af5b7b","line":380,"in_reply_to":"ba63e191_ef7223ad","updated":"2016-01-19 05:46:54.000000000","message":"I missed to put line 380 into an else branch.\n\nAlso we don\u0027t check here how many attachments a volume has. Cinder does a best guess here, if there\u0027s only one attachment for the volume it will be detached. If there are multiple attachments Cinder will raise an exception. As it is Cinder\u0027s responsibility by the end of the day I would not add extra logic here.","commit_id":"4e7b1165bb503d8b781f283e1170e13cc96bc717"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    #            removed."},{"line_number":162,"context_line":"    d[\u0027attach_time\u0027] \u003d \"\""},{"line_number":163,"context_line":"    d[\u0027mountpoint\u0027] \u003d \"\""},{"line_number":164,"context_line":"    d[\u0027multiattach\u0027] \u003d getattr(vol, \u0027multiattach\u0027, False)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    if vol.attachments:"},{"line_number":167,"context_line":"        d[\u0027attachments\u0027] \u003d collections.OrderedDict()"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_5635e343","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":57},"updated":"2016-01-19 15:30:19.000000000","message":"Why are these changes (and below) necessary in this patch? This actually changes the REST API response, which should probably be part of the change in N that bumps the microversion.\n\nI guess part of it is so that you can do this check on L339:\n\ninstance.uuid not in volume[\u0027attachments\u0027]\n\nBut it seems we could do that anyway without this change since we have the volume, we could get the attachments from that w/o changing the value that is passed back up to the REST API.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ae593cc0c499724b4ae46a61c443675adfab3198","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    #            removed."},{"line_number":162,"context_line":"    d[\u0027attach_time\u0027] \u003d \"\""},{"line_number":163,"context_line":"    d[\u0027mountpoint\u0027] \u003d \"\""},{"line_number":164,"context_line":"    d[\u0027multiattach\u0027] \u003d getattr(vol, \u0027multiattach\u0027, False)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    if vol.attachments:"},{"line_number":167,"context_line":"        d[\u0027attachments\u0027] \u003d collections.OrderedDict()"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_6c5dbae8","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":57},"in_reply_to":"ba63e191_5635e343","updated":"2016-01-19 15:43:13.000000000","message":"The REST API is not changed as we have the reverse functions in the API that transforms the volume info to what is sent out through the REST API as response.\n\nSee here: https://review.openstack.org/#/c/193134/77/nova/api/openstack/compute/volumes.py\n\nThe changes are needed to fetch all the information from the volume info received from Cinder that we need for multiattach. The attachment format is changed by a suggestion from John as instance_uuid should be unique, therefore it can be used as a key.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    #            removed."},{"line_number":162,"context_line":"    d[\u0027attach_time\u0027] \u003d \"\""},{"line_number":163,"context_line":"    d[\u0027mountpoint\u0027] \u003d \"\""},{"line_number":164,"context_line":"    d[\u0027multiattach\u0027] \u003d getattr(vol, \u0027multiattach\u0027, False)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    if vol.attachments:"},{"line_number":167,"context_line":"        d[\u0027attachments\u0027] \u003d collections.OrderedDict()"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_d0f31409","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":57},"in_reply_to":"ba63e191_6c5dbae8","updated":"2016-01-19 16:17:37.000000000","message":"Yup, I\u0027m starting to get it now.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e4511607349b1291dcfeada7d6b5af2b97993cb1","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    #            removed."},{"line_number":162,"context_line":"    d[\u0027attach_time\u0027] \u003d \"\""},{"line_number":163,"context_line":"    d[\u0027mountpoint\u0027] \u003d \"\""},{"line_number":164,"context_line":"    d[\u0027multiattach\u0027] \u003d getattr(vol, \u0027multiattach\u0027, False)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    if vol.attachments:"},{"line_number":167,"context_line":"        d[\u0027attachments\u0027] \u003d collections.OrderedDict()"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_ffb703f3","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":57},"in_reply_to":"ba63e191_7f8c737f","updated":"2016-01-19 17:34:58.000000000","message":"And rackspace is still using icehouse. :)","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"e8b4bf56f4dade229769da4e2a6182f72cdb7650","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    #            removed."},{"line_number":162,"context_line":"    d[\u0027attach_time\u0027] \u003d \"\""},{"line_number":163,"context_line":"    d[\u0027mountpoint\u0027] \u003d \"\""},{"line_number":164,"context_line":"    d[\u0027multiattach\u0027] \u003d getattr(vol, \u0027multiattach\u0027, False)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    if vol.attachments:"},{"line_number":167,"context_line":"        d[\u0027attachments\u0027] \u003d collections.OrderedDict()"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_7f8c737f","line":164,"range":{"start_line":164,"start_character":4,"end_line":164,"end_character":57},"in_reply_to":"ba63e191_d0f31409","updated":"2016-01-19 17:31:34.000000000","message":"So the multiattach attribute has been part of the Cinder API since this\n\nhttps://github.com/openstack/cinder/commit/10d54216871fde27172fbcb1a3c9bfec59b824c2\n\nDec 9 2014","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"f0605ac8e3100396eff33478edf612f543867b6e","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_ec69aa8c","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"updated":"2016-01-19 15:56:06.000000000","message":"As I commented before - we should really transition away from check_attach/detach as they are racy and should not be used.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e4511607349b1291dcfeada7d6b5af2b97993cb1","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_7f72334b","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_5f564fd3","updated":"2016-01-19 17:34:58.000000000","message":"I tend to agree with hemna. I think there are improvements that could be made here, like not checking status in here *and* begin_detaching since it\u0027s redundant - or we should merge them (or call begin_detaching first). But I think that\u0027s cleanup which could come later.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"3744d36c77da7beb518a4b2e04dd326a69ef9f20","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_df447f75","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_5f564fd3","updated":"2016-01-19 17:42:23.000000000","message":"OK","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_1013ecb9","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_70ba680c","updated":"2016-01-19 17:07:31.000000000","message":"I agree to not do the deprecation here. It would be too much for this series, even if I\u0027m not against of the idea.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"5815f7cc4dcb838a2f13405e227a5618dc090f90","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b3cd4a5f","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_70ba680c","updated":"2016-01-19 16:35:00.000000000","message":"No we can just use begin detaching which fails if the volume is in the wrong status. We should just remove the call to this instead of adding more code to it.\n\nhttps://github.com/openstack/cinder/blob/b770922f96c6e717fb4fc960b8232c8b794b290c/cinder/volume/api.py#L587","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d83d34aa3f85f0b2b501e78759f9c67e067c7c0f","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_c4cd965e","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_b3cd4a5f","updated":"2016-01-19 17:16:50.000000000","message":"Apparently we call begin_detaching right after check_detach in the compute API:\n\nhttps://github.com/openstack/nova/blob/4f75ba6729366f87624554e7732ef122c6ebac4b/nova/compute/api.py#L3020\n\nI agree we should let begin_detaching handle the status checking.\n\nThe one difference here then is the attachment checking on the instance uuid. If we don\u0027t have that, we could be passing in the wrong instance uuid and using the wrong attachment_id when calling os-detach. It looks like the cinder volume manager handles that here:\n\nhttps://github.com/openstack/cinder/blob/b770922f96c6e717fb4fc960b8232c8b794b290c/cinder/volume/manager.py#L959-L966\n\nThat doesn\u0027t fail though, it just updates the volume status (if necessary). Maybe that\u0027s fine. The client wouldn\u0027t probably know they passed in the wrong instance since we wouldn\u0027t return a 400.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_59abcf1d","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_b3cd4a5f","updated":"2016-01-19 17:07:31.000000000","message":"I can remove this function in a subsequent patch. I do not want to mess this one up. I can even report a bug for having unnecessary duplication with Cinder. Could that work?","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"e8b4bf56f4dade229769da4e2a6182f72cdb7650","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_5f564fd3","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_ec69aa8c","updated":"2016-01-19 17:31:34.000000000","message":"For the time being this is all we have, and removing it in the patchset doesn\u0027t make sense.   We (cinder team) is actively looking at reworking the Cinder API to simplify the interaction between Nova and Cinder.   This is a non trivial problem and it won\u0027t be done any time soon.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                            \u0027vol_zone\u0027: volume[\u0027availability_zone\u0027]}"},{"line_number":324,"context_line":"                raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def check_detach(self, context, volume, instance\u003dNone):"},{"line_number":327,"context_line":"        # TODO(vish): abstract status checking?"},{"line_number":328,"context_line":"        if volume[\u0027status\u0027] \u003d\u003d \"available\":"},{"line_number":329,"context_line":"            msg \u003d _(\"volume %s already detached\") % volume[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_70ba680c","line":326,"range":{"start_line":326,"start_character":8,"end_line":326,"end_character":20},"in_reply_to":"ba63e191_ec69aa8c","updated":"2016-01-19 16:17:37.000000000","message":"What\u0027s the alternative? Don\u0027t check and just let cinder fail? That\u0027s not a bad idea, I just wonder about cases where we cast off to compute and then fail, the client has already gotten a 202 back and then they just have to wait for an instance fault to show up, which isn\u0027t great UX either.\n\nAlso, this is maybe not the place / time to be deprecating check_attach (in this series I mean), that would be a bigger separate effort I think.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            msg \u003d _(\"Volume must be attached in order to detach.\")"},{"line_number":334,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        # Note(ildikov):Preparation for multiattach support, when a volume"},{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_16cf6b80","line":336,"range":{"start_line":336,"start_character":10,"end_line":336,"end_character":14},"updated":"2016-01-19 15:30:19.000000000","message":"nit: I think technically this is supposed to be NOTE(ildikov).","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ce36a1a6f83aa8ef447a8b93480222e3c0e0408d","unresolved":false,"context_lines":[{"line_number":333,"context_line":"            msg \u003d _(\"Volume must be attached in order to detach.\")"},{"line_number":334,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        # Note(ildikov):Preparation for multiattach support, when a volume"},{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_077df71b","line":336,"range":{"start_line":336,"start_character":10,"end_line":336,"end_character":14},"in_reply_to":"ba63e191_16cf6b80","updated":"2016-01-19 16:05:54.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"},{"line_number":343,"context_line":"    def reserve_volume(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_11977591","line":340,"range":{"start_line":340,"start_character":28,"end_line":340,"end_character":44},"updated":"2016-01-19 15:30:19.000000000","message":"The error message from this is:\n\n_(\"Volume %(volume_id)s is not attached to anything\")\n\nIf the volume status is \u0027attached\u0027, which it would have to be to get past the above status checks, it\u0027s a bit odd to say it\u0027s not attached to anything, it\u0027s just not attached to the target instance. This is a bit of a nit, but it might be better to add a new more specific exception for the case where we have an instance uuid.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ce36a1a6f83aa8ef447a8b93480222e3c0e0408d","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"},{"line_number":343,"context_line":"    def reserve_volume(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_a7098b97","line":340,"range":{"start_line":340,"start_character":28,"end_line":340,"end_character":44},"in_reply_to":"ba63e191_11977591","updated":"2016-01-19 16:05:54.000000000","message":"There is a very similar case in swap_volume, but I create a new exception, that\u0027s more clear.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"},{"line_number":343,"context_line":"    def reserve_volume(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_50fde438","line":340,"range":{"start_line":340,"start_character":28,"end_line":340,"end_character":44},"in_reply_to":"ba63e191_500404bf","updated":"2016-01-19 17:07:31.000000000","message":"I wanted to completely refactor, but the code contains different orders, so I ended up with changing the error in the tests, which means slight API change, so I left the swap_volume code untouched for now.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    @translate_volume_exception"},{"line_number":343,"context_line":"    def reserve_volume(self, context, volume_id):"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_500404bf","line":340,"range":{"start_line":340,"start_character":28,"end_line":340,"end_character":44},"in_reply_to":"ba63e191_a7098b97","updated":"2016-01-19 16:17:37.000000000","message":"Yeah, I see now that this was copied out of the compute API code.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if attachment_id is None:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b131c9a4","line":368,"range":{"start_line":368,"start_character":15,"end_line":368,"end_character":36},"updated":"2016-01-19 15:30:19.000000000","message":"Should this be:\n\nvolume.get(\u0027multiattach\u0027, False)\n\nIn case it\u0027s an old cinder?","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if attachment_id is None:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_70ed88ee","line":368,"range":{"start_line":368,"start_character":15,"end_line":368,"end_character":36},"in_reply_to":"ba63e191_2cc82255","updated":"2016-01-19 16:17:37.000000000","message":"Oh right - I keep forgetting we translate the volume before it gets here. And yeah, cinder would be really old, but it is apparently very old in some deployments, i.e. I think Rackspace is running Icehouse level cinder.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ae593cc0c499724b4ae46a61c443675adfab3198","unresolved":false,"context_lines":[{"line_number":365,"context_line":"               attachment_id\u003dNone):"},{"line_number":366,"context_line":"        if attachment_id is None:"},{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_2cc82255","line":368,"range":{"start_line":368,"start_character":15,"end_line":368,"end_character":36},"in_reply_to":"ba63e191_b131c9a4","updated":"2016-01-19 15:43:13.000000000","message":"The translation function above adds the field with False in either case and that function is called to format the returned value of get().\n\nOn the other hand Cinder should be very old for that. :)","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_11cf7580","line":370,"range":{"start_line":370,"start_character":16,"end_line":370,"end_character":24},"updated":"2016-01-19 15:30:19.000000000","message":"This doesn\u0027t need to a class member variable.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":368,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":369,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_30995020","line":370,"range":{"start_line":370,"start_character":16,"end_line":370,"end_character":24},"in_reply_to":"ba63e191_11cf7580","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""},{"line_number":374,"context_line":"                               \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":375,"context_line":"                if instance_uuid:"},{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_71b591cb","line":373,"range":{"start_line":373,"start_character":32,"end_line":373,"end_character":71},"updated":"2016-01-19 15:30:19.000000000","message":"So what is cinder going to do? Fail with a 400 response? Should we just fail early here without calling os-detach in cinder? Maybe it\u0027s fine to just let Cinder fail.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"ae593cc0c499724b4ae46a61c443675adfab3198","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""},{"line_number":374,"context_line":"                               \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":375,"context_line":"                if instance_uuid:"},{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_8c790eff","line":373,"range":{"start_line":373,"start_character":32,"end_line":373,"end_character":71},"in_reply_to":"ba63e191_71b591cb","updated":"2016-01-19 15:43:13.000000000","message":"Cinder only fails if there\u0027re multiple attachments and it cannot identify which one to detach. In my opinion it is a kind of responsibility that should remain on Cinder\u0027s side.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fbd50f84acf292fd0225bf0d3f2a71f00c9fd1a","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""},{"line_number":374,"context_line":"                               \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":375,"context_line":"                if instance_uuid:"},{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_f0b738f3","line":373,"range":{"start_line":373,"start_character":32,"end_line":373,"end_character":71},"in_reply_to":"ba63e191_8c790eff","updated":"2016-01-19 16:17:37.000000000","message":"Yeah that\u0027s fine. It also goes back to Nikola\u0027s comment about nova shouldn\u0027t be doing check_detach and leave that validation up to cinder.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":370,"context_line":"                self.msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":371,"context_line":"                               \"volume %(volume_id)s. The volume has the \""},{"line_number":372,"context_line":"                               \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":373,"context_line":"                               \"attachment_id Cinder cannot perform the \""},{"line_number":374,"context_line":"                               \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":375,"context_line":"                if instance_uuid:"},{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_b08540ae","line":373,"range":{"start_line":373,"start_character":32,"end_line":373,"end_character":71},"in_reply_to":"ba63e191_f0b738f3","updated":"2016-01-19 17:07:31.000000000","message":"Yeap, agreed.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"},{"line_number":377,"context_line":"                            get(\u0027attachment_id\u0027)"},{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    LOG.warn(self.msg)"},{"line_number":382,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_1196954c","line":379,"range":{"start_line":379,"start_character":28,"end_line":379,"end_character":32},"updated":"2016-01-19 15:30:19.000000000","message":"Use warning for python 3 compat.","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"},{"line_number":377,"context_line":"                            get(\u0027attachment_id\u0027)"},{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    LOG.warn(self.msg)"},{"line_number":382,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_1019ac88","line":379,"range":{"start_line":379,"start_character":28,"end_line":379,"end_character":32},"in_reply_to":"ba63e191_1196954c","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ca5f1551f89f323bc575781144c8fc0d9fa188f","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    LOG.warn(self.msg)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_d19f9d5d","line":381,"range":{"start_line":381,"start_character":24,"end_line":381,"end_character":28},"updated":"2016-01-19 15:30:19.000000000","message":"use warning()","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"03a84bcefd564ac9e5e06e81f4398e9da8a45eff","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                    if not attachment_id:"},{"line_number":379,"context_line":"                        LOG.warn(self.msg)"},{"line_number":380,"context_line":"                else:"},{"line_number":381,"context_line":"                    LOG.warn(self.msg)"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":384,"context_line":""}],"source_content_type":"text/x-python","patch_set":77,"id":"ba63e191_f015f848","line":381,"range":{"start_line":381,"start_character":24,"end_line":381,"end_character":28},"in_reply_to":"ba63e191_d19f9d5d","updated":"2016-01-19 17:07:31.000000000","message":"Done","commit_id":"efcd1761f14dd419e2e4a8961ac7aa14809fccc8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            # NOTE(ildikov): change it to a better exception, when enable"},{"line_number":341,"context_line":"            # multi-attach."},{"line_number":342,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_ff9adac4","line":340,"range":{"start_line":340,"start_character":14,"end_line":340,"end_character":18},"updated":"2016-01-20 15:39:57.000000000","message":"Should be TODO here.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # can be attached to multiple hosts and/or instances,"},{"line_number":338,"context_line":"        # so just check the attachment specific to this instance"},{"line_number":339,"context_line":"        if instance is not None and instance.uuid not in volume[\u0027attachments\u0027]:"},{"line_number":340,"context_line":"            # NOTE(ildikov): change it to a better exception, when enable"},{"line_number":341,"context_line":"            # multi-attach."},{"line_number":342,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvolume[\u0027id\u0027])"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_c2237a04","line":340,"range":{"start_line":340,"start_character":14,"end_line":340,"end_character":18},"in_reply_to":"9a68dd71_ff9adac4","updated":"2016-01-20 18:09:16.000000000","message":"Done","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7b970ae0c7e6fbf3b4b35399fd2f666fbe53ae87","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":370,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":371,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":372,"context_line":"                msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":373,"context_line":"                          \"volume %(volume_id)s. The volume has the \""},{"line_number":374,"context_line":"                          \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":375,"context_line":"                          \"attachment_id Cinder cannot perform the \""},{"line_number":376,"context_line":"                          \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":377,"context_line":"                if instance_uuid:"},{"line_number":378,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"},{"line_number":379,"context_line":"                            get(\u0027attachment_id\u0027)"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_9fdabe77","line":376,"range":{"start_line":372,"start_character":16,"end_line":376,"end_character":63},"updated":"2016-01-20 15:39:57.000000000","message":"Maybe we should actually log this per condition below, and in the case that we have an instance_uuid, we put that in the warning message. Then we don\u0027t need to pre-create a warning message object that may not even be used.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"6887626f313f45cb45cb63b199bd2b93b52ca4f6","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            volume \u003d self.get(context, volume_id)"},{"line_number":370,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":371,"context_line":"                attachments \u003d volume.get(\u0027attachments\u0027, {})"},{"line_number":372,"context_line":"                msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":373,"context_line":"                          \"volume %(volume_id)s. The volume has the \""},{"line_number":374,"context_line":"                          \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":375,"context_line":"                          \"attachment_id Cinder cannot perform the \""},{"line_number":376,"context_line":"                          \"detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":377,"context_line":"                if instance_uuid:"},{"line_number":378,"context_line":"                    attachment_id \u003d attachments.get(instance_uuid, {}).\\"},{"line_number":379,"context_line":"                            get(\u0027attachment_id\u0027)"}],"source_content_type":"text/x-python","patch_set":79,"id":"9a68dd71_e2d0fecb","line":376,"range":{"start_line":372,"start_character":16,"end_line":376,"end_character":63},"in_reply_to":"9a68dd71_9fdabe77","updated":"2016-01-20 18:09:16.000000000","message":"That case is very unlikely to happen anyway, but will adapt the log message.","commit_id":"7ba7d266cfcd94a3b42c3640edcdfe74d3adbcc6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a9a0054ede438bdad170da42d44ed0a720d42ba","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                  \"attachment_id Cinder most probably \""},{"line_number":381,"context_line":"                                  \"cannot perform the detach.\""},{"line_number":382,"context_line":"                                  ) % {\u0027volume_id\u0027: volume_id,"},{"line_number":383,"context_line":"                                                \u0027instance_id\u0027: instance_uuid}"},{"line_number":384,"context_line":"                        LOG.warning(msg)"},{"line_number":385,"context_line":"                else:"},{"line_number":386,"context_line":"                    msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""}],"source_content_type":"text/x-python","patch_set":80,"id":"9a68dd71_c32cd2ad","line":383,"updated":"2016-01-20 20:53:20.000000000","message":"Formatting here...saddens me.\n\nYou can just pass the replacement vars dict as an argument to the LOG.warning method, like this:\n\nLOG.warning(_LW(\u0027...\u0027), {\u0027volume_id\u0027: volume_id, \u0027instance_id\u0027: instance_uuid})\n\nThat way we only use those when actually logging it, not creating the message object.","commit_id":"3b3017e95cf7ccfff698da626730ad6a0e916797"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"1240e86d76960f87ae2c94a1449d8f56500c684e","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                  \"attachment_id Cinder most probably \""},{"line_number":381,"context_line":"                                  \"cannot perform the detach.\""},{"line_number":382,"context_line":"                                  ) % {\u0027volume_id\u0027: volume_id,"},{"line_number":383,"context_line":"                                                \u0027instance_id\u0027: instance_uuid}"},{"line_number":384,"context_line":"                        LOG.warning(msg)"},{"line_number":385,"context_line":"                else:"},{"line_number":386,"context_line":"                    msg \u003d _LW(\"attachment_id couldn\u0027t be retrieved for \""}],"source_content_type":"text/x-python","patch_set":80,"id":"9a68dd71_e60c8444","line":383,"in_reply_to":"9a68dd71_c32cd2ad","updated":"2016-01-20 21:07:50.000000000","message":"Done","commit_id":"3b3017e95cf7ccfff698da626730ad6a0e916797"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3a9a0054ede438bdad170da42d44ed0a720d42ba","unresolved":false,"context_lines":[{"line_number":387,"context_line":"                              \"volume %(volume_id)s. The volume has the \""},{"line_number":388,"context_line":"                              \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":389,"context_line":"                              \"attachment_id Cinder most probably cannot \""},{"line_number":390,"context_line":"                              \"perform the detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":391,"context_line":"                    LOG.warning(msg)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"}],"source_content_type":"text/x-python","patch_set":80,"id":"9a68dd71_462550a9","line":390,"range":{"start_line":390,"start_character":55,"end_line":390,"end_character":79},"updated":"2016-01-20 20:53:20.000000000","message":"Pass the sub vars as an arg to the LOG.warning method.","commit_id":"3b3017e95cf7ccfff698da626730ad6a0e916797"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"1240e86d76960f87ae2c94a1449d8f56500c684e","unresolved":false,"context_lines":[{"line_number":387,"context_line":"                              \"volume %(volume_id)s. The volume has the \""},{"line_number":388,"context_line":"                              \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":389,"context_line":"                              \"attachment_id Cinder most probably cannot \""},{"line_number":390,"context_line":"                              \"perform the detach.\") % {\u0027volume_id\u0027: volume_id}"},{"line_number":391,"context_line":"                    LOG.warning(msg)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"}],"source_content_type":"text/x-python","patch_set":80,"id":"9a68dd71_060af826","line":390,"range":{"start_line":390,"start_character":55,"end_line":390,"end_character":79},"in_reply_to":"9a68dd71_462550a9","updated":"2016-01-20 21:07:50.000000000","message":"Done","commit_id":"3b3017e95cf7ccfff698da626730ad6a0e916797"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e031f3bcc3d470499021026600ddf1a4503e07fb","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                                        \"enabled, without the attachment_id \""},{"line_number":381,"context_line":"                                        \"Cinder most probably cannot perform \""},{"line_number":382,"context_line":"                                        \"the detach.\""},{"line_number":383,"context_line":"                                        ), {\u0027volume_id\u0027: volume_id,"},{"line_number":384,"context_line":"                                             \u0027instance_id\u0027: instance_uuid})"},{"line_number":385,"context_line":"                else:"},{"line_number":386,"context_line":"                    LOG.warning(_LW(\"attachment_id couldn\u0027t be retrieved for \""},{"line_number":387,"context_line":"                                    \"volume %(volume_id)s. The volume has the \""}],"source_content_type":"text/x-python","patch_set":81,"id":"9a68dd71_692625bc","line":384,"range":{"start_line":383,"start_character":43,"end_line":384,"end_character":74},"updated":"2016-01-20 21:12:01.000000000","message":"If you have to respin, drop this a line and line up instance_id with volume_id.","commit_id":"fac8e137ca742ee5b17e83a66774a5627e3b1202"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e031f3bcc3d470499021026600ddf1a4503e07fb","unresolved":false,"context_lines":[{"line_number":388,"context_line":"                                    \"\u0027multiattach\u0027 flag enabled, without the \""},{"line_number":389,"context_line":"                                    \"attachment_id Cinder most probably \""},{"line_number":390,"context_line":"                                    \"cannot perform the detach.\""},{"line_number":391,"context_line":"                                    ), {\u0027volume_id\u0027: volume_id})"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        cinderclient(context).volumes.detach(volume_id, attachment_id)"},{"line_number":394,"context_line":""}],"source_content_type":"text/x-python","patch_set":81,"id":"9a68dd71_e941b53a","line":391,"range":{"start_line":391,"start_character":39,"end_line":391,"end_character":63},"updated":"2016-01-20 21:12:01.000000000","message":"If you respin, drop this a line so it\u0027s lined up with the _LW arg.","commit_id":"fac8e137ca742ee5b17e83a66774a5627e3b1202"}]}
