)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"68521bfed6b4dff387050b8dc6f1aff53471d814","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As we discussed at spec[1], add nova-manage command"},{"line_number":10,"context_line":"\"nova-manage db volume_force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There is no changes with nova rest api and only"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"fa1b9901_fb755263","line":10,"updated":"2015-08-21 03:47:41.000000000","message":"Um is that the correct command. Shouldn\u0027t it be\nnova-manage volume volume_force_detach ?\nWhich seems a little redundant perhaps rename \u0027volume_force_detach\u0027 to \u0027force_detach\u0027 ?","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"a2202be9858753e2b96d151a9587dd0261bc8512","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As we discussed at spec[1], add nova-manage command"},{"line_number":10,"context_line":"\"nova-manage db volume_force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There is no changes with nova rest api and only"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"fa1b9901_1b6cc633","line":10,"in_reply_to":"fa1b9901_fb755263","updated":"2015-08-21 06:11:44.000000000","message":"I forgot to update this, thanks!","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As we discussed at spec[1], add nova-manage command"},{"line_number":10,"context_line":"\"nova-manage volume force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"ba15a1d1_86e8287e","line":9,"updated":"2015-09-14 19:34:13.000000000","message":"I don\u0027t want to go back and hash through the spec comments - this commit message should have more details on what the specific failure scenarios are to justify why we need this force detach command, what it does and why.  For example, if we need to call compute.rpcapi.detach_volume rather than just compute.api.detach_volume - why?  Is it to avoid these state checks?\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L3091","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As we discussed at spec[1], add nova-manage command"},{"line_number":10,"context_line":"\"nova-manage volume force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"ba15a1d1_15a83f1f","line":9,"in_reply_to":"ba15a1d1_86e8287e","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":10,"context_line":"\"nova-manage volume force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There is no changes with nova rest api and only"},{"line_number":14,"context_line":"add an option argument in internal method:"},{"line_number":15,"context_line":"rpc_api.detach_volume."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"ba15a1d1_6004db7d","line":13,"updated":"2015-09-14 19:34:13.000000000","message":"This is no longer a part of this change, so you should remove it from the commit message.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"\"nova-manage volume force_detach\" for safely"},{"line_number":11,"context_line":"cleaning attachment info in nova side."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There is no changes with nova rest api and only"},{"line_number":14,"context_line":"add an option argument in internal method:"},{"line_number":15,"context_line":"rpc_api.detach_volume."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"ba15a1d1_35a54346","line":13,"in_reply_to":"ba15a1d1_6004db7d","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c4e5a45509e0e259451d787e88c50741ffc6504","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Andrea Rosa \u003candrea.rosa@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-17 11:41:52 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a nova-manage command to make Nova gracefully clean up its own"},{"line_number":10,"context_line":"attachment records when volumes are stuck in \u0027attaching\u0027 or \u0027detaching\u0027"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_786612bc","line":7,"updated":"2015-09-18 13:33:02.000000000","message":"nit: s/attachment/volume attachment/\n\nJust because I always have a hard time finding this review in my dashboard since it doesn\u0027t have \u0027volume\u0027 in the title.","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"4cd11da2972caf7ddacb54fca1a859d4aa37d684","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Andrea Rosa \u003candrea.rosa@hp.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-17 11:41:52 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add nova-manage command for cleaning attachment"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a nova-manage command to make Nova gracefully clean up its own"},{"line_number":10,"context_line":"attachment records when volumes are stuck in \u0027attaching\u0027 or \u0027detaching\u0027"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_33767406","line":7,"in_reply_to":"ba15a1d1_786612bc","updated":"2015-09-18 16:19:47.000000000","message":"Done","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9b537a2a19227a98d38c97e2faca6ecc54def392","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_f821c29e","line":23,"updated":"2015-09-18 13:27:30.000000000","message":"Does this also close bug 1335889?  Sounds like the same solution is going to be needed there.","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"3fcc315e257198cc2781ba85294fff0d66c73229","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_d8815ec4","line":23,"in_reply_to":"ba15a1d1_3832daa7","updated":"2015-09-18 13:39:38.000000000","message":"I\u0027d have to verify, but I\u0027m not sure that we can get this use case to work (detach volume from deleted instance). Currently, cinder needs a connector to detach a volume. Is the connector still in the Nova DB even after it is deleted? If so, this might work and would be a great feature.\nIf the connector is gone or invalid, we\u0027ll need another way to cleanup these volumes attached to deleted instances. Cinder has discussed a new API to somehow force detach a volume without a connector. It would be a blunt instrument that basically detached all attachments for that volume, so in the multi-attach case might cause some surprises if admin and user were unaware of this. Hopefully we get this in Mitaka.","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"ab2fb277ad4cddf9985c1ad7feba090576ae8118","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_e8624a3d","line":23,"in_reply_to":"ba15a1d1_936bc01d","updated":"2015-09-18 16:57:22.000000000","message":"I see it as ideal to be able to call this command and have it result in the volume being available, regardless of the state, including a deleted Nova instance.\nThe work to fix this in the Cinder side will likely be in for Mitaka, but may not be as fine-grained as solving it here. (i.e. for only this single connection as opposed to all connections in the mult-attached case).\nPerhaps we should work to get this in as is, and re-visit in Mitaka as an enhancement to nova-manage if desired and/or necessary?","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"4cd11da2972caf7ddacb54fca1a859d4aa37d684","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_936bc01d","line":23,"in_reply_to":"ba15a1d1_d8815ec4","updated":"2015-09-18 16:19:47.000000000","message":"The connector is still in the nova DB in the (soft) deleted record, so technically we have all the info required by Cinder to go ahead and delete the volume.\nI am a bit worried to add it here as one of the main concern  when we discussed this change was that we do not want to try to fix something in the cinder from nova, once Nova has done its job it should not care about Cinder.\nOn the other side I reckon that this is a command and not a nova code so I am open to put this extra logic in.\nScott if you have a good confidence that the new API will land in Mitaka I do not think we should try to cleanup cinder from Nova with this change.","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c4e5a45509e0e259451d787e88c50741ffc6504","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_3832daa7","line":23,"in_reply_to":"ba15a1d1_f821c29e","updated":"2015-09-18 13:33:02.000000000","message":"Bug 1335889 might be a bit different in that I think in that case the server instance is deleted but the volume on the cinder side is still in-use, so you can\u0027t delete it on the cinder side since it still thinks there is a server instance attached.\n\nSo if we were going to account for that here, we\u0027d need to also read_deleted\u003d\u0027yes\u0027 instances when getting the instance to detach from.","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"4cd11da2972caf7ddacb54fca1a859d4aa37d684","unresolved":false,"context_lines":[{"line_number":20,"context_line":"amend the DB."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"ba15a1d1_1305700f","line":23,"in_reply_to":"ba15a1d1_f821c29e","updated":"2015-09-18 16:19:47.000000000","message":"This change is not addressing the race conditions mentioned in the ticket, but gives the tool to clean up the situation if something goes wrong, but I do not think I should add an additional \u0027close bug\u0027 line","commit_id":"121d595a95e1d018757c3532a03331011927fda2"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d800df305628bc62391804c79feb54fcdd02ba0d","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"ba8a016a_3c992120","line":25,"updated":"2015-11-17 11:19:52.000000000","message":"If we need to respin this, please add: \nblueprint add-force-detach-to-nova","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"da9b9a2f1c8f25f226b73c8be236e78b385ae392","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"ba8a016a_5414ea42","line":25,"in_reply_to":"ba8a016a_3c992120","updated":"2015-11-17 16:46:16.000000000","message":"if I convince you to remove your -1 probably I do not need to respin ;)","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"fbb56134cff64f783f1d8b12515b26536aa767e3","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Co-Authored-By: wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":23,"context_line":"Closes-Bug: #1449221"},{"line_number":24,"context_line":"DocImpact"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I8022174ac311f588b669e1d4cf6704270ed12b94"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"9a8ffd7b_4219d721","line":25,"in_reply_to":"ba8a016a_5414ea42","updated":"2015-11-30 16:21:20.000000000","message":"as I didn\u0027t convince you, I\u0027ll add the bp ref in the next patch","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"}],"nova/cmd/manage.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e10cb28f1391f1145752a677d0aac35a2764d97c","unresolved":false,"context_lines":[{"line_number":939,"context_line":"        print(migration.db_version())"},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"    @args(\u0027--max_rows\u0027, metavar\u003d\u0027\u003cnumber\u003e\u0027,"},{"line_number":942,"context_line":"            help\u003d\u0027Maximum number of deleted rows to archive\u0027)"},{"line_number":943,"context_line":"    def archive_deleted_rows(self, max_rows):"},{"line_number":944,"context_line":"        \"\"\"Move up to max_rows deleted rows from production tables to shadow"},{"line_number":945,"context_line":"        tables."}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_3d1030a8","side":"PARENT","line":942,"updated":"2015-08-18 17:22:12.000000000","message":"This is an unrelated change, please undo.","commit_id":"5ad2f8e82c632520560fc526b361fe5b3e990412"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e10cb28f1391f1145752a677d0aac35a2764d97c","unresolved":false,"context_lines":[{"line_number":983,"context_line":"            print(_(\u0027There were no records found where \u0027"},{"line_number":984,"context_line":"                    \u0027instance_uuid was NULL.\u0027))"},{"line_number":985,"context_line":""},{"line_number":986,"context_line":"    @args(\u0027--instance\u0027, metavar\u003d\u0027\u003cInstance uuid\u003e\u0027,"},{"line_number":987,"context_line":"          help\u003d\u0027Instance uuid to detach volume\u0027)"},{"line_number":988,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume uuid\u003e\u0027,"},{"line_number":989,"context_line":"          help\u003d\u0027Volume uuid to detach\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_fd7398e5","line":986,"updated":"2015-08-18 17:22:12.000000000","message":"s/uuid/UUID/ here and throughout if it shows up in help text.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":983,"context_line":"            print(_(\u0027There were no records found where \u0027"},{"line_number":984,"context_line":"                    \u0027instance_uuid was NULL.\u0027))"},{"line_number":985,"context_line":""},{"line_number":986,"context_line":"    @args(\u0027--instance\u0027, metavar\u003d\u0027\u003cInstance uuid\u003e\u0027,"},{"line_number":987,"context_line":"          help\u003d\u0027Instance uuid to detach volume\u0027)"},{"line_number":988,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume uuid\u003e\u0027,"},{"line_number":989,"context_line":"          help\u003d\u0027Volume uuid to detach\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_c5625dad","line":986,"in_reply_to":"fa1b9901_fd7398e5","updated":"2015-08-19 09:24:26.000000000","message":"Done","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e10cb28f1391f1145752a677d0aac35a2764d97c","unresolved":false,"context_lines":[{"line_number":987,"context_line":"          help\u003d\u0027Instance uuid to detach volume\u0027)"},{"line_number":988,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume uuid\u003e\u0027,"},{"line_number":989,"context_line":"          help\u003d\u0027Volume uuid to detach\u0027)"},{"line_number":990,"context_line":"    def volume_force_detach(self, instance, volume):"},{"line_number":991,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":992,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":993,"context_line":"        volume_api \u003d volume_client.API()"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_380d9e37","line":990,"updated":"2015-08-18 17:22:12.000000000","message":"It seems there would be a better class to put this under than the DbCommands class, which is generally more for things related to migrations and schema changes.  We don\u0027t have a VolumeCommands class, but we have VmCommands and it seems this would fit better under that class.  Everything in here hits the database directly, that\u0027s the intent - to avoid the REST API, but that doesn\u0027t mean all commands are DbCommands.\n\nAlternatively, just throw this in a new VolumeCommands class which would add a new \u0027volume\u0027 category which would probably make this easier to find.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":987,"context_line":"          help\u003d\u0027Instance uuid to detach volume\u0027)"},{"line_number":988,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume uuid\u003e\u0027,"},{"line_number":989,"context_line":"          help\u003d\u0027Volume uuid to detach\u0027)"},{"line_number":990,"context_line":"    def volume_force_detach(self, instance, volume):"},{"line_number":991,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":992,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":993,"context_line":"        volume_api \u003d volume_client.API()"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_45ce4d5b","line":990,"in_reply_to":"fa1b9901_380d9e37","updated":"2015-08-19 09:24:26.000000000","message":"I like the idea of  VolumeCommands class, thanks Matt.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e10cb28f1391f1145752a677d0aac35a2764d97c","unresolved":false,"context_lines":[{"line_number":992,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":993,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":994,"context_line":"        compute_api \u003d compute.API()"},{"line_number":995,"context_line":"        vol \u003d volume_api.get(ctxt, volume)"},{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_78beb6d5","line":995,"updated":"2015-08-18 17:22:12.000000000","message":"You need to gracefully handle a NotFound returned from the volume_api.get and compute_api.get calls.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":992,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":993,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":994,"context_line":"        compute_api \u003d compute.API()"},{"line_number":995,"context_line":"        vol \u003d volume_api.get(ctxt, volume)"},{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_8510e5a9","line":995,"in_reply_to":"fa1b9901_78beb6d5","updated":"2015-08-19 09:24:26.000000000","message":"Sure.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e10cb28f1391f1145752a677d0aac35a2764d97c","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        compute_api \u003d compute.API()"},{"line_number":995,"context_line":"        vol \u003d volume_api.get(ctxt, volume)"},{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_580652cf","line":997,"updated":"2015-08-18 17:22:12.000000000","message":"Isn\u0027t it possible to have the same volume attached to multiple instances?  Is that a different key in the volume dictionary or API call?  I\u0027m not familiar with how we determine that, seems like you\u0027d get back a list of instance_uuids per volume.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        compute_api \u003d compute.API()"},{"line_number":995,"context_line":"        vol \u003d volume_api.get(ctxt, volume)"},{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_258b19c5","line":997,"in_reply_to":"fa1b9901_13599bfe","updated":"2015-08-19 09:24:26.000000000","message":"Agree with Scott, we need to change this when nova using attachments to get instance uuid for multi-attach.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"fd451c024d6bb2cdf55fefcd3e1aa305fd89f2e5","unresolved":false,"context_lines":[{"line_number":994,"context_line":"        compute_api \u003d compute.API()"},{"line_number":995,"context_line":"        vol \u003d volume_api.get(ctxt, volume)"},{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_13599bfe","line":997,"in_reply_to":"fa1b9901_580652cf","updated":"2015-08-18 17:38:05.000000000","message":"multi-attach in Nova has not landed yet. There may be some changes here when it does.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"c03a2e1b128a646a197d2322dffa6b4b8bcf471a","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_d15ca6f2","line":999,"updated":"2015-08-14 13:01:45.000000000","message":"what about calling the compute_api.detach_volume directly and leave the check about the Volume Unattached be performed by the code there?","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"00d2324c465eec5c7f26b670dbf21e59651077c2","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_9e4644be","line":999,"in_reply_to":"1a4dcd0f_d15ca6f2","updated":"2015-08-17 21:07:27.000000000","message":"In fact, we may want to cleanup the Nova DB for a volume in the BlockDeviceMapping table and/or call libvirt detach_volume, even when the Cinder DB does not have the \u0027instance_uuid\u0027 field populated. So we should not check that they match but should just go ahead and call compute_api._detach_volume.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"661f2f5294b0975c872d5b4fbb729baabce28589","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_e56ea8c8","line":999,"in_reply_to":"fa1b9901_99ede58d","updated":"2015-08-18 13:30:48.000000000","message":"That sounds good.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2db122230654494bcf5413228c4c0ea82d42f905","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_99ede58d","line":999,"in_reply_to":"fa1b9901_9e4644be","updated":"2015-08-18 10:15:39.000000000","message":"Actuyally I think we can modify the patch to call directly the compute rpcapi, that will send a message to the right host which will try to disconnect the volume from the vm, delete the bdm, terminate the connection and call the cinder detach. \nHow does it sound?","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_48dae479","line":999,"in_reply_to":"fa1b9901_e26453e6","updated":"2015-08-19 09:24:26.000000000","message":"Great, I will update the patch.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"48dff578b4f4212c980b2be3e76f6d7ef1391532","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        instance \u003d compute_api.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":997,"context_line":"        if vol[\u0027instance_uuid\u0027] !\u003d instance.uuid:"},{"line_number":998,"context_line":"            raise exception.VolumeUnattached(volume_id\u003dvol[\u0027id\u0027])"},{"line_number":999,"context_line":"        compute_api._detach_volume(ctxt, instance, vol, force\u003dTrue)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"class ApiDbCommands(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_e26453e6","line":999,"in_reply_to":"fa1b9901_e56ea8c8","updated":"2015-08-18 16:41:34.000000000","message":"+1 for calling the compute RPCAPI.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"from nova.api.ec2 import ec2utils"},{"line_number":72,"context_line":"from nova import availability_zones"},{"line_number":73,"context_line":"from nova.compute import api as comute_api"},{"line_number":74,"context_line":"from nova.compute import rpcapi as compute_rpcapi"},{"line_number":75,"context_line":"from nova import config"},{"line_number":76,"context_line":"from nova import context"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_fb711d45","line":73,"updated":"2015-08-19 20:29:21.000000000","message":"comute_api -\u003e compute_api","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"from nova.api.ec2 import ec2utils"},{"line_number":72,"context_line":"from nova import availability_zones"},{"line_number":73,"context_line":"from nova.compute import api as comute_api"},{"line_number":74,"context_line":"from nova.compute import rpcapi as compute_rpcapi"},{"line_number":75,"context_line":"from nova import config"},{"line_number":76,"context_line":"from nova import context"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_3598f977","line":73,"in_reply_to":"fa1b9901_fb711d45","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2010506d231f0e45054a1080f410edfa0561a3a6","unresolved":false,"context_lines":[{"line_number":702,"context_line":""},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"class VolumeCommands(object):"},{"line_number":705,"context_line":"    \"\"\"Class for mangaging Volumes.\"\"\""},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"    @args(\u0027--instance\u0027, metavar\u003d\u0027\u003cInstance UUID\u003e\u0027,"},{"line_number":708,"context_line":"          help\u003d\u0027Instance UUID to detach volume\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_7e2d0994","line":705,"updated":"2015-08-19 16:15:54.000000000","message":"typo: managing","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":702,"context_line":""},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"class VolumeCommands(object):"},{"line_number":705,"context_line":"    \"\"\"Class for mangaging Volumes.\"\"\""},{"line_number":706,"context_line":""},{"line_number":707,"context_line":"    @args(\u0027--instance\u0027, metavar\u003d\u0027\u003cInstance UUID\u003e\u0027,"},{"line_number":708,"context_line":"          help\u003d\u0027Instance UUID to detach volume\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_22543d1f","line":705,"in_reply_to":"fa1b9901_7e2d0994","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":712,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":713,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":714,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":715,"context_line":"        compute_API \u003d comute_api.API()"},{"line_number":716,"context_line":"        compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5b6cc9cf","line":715,"updated":"2015-08-19 20:29:21.000000000","message":"comute_api -\u003e compute_api","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":712,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":713,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":714,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":715,"context_line":"        compute_API \u003d comute_api.API()"},{"line_number":716,"context_line":"        compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_d5541d00","line":715,"in_reply_to":"fa1b9901_5b6cc9cf","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":714,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":715,"context_line":"        compute_API \u003d comute_api.API()"},{"line_number":716,"context_line":"        compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"},{"line_number":719,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_fb8b5d66","line":716,"updated":"2015-08-19 20:29:21.000000000","message":"causes pep8 failure:\n./nova/cmd/manage.py:716:26: F823 local variable \u0027compute_rpcapi\u0027 (defined in enclosing scope on line 74) referenced before assignment\n\nsee:\nhttp://logs.openstack.org/37/184537/10/check/gate-nova-pep8/c8d7651/console.html#_2015-08-19_12_33_20_894","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":714,"context_line":"        volume_api \u003d volume_client.API()"},{"line_number":715,"context_line":"        compute_API \u003d comute_api.API()"},{"line_number":716,"context_line":"        compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"},{"line_number":719,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_55680db9","line":716,"in_reply_to":"fa1b9901_fb8b5d66","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"},{"line_number":719,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":720,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":721,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":722,"context_line":"        except exception.InstanceNotFound:"},{"line_number":723,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_dbe53938","line":720,"updated":"2015-08-19 20:29:21.000000000","message":"causes pep8 failure:\n./nova/cmd/manage.py:720:44: F841 local variable \u0027e\u0027 is assigned to but never used\n\nsame logs as above","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":717,"context_line":"        try:"},{"line_number":718,"context_line":"            vol \u003d volume_api.get(ctxt, volume)"},{"line_number":719,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":720,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":721,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":722,"context_line":"        except exception.InstanceNotFound:"},{"line_number":723,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_155e1512","line":720,"in_reply_to":"fa1b9901_dbe53938","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2010506d231f0e45054a1080f410edfa0561a3a6","unresolved":false,"context_lines":[{"line_number":722,"context_line":"        except exception.InstanceNotFound:"},{"line_number":723,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":724,"context_line":"        compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":725,"context_line":"                                     volume_id\u003dvol[\u0027id\u0027])"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"class ServiceCommands(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_fe76f9d5","line":725,"updated":"2015-08-19 16:15:54.000000000","message":"now that we are calling directly the compute manager I think it is worth to put (back) here the check that we are deleting a volume from the right instance.\nI know that this command will be used just by super-expert users....but they are humans.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":722,"context_line":"        except exception.InstanceNotFound:"},{"line_number":723,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":724,"context_line":"        compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":725,"context_line":"                                     volume_id\u003dvol[\u0027id\u0027])"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"class ServiceCommands(object):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_35231958","line":725,"in_reply_to":"fa1b9901_fe76f9d5","updated":"2015-08-20 00:58:56.000000000","message":"Cinder DB may not have the \u0027instance_uuid\u0027 field populated. So we should not to check they match.\nSee Scott\u0027s comment in previous patch.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2010506d231f0e45054a1080f410edfa0561a3a6","unresolved":false,"context_lines":[{"line_number":966,"context_line":"        print(migration.db_version())"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"    @args(\u0027--max_rows\u0027, metavar\u003d\u0027\u003cnumber\u003e\u0027,"},{"line_number":969,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive\u0027)"},{"line_number":970,"context_line":"    def archive_deleted_rows(self, max_rows):"},{"line_number":971,"context_line":"        \"\"\"Move up to max_rows deleted rows from production tables to shadow"},{"line_number":972,"context_line":"        tables."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_beb96117","line":969,"updated":"2015-08-19 16:15:54.000000000","message":"nit: this is a not required change.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":966,"context_line":"        print(migration.db_version())"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"    @args(\u0027--max_rows\u0027, metavar\u003d\u0027\u003cnumber\u003e\u0027,"},{"line_number":969,"context_line":"          help\u003d\u0027Maximum number of deleted rows to archive\u0027)"},{"line_number":970,"context_line":"    def archive_deleted_rows(self, max_rows):"},{"line_number":971,"context_line":"        \"\"\"Move up to max_rows deleted rows from production tables to shadow"},{"line_number":972,"context_line":"        tables."}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_55200d48","line":969,"in_reply_to":"fa1b9901_beb96117","updated":"2015-08-20 00:58:56.000000000","message":"Done","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":718,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027,"},{"line_number":719,"context_line":"          help\u003d\u0027Url of auth to use to create cinder context\u0027)"},{"line_number":720,"context_line":"    @args(\u0027--api_insecure\u0027, metavar\u003d\u0027\u003cApi Insecure\u003e\u0027,"},{"line_number":721,"context_line":"          help\u003d\u0027If set, ignore any SSL validation issues\u0027)"},{"line_number":722,"context_line":"    def volume_force_detach(self, instance, volume, admin_tenant_name,"},{"line_number":723,"context_line":"                            admin_username, admin_password, admin_auth_url,"},{"line_number":724,"context_line":"                            api_insecure):"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_4004a516","line":721,"updated":"2015-08-20 15:52:41.000000000","message":"can we just put defined this option as required and default them to the ENV values if present?","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1f1510bbf2e9b9c941e44156a1b08b90e967520a","unresolved":false,"context_lines":[{"line_number":718,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027,"},{"line_number":719,"context_line":"          help\u003d\u0027Url of auth to use to create cinder context\u0027)"},{"line_number":720,"context_line":"    @args(\u0027--api_insecure\u0027, metavar\u003d\u0027\u003cApi Insecure\u003e\u0027,"},{"line_number":721,"context_line":"          help\u003d\u0027If set, ignore any SSL validation issues\u0027)"},{"line_number":722,"context_line":"    def volume_force_detach(self, instance, volume, admin_tenant_name,"},{"line_number":723,"context_line":"                            admin_username, admin_password, admin_auth_url,"},{"line_number":724,"context_line":"                            api_insecure):"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_d5d4e0ec","line":721,"in_reply_to":"fa1b9901_4004a516","updated":"2015-08-21 01:18:38.000000000","message":"It\u0027s better way, but I\u0027m not sure how to do it.  I\u0027d like to find some examples.","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            raise Exception(_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                              \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        if api_insecure is None:"},{"line_number":732,"context_line":"            api_insecure \u003d False"},{"line_number":733,"context_line":"        ctxt \u003d self.get_cinder_admin_context(admin_tenant_name, admin_username,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_5256bc06","line":730,"updated":"2015-08-20 15:52:41.000000000","message":"why raising the exception? we should just print the error message","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1f1510bbf2e9b9c941e44156a1b08b90e967520a","unresolved":false,"context_lines":[{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            raise Exception(_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                              \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        if api_insecure is None:"},{"line_number":732,"context_line":"            api_insecure \u003d False"},{"line_number":733,"context_line":"        ctxt \u003d self.get_cinder_admin_context(admin_tenant_name, admin_username,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_95dae815","line":730,"in_reply_to":"fa1b9901_5256bc06","updated":"2015-08-21 01:18:38.000000000","message":"Done","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"30b9fb34f4c3177b775de9afda37953d65e010bd","unresolved":false,"context_lines":[{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            raise Exception(_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                              \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        if api_insecure is None:"},{"line_number":732,"context_line":"            api_insecure \u003d False"},{"line_number":733,"context_line":"        ctxt \u003d self.get_cinder_admin_context(admin_tenant_name, admin_username,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_159ed806","line":730,"in_reply_to":"fa1b9901_5256bc06","updated":"2015-08-21 01:21:58.000000000","message":"from the message, this is a invalid input,\nmaybe we can use raise exception.InvalidInput(reason\u003dreason)?\nsorry I am not sure, not expert of nova client.","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":729,"context_line":"            raise Exception(_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                              \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        if api_insecure is None:"},{"line_number":732,"context_line":"            api_insecure \u003d False"},{"line_number":733,"context_line":"        ctxt \u003d self.get_cinder_admin_context(admin_tenant_name, admin_username,"},{"line_number":734,"context_line":"                                             admin_password, admin_auth_url,"},{"line_number":735,"context_line":"                                             api_insecure)"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_52aa3c86","line":732,"updated":"2015-08-20 15:52:41.000000000","message":"you could set False as default","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1f1510bbf2e9b9c941e44156a1b08b90e967520a","unresolved":false,"context_lines":[{"line_number":729,"context_line":"            raise Exception(_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                              \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        if api_insecure is None:"},{"line_number":732,"context_line":"            api_insecure \u003d False"},{"line_number":733,"context_line":"        ctxt \u003d self.get_cinder_admin_context(admin_tenant_name, admin_username,"},{"line_number":734,"context_line":"                                             admin_password, admin_auth_url,"},{"line_number":735,"context_line":"                                             api_insecure)"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_3500bc65","line":732,"in_reply_to":"fa1b9901_52aa3c86","updated":"2015-08-21 01:18:38.000000000","message":"Sure","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":740,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":741,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound:"},{"line_number":743,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":746,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_3240e833","line":743,"updated":"2015-08-20 15:52:41.000000000","message":"same as above","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"30b9fb34f4c3177b775de9afda37953d65e010bd","unresolved":false,"context_lines":[{"line_number":740,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":741,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound:"},{"line_number":743,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":746,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_9592e8f4","line":743,"in_reply_to":"fa1b9901_3240e833","updated":"2015-08-21 01:21:58.000000000","message":"will this be more accurate ?\nraise exception.NotFound(\u0027Could not find volume\u0027)","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":742,"context_line":"        except exception.VolumeNotFound:"},{"line_number":743,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":746,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":747,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":748,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_b27ab886","line":745,"updated":"2015-08-20 15:52:41.000000000","message":"same as above","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"30b9fb34f4c3177b775de9afda37953d65e010bd","unresolved":false,"context_lines":[{"line_number":742,"context_line":"        except exception.VolumeNotFound:"},{"line_number":743,"context_line":"            raise exception.NotFound(\u0027Could not find volume\u0027)"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            raise exception.NotFound(\u0027Could not find Instance\u0027)"},{"line_number":746,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":747,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":748,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_b58dacd4","line":745,"in_reply_to":"fa1b9901_b27ab886","updated":"2015-08-21 01:21:58.000000000","message":"ditto","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":747,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":748,"context_line":""},{"line_number":749,"context_line":"    def get_cinder_admin_context(admin_tenant_name, admin_username,"},{"line_number":750,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":751,"context_line":"        try:"},{"line_number":752,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"},{"line_number":753,"context_line":"                                               username\u003dadmin_username,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_727e606b","line":750,"updated":"2015-08-20 15:52:41.000000000","message":"this is not related to the cinder, I\u0027d call the methind get_admin_context","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1f1510bbf2e9b9c941e44156a1b08b90e967520a","unresolved":false,"context_lines":[{"line_number":747,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":748,"context_line":""},{"line_number":749,"context_line":"    def get_cinder_admin_context(admin_tenant_name, admin_username,"},{"line_number":750,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":751,"context_line":"        try:"},{"line_number":752,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"},{"line_number":753,"context_line":"                                               username\u003dadmin_username,"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_f5f6c48d","line":750,"in_reply_to":"fa1b9901_727e606b","updated":"2015-08-21 01:18:38.000000000","message":"OK","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"5193c9c9e3576aa6698367d6e43a90964861eac0","unresolved":false,"context_lines":[{"line_number":762,"context_line":"                                          read_delete\u003dTrue,"},{"line_number":763,"context_line":"                                          overwrite\u003dFalse)"},{"line_number":764,"context_line":"        except Exception as e:"},{"line_number":765,"context_line":"            raise Exception(_(\"Get the context failed, msg: %s\"), e)"},{"line_number":766,"context_line":""},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"class ServiceCommands(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa1b9901_929e94b7","line":765,"updated":"2015-08-20 15:52:41.000000000","message":"same as above","commit_id":"c6ade04af99a511e6659203e337440337f095499"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c6bb6ea6a7e5afaae663a8c2c210418b8fa6bf3b","unresolved":false,"context_lines":[{"line_number":709,"context_line":"          help\u003d\u0027Instance UUID to detach volume\u0027)"},{"line_number":710,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume UUID\u003e\u0027,"},{"line_number":711,"context_line":"          help\u003d\u0027Volume UUID to detach\u0027)"},{"line_number":712,"context_line":"    @args(\u0027--tennat_name\u0027, metavar\u003d\u0027\u003cTenant Name\u003e\u0027, dest\u003d\u0027admin_tenant_name\u0027,"},{"line_number":713,"context_line":"          help\u003d\u0027Name of admin tenant to use to create cinder context\u0027)"},{"line_number":714,"context_line":"    @args(\u0027--user_name\u0027, metavar\u003d\u0027\u003cUser Name\u003e\u0027, dest\u003d\u0027admin_username\u0027,"},{"line_number":715,"context_line":"          help\u003d\u0027Name of admin user to use to create cinder context\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_1da27e99","line":712,"updated":"2015-08-21 02:52:44.000000000","message":"tennat_name \u003d\u003e tenant_name","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1ce117416cf819a7d55f5cf938aeef331fecc7ae","unresolved":false,"context_lines":[{"line_number":709,"context_line":"          help\u003d\u0027Instance UUID to detach volume\u0027)"},{"line_number":710,"context_line":"    @args(\u0027--volume\u0027, metavar\u003d\u0027\u003cVolume UUID\u003e\u0027,"},{"line_number":711,"context_line":"          help\u003d\u0027Volume UUID to detach\u0027)"},{"line_number":712,"context_line":"    @args(\u0027--tennat_name\u0027, metavar\u003d\u0027\u003cTenant Name\u003e\u0027, dest\u003d\u0027admin_tenant_name\u0027,"},{"line_number":713,"context_line":"          help\u003d\u0027Name of admin tenant to use to create cinder context\u0027)"},{"line_number":714,"context_line":"    @args(\u0027--user_name\u0027, metavar\u003d\u0027\u003cUser Name\u003e\u0027, dest\u003d\u0027admin_username\u0027,"},{"line_number":715,"context_line":"          help\u003d\u0027Name of admin user to use to create cinder context\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_7dbffa60","line":712,"in_reply_to":"fa1b9901_1da27e99","updated":"2015-08-21 03:03:37.000000000","message":"Done","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c6bb6ea6a7e5afaae663a8c2c210418b8fa6bf3b","unresolved":false,"context_lines":[{"line_number":726,"context_line":"        if (instance is None or volume is None or admin_tenant_name is None or"},{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            print (_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                     \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        ctxt \u003d self.get_admin_context(admin_tenant_name, admin_username,"},{"line_number":732,"context_line":"                                      admin_password, admin_auth_url,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_bd759232","line":729,"updated":"2015-08-21 02:52:44.000000000","message":"missing space at the end of the sentence","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1ce117416cf819a7d55f5cf938aeef331fecc7ae","unresolved":false,"context_lines":[{"line_number":726,"context_line":"        if (instance is None or volume is None or admin_tenant_name is None or"},{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            print (_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                     \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        ctxt \u003d self.get_admin_context(admin_tenant_name, admin_username,"},{"line_number":732,"context_line":"                                      admin_password, admin_auth_url,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_9dc20ee8","line":729,"in_reply_to":"fa1b9901_bd759232","updated":"2015-08-21 03:03:37.000000000","message":"Done","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c6bb6ea6a7e5afaae663a8c2c210418b8fa6bf3b","unresolved":false,"context_lines":[{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            print (_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                     \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        ctxt \u003d self.get_admin_context(admin_tenant_name, admin_username,"},{"line_number":732,"context_line":"                                      admin_password, admin_auth_url,"},{"line_number":733,"context_line":"                                      api_insecure)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_fda6aaac","line":730,"range":{"start_line":730,"start_character":22,"end_line":730,"end_character":33},"updated":"2015-08-21 02:52:44.000000000","message":"tennat_name \u003d\u003e tenant_name","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1ce117416cf819a7d55f5cf938aeef331fecc7ae","unresolved":false,"context_lines":[{"line_number":727,"context_line":"            admin_username is None or admin_password is None or"},{"line_number":728,"context_line":"            admin_auth_url is None):"},{"line_number":729,"context_line":"            print (_(\"Must contain parameters: instance, volume,\""},{"line_number":730,"context_line":"                     \"tennat_name, user_name, password, auth_url\"))"},{"line_number":731,"context_line":"        ctxt \u003d self.get_admin_context(admin_tenant_name, admin_username,"},{"line_number":732,"context_line":"                                      admin_password, admin_auth_url,"},{"line_number":733,"context_line":"                                      api_insecure)"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_fdb30a96","line":730,"in_reply_to":"fa1b9901_fda6aaac","updated":"2015-08-21 03:03:37.000000000","message":"Done","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c6bb6ea6a7e5afaae663a8c2c210418b8fa6bf3b","unresolved":false,"context_lines":[{"line_number":744,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":745,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def get_admin_context(admin_tenant_name, admin_username,"},{"line_number":748,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":749,"context_line":"        try:"},{"line_number":750,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_1dc91e59","line":747,"updated":"2015-08-21 02:52:44.000000000","message":"please use an _ as this is a private method","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"1ce117416cf819a7d55f5cf938aeef331fecc7ae","unresolved":false,"context_lines":[{"line_number":744,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":745,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def get_admin_context(admin_tenant_name, admin_username,"},{"line_number":748,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":749,"context_line":"        try:"},{"line_number":750,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa1b9901_bda91226","line":747,"in_reply_to":"fa1b9901_1dc91e59","updated":"2015-08-21 03:03:37.000000000","message":"Sure","commit_id":"623926491e495116cf79683e521ec69190b98489"},{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"68521bfed6b4dff387050b8dc6f1aff53471d814","unresolved":false,"context_lines":[{"line_number":747,"context_line":"    def _get_admin_context(admin_tenant_name, admin_username,"},{"line_number":748,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":749,"context_line":"        try:"},{"line_number":750,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"},{"line_number":751,"context_line":"                                               username\u003dadmin_username,"},{"line_number":752,"context_line":"                                               password\u003dadmin_password,"},{"line_number":753,"context_line":"                                               auth_url\u003dadmin_auth_url,"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_7b3aa29a","line":750,"updated":"2015-08-21 03:47:41.000000000","message":"As we\u0027re adding a new call into keystone_client I think we should go with the \"new world order\" and use a client Session.\n\nYou can get an example at:\nhttp://docs.openstack.org/developer/python-keystoneclient/using-sessions.html\n\nNote I\u0027m not suggesting we go to v3 just yet but with little change we could use a v2.Password()\nhttps://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/auth/identity/v2.py#L130","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"a2202be9858753e2b96d151a9587dd0261bc8512","unresolved":false,"context_lines":[{"line_number":747,"context_line":"    def _get_admin_context(admin_tenant_name, admin_username,"},{"line_number":748,"context_line":"                                 admin_password, admin_auth_url, api_insecure):"},{"line_number":749,"context_line":"        try:"},{"line_number":750,"context_line":"            _ksclient \u003d keystone_client.Client(tenant_name\u003dadmin_tenant_name,"},{"line_number":751,"context_line":"                                               username\u003dadmin_username,"},{"line_number":752,"context_line":"                                               password\u003dadmin_password,"},{"line_number":753,"context_line":"                                               auth_url\u003dadmin_auth_url,"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_4cea8275","line":750,"in_reply_to":"fa1b9901_7b3aa29a","updated":"2015-08-21 06:11:44.000000000","message":"Okay","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"68521bfed6b4dff387050b8dc6f1aff53471d814","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                                          service_catalog\u003dservice_catalog,"},{"line_number":760,"context_line":"                                          read_delete\u003dTrue,"},{"line_number":761,"context_line":"                                          overwrite\u003dFalse)"},{"line_number":762,"context_line":"        except Exception as e:"},{"line_number":763,"context_line":"            print(_(\"Get the context failed, msg: %s\"), e)"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_1b4a8626","line":762,"updated":"2015-08-21 03:47:41.000000000","message":"This seems overly broad can we do better for the user.","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"a2202be9858753e2b96d151a9587dd0261bc8512","unresolved":false,"context_lines":[{"line_number":759,"context_line":"                                          service_catalog\u003dservice_catalog,"},{"line_number":760,"context_line":"                                          read_delete\u003dTrue,"},{"line_number":761,"context_line":"                                          overwrite\u003dFalse)"},{"line_number":762,"context_line":"        except Exception as e:"},{"line_number":763,"context_line":"            print(_(\"Get the context failed, msg: %s\"), e)"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_ecea76da","line":762,"in_reply_to":"fa1b9901_1b4a8626","updated":"2015-08-21 06:11:44.000000000","message":"I feel it\u0027s fine, since we print the exception message to user, so no need to care about specific exception.","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"566f8357781e4c16d6f090748510530b98cb8b42","unresolved":false,"context_lines":[{"line_number":717,"context_line":"          help\u003d\u0027Name of admin user to use to create cinder context\u0027)"},{"line_number":718,"context_line":"    @args(\u0027--password\u0027, metavar\u003d\u0027\u003cPassword\u003e\u0027, dest\u003d\u0027admin_password\u0027,"},{"line_number":719,"context_line":"          help\u003d\u0027Password of admin user to use to create cinder context\u0027)"},{"line_number":720,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027admin_auth_url\u0027,"},{"line_number":721,"context_line":"          help\u003d\u0027Url of auth to use to create cinder context\u0027)"},{"line_number":722,"context_line":"    def force_detach(self, instance, volume, admin_tenant_name,"},{"line_number":723,"context_line":"                     admin_username, admin_password, admin_auth_url):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa1b9901_350bcbd7","line":720,"updated":"2015-08-21 08:47:31.000000000","message":"Does this match what the python-novaclient users for environment variables, with openrc?\n\nI think we need to make that work somehow:\nhttps://github.com/openstack/python-novaclient/blob/master/novaclient/shell.py#L255","commit_id":"43190e04d4910974b8d7a6e2e522aa5417afb77b"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"3168f3215436ea89ecefd84bf799c0d602255822","unresolved":false,"context_lines":[{"line_number":745,"context_line":"    def _get_admin_context(admin_tenant_name, admin_username, admin_password,"},{"line_number":746,"context_line":"                           admin_auth_url):"},{"line_number":747,"context_line":"        try:"},{"line_number":748,"context_line":"            auth \u003d v2.Token(auth_url\u003dadmin_auth_url,"},{"line_number":749,"context_line":"                            username\u003dadmin_username,"},{"line_number":750,"context_line":"                            password\u003dadmin_password,"},{"line_number":751,"context_line":"                            tenant_name\u003dadmin_tenant_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa1b9901_930e0831","line":748,"updated":"2015-08-24 16:55:38.000000000","message":"v2.Token is \"a plugin for authenticating with an existing token\"\nyou want to use v2.Password instead.","commit_id":"43190e04d4910974b8d7a6e2e522aa5417afb77b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"45e339b16b40152c9fb634f9ce63b0ffaa486d35","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"        except exception.InstanceNotFound:"},{"line_number":744,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":745,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_360af5d2","line":742,"updated":"2015-09-07 14:00:13.000000000","message":"missing return","commit_id":"537bf08eb9f28cb8ed4e0b4cab532f5cc58ef4a3"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"f4cb1a2456bb16b4839ad6097d07e64c97917497","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"        except exception.InstanceNotFound:"},{"line_number":744,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":745,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_af86a4b6","line":742,"in_reply_to":"da20952f_360af5d2","updated":"2015-09-07 15:22:02.000000000","message":"good catch, thanks","commit_id":"537bf08eb9f28cb8ed4e0b4cab532f5cc58ef4a3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"45e339b16b40152c9fb634f9ce63b0ffaa486d35","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"        except exception.InstanceNotFound:"},{"line_number":744,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":745,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _get_context(self, tenant_name,"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_96fbc1c0","line":744,"updated":"2015-09-07 14:00:13.000000000","message":"missing return","commit_id":"537bf08eb9f28cb8ed4e0b4cab532f5cc58ef4a3"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"f4cb1a2456bb16b4839ad6097d07e64c97917497","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"        except exception.InstanceNotFound:"},{"line_number":744,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":745,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"},{"line_number":746,"context_line":""},{"line_number":747,"context_line":"    def _get_context(self, tenant_name,"}],"source_content_type":"text/x-python","patch_set":20,"id":"da20952f_4f9108f0","line":744,"in_reply_to":"da20952f_96fbc1c0","updated":"2015-09-07 15:22:02.000000000","message":"Done","commit_id":"537bf08eb9f28cb8ed4e0b4cab532f5cc58ef4a3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":728,"context_line":"        ctxt, err \u003d self._get_context(tenant_name, username,"},{"line_number":729,"context_line":"                                      password, auth_url)"},{"line_number":730,"context_line":"        if err:"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_c04607bf","line":727,"updated":"2015-09-14 19:34:13.000000000","message":"I could be mistaken but I think this docstring actually serves as the description of the command in the help text.  If that\u0027s the case, I think we should have some more detailed information in here about what this is used for and in what cases it should (or should not) be used.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":728,"context_line":"        ctxt, err \u003d self._get_context(tenant_name, username,"},{"line_number":729,"context_line":"                                      password, auth_url)"},{"line_number":730,"context_line":"        if err:"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_c8749f69","line":727,"in_reply_to":"ba15a1d1_c04607bf","updated":"2015-09-17 08:13:40.000000000","message":"I checked and the docstring is not used in the help text, but I am going to make it a bit clearer .","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":728,"context_line":"        ctxt, err \u003d self._get_context(tenant_name, username,"},{"line_number":729,"context_line":"                                      password, auth_url)"},{"line_number":730,"context_line":"        if err:"},{"line_number":731,"context_line":"            print(err)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_60185b85","line":728,"updated":"2015-09-14 19:34:13.000000000","message":"Why don\u0027t we just use the admin context?  Only admins should have access to nova-manage commands.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in DB\"\"\""},{"line_number":728,"context_line":"        ctxt, err \u003d self._get_context(tenant_name, username,"},{"line_number":729,"context_line":"                                      password, auth_url)"},{"line_number":730,"context_line":"        if err:"},{"line_number":731,"context_line":"            print(err)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_487baff5","line":728,"in_reply_to":"ba15a1d1_60185b85","updated":"2015-09-17 08:13:40.000000000","message":"the admin context is not enough here as we need to talk to cinder using the cinderclient we need to have a REquest Context with a valid populate service_catalog, the admin context returns an empty service_catalog","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":736,"context_line":"        try:"},{"line_number":737,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":738,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_a63a0c35","line":739,"updated":"2015-09-14 19:34:13.000000000","message":"This is an RPC cast, therefore, wouldn\u0027t you want to make the CLI blocking so that either we know it succeeded or failed?  I\u0027m not exactly sure what you\u0027d block on though - you could be waiting for the bdm to be deleted in the nova database:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4648\n\n--\n\nAlso, you should not be calling compute_RPC directly, just call compute_API.detach_volume:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L3091\n\nThat has additional state checks in it which I\u0027d think we want here, like checking to see that the volume is attached before we try and detach it.\n\nOr is this actually handling the case that the volume is not showing as attached in the cinder database but it is showing as attached in the nova database and we\u0027re bypassing those checks here with the force call?  I think the use case / usage of this needs to be better documented in the commit message and description of the command.  I shouldn\u0027t have to go back and read through all of the comments in the spec to know what this is needed for.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":736,"context_line":"        try:"},{"line_number":737,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":738,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_ebaf1d28","line":739,"in_reply_to":"ba15a1d1_a63a0c35","updated":"2015-09-17 08:13:40.000000000","message":"you are right about the RPC cast I do not want to make CLI blocking I\u0027ll change the \"success\" message at the end says that the request has been sent as an async operation.\nAs regards calling directly the compute_RPC was discussed on PS #9 and as you said we do not want to have the extra-checks performed by the compute_API.detach_volume, because of the nature of the \"force\" action.\nI agree that this needs to be better documented in the commit message and in the docstring of this method.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_26c6fc67","line":742,"updated":"2015-09-14 19:34:13.000000000","message":"It would actually be better to just do this:\n\nexcept exception.VolumeNotFound as e:\n    print(six.text_type(e))\n    return 2\n\nBecause VolumeNotFound is a more useful error message since it has the volume_id in it:\n\nhttps://github.com/openstack/nova/blob/master/nova/exception.py#L575\n\nAlso - this would only happen in the call to volume_API.get, so just wrap that in this try/except, it shouldn\u0027t be in the scope of compute_API.get or compute_RPC.detach_volume.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":739,"context_line":"            compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_6b51cd35","line":742,"in_reply_to":"ba15a1d1_26c6fc67","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_06ae5885","line":743,"updated":"2015-09-14 19:34:13.000000000","message":"This should exit with a non-0 value since it failed, so I think you are supposed to return 2 (just by looking at other commands).","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":740,"context_line":"                                      volume_id\u003dvol[\u0027id\u0027])"},{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_0b429168","line":743,"in_reply_to":"ba15a1d1_06ae5885","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"},{"line_number":747,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_06f3b89f","line":744,"updated":"2015-09-14 19:34:13.000000000","message":"This should only be handled around the call to compute_API.get.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        except exception.VolumeNotFound:"},{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"},{"line_number":747,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_2b475578","line":744,"in_reply_to":"ba15a1d1_06f3b89f","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":742,"context_line":"            print (_(\u0027Could not find volume\u0027))"},{"line_number":743,"context_line":"            return"},{"line_number":744,"context_line":"        except exception.InstanceNotFound:"},{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_a6b52cce","line":745,"updated":"2015-09-14 19:34:13.000000000","message":"Same as above, just print the InstanceNotFound exception since it\u0027s more useful:\n\nhttps://github.com/openstack/nova/blob/master/nova/exception.py#L1391\n\nAnd return 2.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3a41abac0ad018dc41698fd425bd9da9e2c00a4","unresolved":false,"context_lines":[{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"    def _get_context(self, tenant_name,"},{"line_number":751,"context_line":"                           username,"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_4c5f9141","line":748,"updated":"2015-09-14 19:34:13.000000000","message":"I\u0027d put the instance and volume UUIDs in here for context.  If you\u0027re not going to block on the operation, then I\u0027d make a note that this is an asynchronous operation.","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"aaadb00d1a44759b60ae07e082421aab78b5a8a7","unresolved":false,"context_lines":[{"line_number":745,"context_line":"            print (_(\u0027Could not find Instance\u0027))"},{"line_number":746,"context_line":"            return"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"        print(_(\u0027Detach request sent successfully\u0027))"},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"    def _get_context(self, tenant_name,"},{"line_number":751,"context_line":"                           username,"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba15a1d1_eb5ddd47","line":748,"in_reply_to":"ba15a1d1_4c5f9141","updated":"2015-09-17 08:13:40.000000000","message":"Done","commit_id":"0f64c37fb1e1f7c6e760f02f78496b5cfc182e74"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"b1b99848eef4cdade03def5aa56bcd441d7af0b4","unresolved":false,"context_lines":[{"line_number":718,"context_line":"          default\u003dcliutils.env(\u0027OS_USERNAME\u0027, \u0027NOVA_USERNAME\u0027))"},{"line_number":719,"context_line":"    @args(\u0027--password\u0027, metavar\u003d\u0027\u003cPassword\u003e\u0027, dest\u003d\u0027password\u0027,"},{"line_number":720,"context_line":"          help\u003d\u0027User password\u0027,"},{"line_number":721,"context_line":"          default\u003dcliutils.env(\u0027OS_PASSWORD\u0027, \u0027NOVA_PASSWORD\u0027))"},{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"}],"source_content_type":"text/x-python","patch_set":24,"id":"da85f559_45150fe3","line":721,"updated":"2015-11-16 04:16:22.000000000","message":"I really don\u0027t love the idea of passing a username and password like this. Couldn\u0027t this just come from the environment variables that novaclient uses?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a76b5aa18ae60725614da65c2d9b3a15103b5e71","unresolved":false,"context_lines":[{"line_number":718,"context_line":"          default\u003dcliutils.env(\u0027OS_USERNAME\u0027, \u0027NOVA_USERNAME\u0027))"},{"line_number":719,"context_line":"    @args(\u0027--password\u0027, metavar\u003d\u0027\u003cPassword\u003e\u0027, dest\u003d\u0027password\u0027,"},{"line_number":720,"context_line":"          help\u003d\u0027User password\u0027,"},{"line_number":721,"context_line":"          default\u003dcliutils.env(\u0027OS_PASSWORD\u0027, \u0027NOVA_PASSWORD\u0027))"},{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_8859d990","line":721,"in_reply_to":"9a8ffd7b_bf14154d","updated":"2015-12-01 17:40:22.000000000","message":"Yeah.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"41598b7568afe555fdb855d75a64af7f03bfddef","unresolved":false,"context_lines":[{"line_number":718,"context_line":"          default\u003dcliutils.env(\u0027OS_USERNAME\u0027, \u0027NOVA_USERNAME\u0027))"},{"line_number":719,"context_line":"    @args(\u0027--password\u0027, metavar\u003d\u0027\u003cPassword\u003e\u0027, dest\u003d\u0027password\u0027,"},{"line_number":720,"context_line":"          help\u003d\u0027User password\u0027,"},{"line_number":721,"context_line":"          default\u003dcliutils.env(\u0027OS_PASSWORD\u0027, \u0027NOVA_PASSWORD\u0027))"},{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_bf14154d","line":721,"in_reply_to":"ba8a016a_65b0ac8c","updated":"2015-12-01 17:02:03.000000000","message":"But this isn\u0027t novaclient, it\u0027s nova-manage. Everything here should just run with context.get_admin_context(). If it doesn\u0027t, then it\u0027s not the right fit.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"ce5cc6f34341d38a05e1bf626a7c65a995f78590","unresolved":false,"context_lines":[{"line_number":718,"context_line":"          default\u003dcliutils.env(\u0027OS_USERNAME\u0027, \u0027NOVA_USERNAME\u0027))"},{"line_number":719,"context_line":"    @args(\u0027--password\u0027, metavar\u003d\u0027\u003cPassword\u003e\u0027, dest\u003d\u0027password\u0027,"},{"line_number":720,"context_line":"          help\u003d\u0027User password\u0027,"},{"line_number":721,"context_line":"          default\u003dcliutils.env(\u0027OS_PASSWORD\u0027, \u0027NOVA_PASSWORD\u0027))"},{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_65b0ac8c","line":721,"in_reply_to":"da85f559_45150fe3","updated":"2015-11-16 11:36:05.000000000","message":"I was following what the novaclient does, it allows to specify password and user on the CLI and it defaults to the env variables, are you suggesting to just use the values in the env variables here?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"422ba77ec68327213f8b08cdd2673ec796e822aa","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_3ec0752a","line":725,"updated":"2015-11-30 14:19:11.000000000","message":"I really think we should require the volume_id be passed in, and not do the dance with creating a cinder call here.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"41598b7568afe555fdb855d75a64af7f03bfddef","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_dfb9d9ed","line":725,"in_reply_to":"9a8ffd7b_20ffd435","updated":"2015-12-01 17:02:03.000000000","message":"Because I\u0027m really concerned what this opens up in hitting all the internal API surfaces which is a giant scope change here. \n\nnova-manage has historically been basically a way to sneak around and do db things because the API server can\u0027t be used or trusted. Everything else has been out of scope.\n\nIt really feels like we should add a force-detach to the real API instead.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"fbb56134cff64f783f1d8b12515b26536aa767e3","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_a7c0d57d","line":725,"in_reply_to":"9a8ffd7b_3ec0752a","updated":"2015-11-30 16:21:20.000000000","message":"it is a double check with cinder that you are specifying an existing volume, do you think it is not worth to get it?\n\nI am thinking at this use case:\nthe operator make a mistake running the command, for example he deletes the last char of the volume id, with this check he get an error back but without it he doesn\u0027t have any error back.\nI know that the error is logged in the nova-compute log files but I think it is handy to have it here.\nWhat do you think?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":12732,"name":"Bin Zhou","email":"zhou.bin9@zte.com.cn","username":"BinZhou"},"change_message_id":"43bc5198b5dfacb116201cc6f6f0c3386f0e1a83","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"7af24918_f10ebc39","line":725,"in_reply_to":"9a8ffd7b_6e46fd22","updated":"2016-03-03 07:35:12.000000000","message":"Done","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"51297a1c4e2d6b93eaeca42d1ef0589ed6f605cf","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_20ffd435","line":725,"in_reply_to":"9a8ffd7b_a7c0d57d","updated":"2015-12-01 03:47:53.000000000","message":"Agree with Andrea, it\u0027s a verification for we are detaching a real volume, so I think this should be kept.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b05d011e0b60375983200e9161dd808a98d02d21","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_6e46fd22","line":725,"in_reply_to":"9a8ffd7b_a7c0d57d","updated":"2015-12-01 18:01:53.000000000","message":"There is a volume_id in the attached block_device_mapping table, just filter on that and if you don\u0027t find it, puke.  The information is all in the nova database, so if that\u0027s our goal (to cleanup the BDMs associated to the instance for a given volume), we can figure that out w/o hitting the volume API.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a76b5aa18ae60725614da65c2d9b3a15103b5e71","unresolved":false,"context_lines":[{"line_number":722,"context_line":"    @args(\u0027--auth_url\u0027, metavar\u003d\u0027\u003cAuth Url\u003e\u0027, dest\u003d\u0027auth_url\u0027,"},{"line_number":723,"context_line":"          help\u003d\u0027Authorization Url\u0027,"},{"line_number":724,"context_line":"          default\u003dcliutils.env(\u0027OS_AUTH_URL\u0027))"},{"line_number":725,"context_line":"    def force_detach(self, instance, volume, tenant_name,"},{"line_number":726,"context_line":"                     username, password, auth_url):"},{"line_number":727,"context_line":"        \"\"\"Clean volume attachments in nova DB calling directly the"},{"line_number":728,"context_line":"        nova compute manager."}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_a8b85d76","line":725,"in_reply_to":"9a8ffd7b_dfb9d9ed","updated":"2015-12-01 17:40:22.000000000","message":"I think the force-detach in the real API has been problematic for consensus as well. That said, I really don\u0027t feel like we should be hitting other services\u0027 APIs from nova-manage. The whole point of nova-manage is to provide a structured way for people to hack the database, or pre-load it before the APIs can be up. If it was (properly) called nova-hack-database, it would be really weird to be calling out to cinder from it.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"39e496ad3676049ab4251b9c6503ce9f24420d58","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        try:"},{"line_number":741,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":743,"context_line":"            print(six.text_type(e))"},{"line_number":744,"context_line":"            return 2"},{"line_number":745,"context_line":"        try:"},{"line_number":746,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_57babe24","line":743,"updated":"2015-11-17 11:31:52.000000000","message":"not sure if we should really do that with this exception, feels like we should just print out our own string?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"da9b9a2f1c8f25f226b73c8be236e78b385ae392","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        try:"},{"line_number":741,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":743,"context_line":"            print(six.text_type(e))"},{"line_number":744,"context_line":"            return 2"},{"line_number":745,"context_line":"        try:"},{"line_number":746,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_f43abe97","line":743,"in_reply_to":"ba8a016a_57babe24","updated":"2015-11-17 16:46:16.000000000","message":"I can change it, I see the nova-manage as a low-level tool for admin/operators so having the exception details I thought could be handy.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5eb125d5cd33e7e0fb91dcbfe5def257afc9cd60","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        try:"},{"line_number":741,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":743,"context_line":"            print(six.text_type(e))"},{"line_number":744,"context_line":"            return 2"},{"line_number":745,"context_line":"        try:"},{"line_number":746,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_6fc80d23","line":743,"in_reply_to":"ba8a016a_ba9f2ab3","updated":"2015-11-24 09:53:46.000000000","message":"I was more worried about the partial translations, but it simple, so OK.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"223db521437c44a557c452ec30404c9abb5f01e8","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        try:"},{"line_number":741,"context_line":"            vol \u003d volume_API.get(ctxt, volume)"},{"line_number":742,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":743,"context_line":"            print(six.text_type(e))"},{"line_number":744,"context_line":"            return 2"},{"line_number":745,"context_line":"        try:"},{"line_number":746,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_ba9f2ab3","line":743,"in_reply_to":"ba8a016a_f43abe97","updated":"2015-11-17 23:51:22.000000000","message":"There is precedence in nova-manage for doing this, actually... I agree with Andrea that it\u0027s OK to do this for nova-manage since the audience is a cloud administrator.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"41598b7568afe555fdb855d75a64af7f03bfddef","unresolved":false,"context_lines":[{"line_number":742,"context_line":"        except exception.VolumeNotFound as e:"},{"line_number":743,"context_line":"            print(six.text_type(e))"},{"line_number":744,"context_line":"            return 2"},{"line_number":745,"context_line":"        try:"},{"line_number":746,"context_line":"            instance \u003d compute_API.get(ctxt, instance, want_objects\u003dTrue)"},{"line_number":747,"context_line":"        except exception.InstanceNotFound as e:"},{"line_number":748,"context_line":"            print(six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_5f208949","line":745,"updated":"2015-12-01 17:02:03.000000000","message":"it\u0027s really weird to turn a var from a uuid to an object but with the same name.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"39e496ad3676049ab4251b9c6503ce9f24420d58","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_976ee62d","line":751,"updated":"2015-11-17 11:31:52.000000000","message":"I am seeing lots of things skipped:\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L3089\nNow that probably makes total sense, but I need to go dig into all of those.\n\nCan\u0027t we just add a new method in compute_API to handle all these differences, and so this just becomes a call to the compute_API?\n\nI feel this code is too far away from other similar code, and thats going to make it hard to maintain.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a76b5aa18ae60725614da65c2d9b3a15103b5e71","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_6807d51d","line":751,"in_reply_to":"9a8ffd7b_022bcf34","updated":"2015-12-01 17:40:22.000000000","message":"I\u0027m similarly concerned about this rpc bit and I don\u0027t think it should be in npva-manage. We have one piece of prior art here and that\u0027s cells. We\u0027ve previously discussed hating that with a passion, but allowing it to continue for the reason that cells is a special snowflake and makes lots of other things hard as well. When we\u0027re fully on cellsv2, I\u0027d think we\u0027d NFO this rpc bit in nova-manage. I don\u0027t think adding another example here is good.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"807e5cbc7bcd255a0381535adcc76039f8461d3f","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_b714fe9f","line":751,"in_reply_to":"9a8ffd7b_3548985b","updated":"2015-11-26 14:32:18.000000000","message":"I am really thinking adding something like:\n\ndef force_detach_volume(...)\n\nThat just does what is needed, and gets called from nova-manage here.\n\nJust seems like we break the facade by adding this skip logic here.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"0804a227ecfe3038cdd7b5d18f5ef9aed9cb620c","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"7a740942_3701c505","line":751,"in_reply_to":"9a8ffd7b_6807d51d","updated":"2015-12-08 09:05:43.000000000","message":"@Dan, so if we call the force_detach_volume in Nova API layer instead of rpc calling, that will avoid the problem you said, right?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"fbb56134cff64f783f1d8b12515b26536aa767e3","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_022bcf34","line":751,"in_reply_to":"9a8ffd7b_b714fe9f","updated":"2015-11-30 16:21:20.000000000","message":"ok I am going to follow your suggestion.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"da9b9a2f1c8f25f226b73c8be236e78b385ae392","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_d48f7a21","line":751,"in_reply_to":"ba8a016a_976ee62d","updated":"2015-11-17 16:46:16.000000000","message":"You are right, the purpose of this \"force\" detach is to skip a lot of checks that are performed in the regular code path.\nThe original proposal for this change was to get pass a new parameter to the existing API to perform the force detach:\n\n*DELETE /v2.1/{project_id}/servers/{server_id}/os-volume_attachments/{v_id}?force\u003dtrue\n\nthen after a long discussion we agreed that it was ok just to have a new nova-manage command to clean up the nova DB side.","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5eb125d5cd33e7e0fb91dcbfe5def257afc9cd60","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba8a016a_ef8abdbe","line":751,"in_reply_to":"ba8a016a_d48f7a21","updated":"2015-11-24 09:53:46.000000000","message":"Sorry, I wasn\u0027t clear, agreed with this living in nova-manage.\n\nBut my preference would be for all these skips to be in a new method in:\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L3089","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"e4d28229258a3fe3c7264f000958e661976ab6d8","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            print(six.text_type(e))"},{"line_number":749,"context_line":"            return 2"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        compute_RPC.detach_volume(ctxt, instance\u003dinstance,"},{"line_number":752,"context_line":"                                  volume_id\u003dvol[\u0027id\u0027])"},{"line_number":753,"context_line":"        # we sent the request, the actual detach is an async operation"},{"line_number":754,"context_line":"        print(_(\u0027The request for detaching the volume %(volume)s\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"9a8ffd7b_3548985b","line":751,"in_reply_to":"ba8a016a_ef8abdbe","updated":"2015-11-24 11:35:03.000000000","message":"Your proposal is to let nova-manage call directly the compute.api._detach_volume where we add some extra logic to manage a flag for controlling the additional tests, something like:\n\ndef _detach_volume(self, context, instance, volume, force\u003dFalse):\n        \"\"\"Detach volume from instance.\n        This method is separated to make it easier for cells version\n        to override.\n        \"\"\"\n        if not force:\n            self.volume_api.check_detach(context, volume)\n            self.volume_api.begin_detaching(context, volume[\u0027id\u0027])\n        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,\n                volume_id\u003dvolume[\u0027id\u0027])\n\nThe reasons because I do not like too much that solution are:\n- I do not like to add that flag just because it is required by an external tool, in this case nova-manage. In the nova code nothing will use that flag. I know we can document it with a comment....(I am not a great fan of comments)\n- It seems that the RPC is the right choice to call a specific function exposed by the compute API.\n- I do not like the idea to call a \"private\" method \n\nSaid that probably I am missing your concern about calling directly the RPC layer, can you elaborate it a bit more, please?","commit_id":"acf203578084ef3c253cad4be6be6fc673547903"}],"nova/compute/api.py":[{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2db122230654494bcf5413228c4c0ea82d42f905","unresolved":false,"context_lines":[{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        if not force:"},{"line_number":3161,"context_line":"            self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3163,"context_line":"                                          volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_99bba572","line":3160,"updated":"2015-08-18 10:15:39.000000000","message":"if we decide to call directly the compute_rpcapi from nova-manage we don\u0027t need to touch this file","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"48dff578b4f4212c980b2be3e76f6d7ef1391532","unresolved":false,"context_lines":[{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        if not force:"},{"line_number":3161,"context_line":"            self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3163,"context_line":"                                          volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_629fe3b4","line":3160,"in_reply_to":"fa1b9901_25758097","updated":"2015-08-18 16:41:34.000000000","message":"+1 to that.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        if not force:"},{"line_number":3161,"context_line":"            self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3163,"context_line":"                                          volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_2f43f243","line":3160,"in_reply_to":"fa1b9901_629fe3b4","updated":"2015-08-19 09:24:26.000000000","message":"Sure","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"661f2f5294b0975c872d5b4fbb729baabce28589","unresolved":false,"context_lines":[{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        if not force:"},{"line_number":3161,"context_line":"            self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"},{"line_number":3163,"context_line":"                                          volume_id\u003dvolume[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_25758097","line":3160,"in_reply_to":"fa1b9901_99bba572","updated":"2015-08-18 13:30:48.000000000","message":"Yes, that seems like the right approach.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"00d2324c465eec5c7f26b670dbf21e59651077c2","unresolved":false,"context_lines":[{"line_number":3167,"context_line":"            msg \u003d _(\"Volume must be attached in order to detach.\")"},{"line_number":3168,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3169,"context_line":""},{"line_number":3170,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3171,"context_line":""},{"line_number":3172,"context_line":"    @wrap_check_policy"},{"line_number":3173,"context_line":"    @check_instance_lock"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_5ebbccc4","line":3170,"updated":"2015-08-17 21:07:27.000000000","message":"Unfortunately, the call to volume_api.check_detach is very racy, and moving it further from _detach_volume where it is followed immediately by volume_api.begin_detaching just widens the race window. So please, don\u0027t make these changes for this patch, just implement something to cleanup Nova DB and call Cinder to detach. Just the minimum.\nWe\u0027ve WIP to provide Cinder and Nova specs for Mitaka to remove this race and other API cleanup. Let\u0027s do a more complete fix for this race then.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":3167,"context_line":"            msg \u003d _(\"Volume must be attached in order to detach.\")"},{"line_number":3168,"context_line":"            raise exception.InvalidVolume(reason\u003dmsg)"},{"line_number":3169,"context_line":""},{"line_number":3170,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3171,"context_line":""},{"line_number":3172,"context_line":"    @wrap_check_policy"},{"line_number":3173,"context_line":"    @check_instance_lock"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_2fdf726a","line":3170,"in_reply_to":"fa1b9901_5ebbccc4","updated":"2015-08-19 09:24:26.000000000","message":"Ok","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"47f44718605a827525bb4d52b3a494071427cea0","unresolved":false,"context_lines":[{"line_number":3176,"context_line":"                                    vm_states.SOFT_DELETED])"},{"line_number":3177,"context_line":"    def detach_volume(self, context, instance, volume):"},{"line_number":3178,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":3179,"context_line":"        self._check_detach_prereq(context, instance, volume)"},{"line_number":3180,"context_line":"        # The caller likely got the instance from volume[\u0027instance_uuid\u0027]"},{"line_number":3181,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3182,"context_line":"        if volume[\u0027instance_uuid\u0027] !\u003d instance.uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a4dcd0f_abf09092","line":3179,"updated":"2015-08-14 10:32:04.000000000","message":"I don\u0027t see why we need to change the detach_volume at all. The new nova-manage command will only call _detach_volume so we only need to change that to skip the status verification if force\u003dTrue.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"00d2324c465eec5c7f26b670dbf21e59651077c2","unresolved":false,"context_lines":[{"line_number":3176,"context_line":"                                    vm_states.SOFT_DELETED])"},{"line_number":3177,"context_line":"    def detach_volume(self, context, instance, volume):"},{"line_number":3178,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":3179,"context_line":"        self._check_detach_prereq(context, instance, volume)"},{"line_number":3180,"context_line":"        # The caller likely got the instance from volume[\u0027instance_uuid\u0027]"},{"line_number":3181,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3182,"context_line":"        if volume[\u0027instance_uuid\u0027] !\u003d instance.uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_5e318ca1","line":3179,"in_reply_to":"1a4dcd0f_abf09092","updated":"2015-08-17 21:07:27.000000000","message":"I agree with Balazs. Just call _detach_volume(..) with the new force\u003dtrue to bypass the checks.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":3176,"context_line":"                                    vm_states.SOFT_DELETED])"},{"line_number":3177,"context_line":"    def detach_volume(self, context, instance, volume):"},{"line_number":3178,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":3179,"context_line":"        self._check_detach_prereq(context, instance, volume)"},{"line_number":3180,"context_line":"        # The caller likely got the instance from volume[\u0027instance_uuid\u0027]"},{"line_number":3181,"context_line":"        # in the first place, but let\u0027s sanity check."},{"line_number":3182,"context_line":"        if volume[\u0027instance_uuid\u0027] !\u003d instance.uuid:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_cf3036a1","line":3179,"in_reply_to":"fa1b9901_5e318ca1","updated":"2015-08-19 09:24:26.000000000","message":"Well, we decide to call compute_rpcapi, so we don\u0027t need to change this file.","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a2953fd7b9238a57fb4ae089e1e46e99d49a7168","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"        to override."},{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3161,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_d32bf992","line":3159,"updated":"2015-08-19 12:57:48.000000000","message":"I guess this comment is not valid any more","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"        to override."},{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3161,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_357f9916","line":3159,"in_reply_to":"fa1b9901_5e6045a5","updated":"2015-08-20 00:58:56.000000000","message":"Thanks, forget to remove it.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2010506d231f0e45054a1080f410edfa0561a3a6","unresolved":false,"context_lines":[{"line_number":3156,"context_line":"        to override."},{"line_number":3157,"context_line":"        \"\"\""},{"line_number":3158,"context_line":"        # We will pass force\u003dTrue in nova-manage db volume-force-detach,"},{"line_number":3159,"context_line":"        # and skip the status restriction in begin_detaching."},{"line_number":3160,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":3161,"context_line":"        self.volume_api.begin_detaching(context, volume[\u0027id\u0027])"},{"line_number":3162,"context_line":"        self.compute_rpcapi.detach_volume(context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5e6045a5","line":3159,"in_reply_to":"fa1b9901_d32bf992","updated":"2015-08-19 16:15:54.000000000","message":"+1","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"}],"nova/compute/cells_api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"48dff578b4f4212c980b2be3e76f6d7ef1391532","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":434,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":435,"context_line":"        self._cast_to_cells(context, instance, \u0027detach_volume\u0027,"},{"line_number":436,"context_line":"                volume)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    @wrap_check_policy"},{"line_number":439,"context_line":"    @check_instance_cell"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_e292139f","side":"PARENT","line":436,"updated":"2015-08-18 16:41:34.000000000","message":"This seems like a no op change? can we just drop this one?","commit_id":"5ad2f8e82c632520560fc526b361fe5b3e990412"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":434,"context_line":"        self.volume_api.check_detach(context, volume)"},{"line_number":435,"context_line":"        self._cast_to_cells(context, instance, \u0027detach_volume\u0027,"},{"line_number":436,"context_line":"                volume)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    @wrap_check_policy"},{"line_number":439,"context_line":"    @check_instance_cell"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_2fe9b2e6","side":"PARENT","line":436,"in_reply_to":"fa1b9901_e292139f","updated":"2015-08-19 09:24:26.000000000","message":"Done","commit_id":"5ad2f8e82c632520560fc526b361fe5b3e990412"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"48dff578b4f4212c980b2be3e76f6d7ef1391532","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    def detach_volume(self, ctxt, instance, volume_id):"},{"line_number":420,"context_line":"        version \u003d \u00274.0\u0027"},{"line_number":421,"context_line":"        cctxt \u003d self.client.prepare(server\u003d_compute_host(None, instance),"},{"line_number":422,"context_line":"                                    version\u003dversion)"},{"line_number":423,"context_line":"        cctxt.cast(ctxt, \u0027detach_volume\u0027,"},{"line_number":424,"context_line":"                   instance\u003dinstance, volume_id\u003dvolume_id)"},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_e2c69348","line":422,"updated":"2015-08-18 16:41:34.000000000","message":"can we drop this change, since it doesn\u0027t seem required?","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":419,"context_line":"    def detach_volume(self, ctxt, instance, volume_id):"},{"line_number":420,"context_line":"        version \u003d \u00274.0\u0027"},{"line_number":421,"context_line":"        cctxt \u003d self.client.prepare(server\u003d_compute_host(None, instance),"},{"line_number":422,"context_line":"                                    version\u003dversion)"},{"line_number":423,"context_line":"        cctxt.cast(ctxt, \u0027detach_volume\u0027,"},{"line_number":424,"context_line":"                   instance\u003dinstance, volume_id\u003dvolume_id)"},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_cfbef6d3","line":422,"in_reply_to":"fa1b9901_e2c69348","updated":"2015-08-19 09:24:26.000000000","message":"Done","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"}],"nova/tests/unit/cmd/test_manage.py":[{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"8645d37e5341227d10ebafa9498b9bbff3bea14b","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                             \u0027uuid1\u0027, want_objects\u003dTrue)"},{"line_number":73,"context_line":"        mock_vol_get.assert_called_once_with(mock.sentinel.ctxt, \u0027vol_uuid\u0027)"},{"line_number":74,"context_line":"        mock_rpc_detach.assert_called_once_with(mock.sentinel.ctxt,"},{"line_number":75,"context_line":"                                                instance\u003d\u0027uudi1\u0027,"},{"line_number":76,"context_line":"                                                volume_id\u003d\u0027vol_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_b6f04fca","line":75,"range":{"start_line":75,"start_character":58,"end_line":75,"end_character":63},"updated":"2015-08-21 04:20:41.000000000","message":"uuid1\n\nI don\u0027t know if that will fix the test failure  but it\u0027s still wrong.","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"a2202be9858753e2b96d151a9587dd0261bc8512","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                             \u0027uuid1\u0027, want_objects\u003dTrue)"},{"line_number":73,"context_line":"        mock_vol_get.assert_called_once_with(mock.sentinel.ctxt, \u0027vol_uuid\u0027)"},{"line_number":74,"context_line":"        mock_rpc_detach.assert_called_once_with(mock.sentinel.ctxt,"},{"line_number":75,"context_line":"                                                instance\u003d\u0027uudi1\u0027,"},{"line_number":76,"context_line":"                                                volume_id\u003d\u0027vol_uuid\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"fa1b9901_ce1e870b","line":75,"in_reply_to":"fa1b9901_b6f04fca","updated":"2015-08-21 06:11:44.000000000","message":"Done","commit_id":"e83d6a8ba7642f54c792586b0202346ade326932"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"48dff578b4f4212c980b2be3e76f6d7ef1391532","unresolved":false,"context_lines":[{"line_number":9535,"context_line":"        self.stubs.Set(compute_rpcapi.ComputeAPI, \u0027detach_volume\u0027,"},{"line_number":9536,"context_line":"                       fake_rpc_detach_volume)"},{"line_number":9537,"context_line":""},{"line_number":9538,"context_line":"        self.compute_api.detach_volume(self.context, instance, volume)"},{"line_number":9539,"context_line":"        self.assertTrue(called.get(\u0027fake_check_detach\u0027))"},{"line_number":9540,"context_line":"        self.assertTrue(called.get(\u0027fake_begin_detaching\u0027))"},{"line_number":9541,"context_line":"        self.assertTrue(called.get(\u0027fake_rpc_detach_volume\u0027))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_22eb2bb2","line":9538,"updated":"2015-08-18 16:41:34.000000000","message":"same here, this doesn\u0027t seem to be needed, could we drop this change please?","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c9feea075566450723bf72380ac9bc9f1694687b","unresolved":false,"context_lines":[{"line_number":9535,"context_line":"        self.stubs.Set(compute_rpcapi.ComputeAPI, \u0027detach_volume\u0027,"},{"line_number":9536,"context_line":"                       fake_rpc_detach_volume)"},{"line_number":9537,"context_line":""},{"line_number":9538,"context_line":"        self.compute_api.detach_volume(self.context, instance, volume)"},{"line_number":9539,"context_line":"        self.assertTrue(called.get(\u0027fake_check_detach\u0027))"},{"line_number":9540,"context_line":"        self.assertTrue(called.get(\u0027fake_begin_detaching\u0027))"},{"line_number":9541,"context_line":"        self.assertTrue(called.get(\u0027fake_rpc_detach_volume\u0027))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_8fb8fee6","line":9538,"in_reply_to":"fa1b9901_22eb2bb2","updated":"2015-08-19 09:24:26.000000000","message":"Done","commit_id":"72565c7645a81c9c76f547ce4ed797a7265a5271"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":9562,"context_line":"                    \u0027launched_at\u0027: timeutils.utcnow(),"},{"line_number":9563,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9564,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9565,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":9566,"context_line":"                  \u0027instance_uuid\u0027: \u0027uuid2\u0027, \u0027status\u0027: \u0027in-use\u0027}"},{"line_number":9567,"context_line":""},{"line_number":9568,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_1b989177","line":9565,"updated":"2015-08-19 20:29:21.000000000","message":"I think you are trying to fix this test, but if you are testing that an attempt to detach a volume that is unattached (as the test name states), you should have \u0027attach_status\u0027: \u0027detached\u0027\n\nAnd perhaps this fix should not be in this patch, but should be submitted separately.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":9562,"context_line":"                    \u0027launched_at\u0027: timeutils.utcnow(),"},{"line_number":9563,"context_line":"                    \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":9564,"context_line":"                    \u0027task_state\u0027: None})"},{"line_number":9565,"context_line":"        volume \u003d {\u0027id\u0027: 1, \u0027attach_status\u0027: \u0027attached\u0027,"},{"line_number":9566,"context_line":"                  \u0027instance_uuid\u0027: \u0027uuid2\u0027, \u0027status\u0027: \u0027in-use\u0027}"},{"line_number":9567,"context_line":""},{"line_number":9568,"context_line":"        self.assertRaises(exception.VolumeUnattached,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_55d1edf8","line":9565,"in_reply_to":"fa1b9901_1b989177","updated":"2015-08-20 00:58:56.000000000","message":"OK, other patch should be more proper.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"2010506d231f0e45054a1080f410edfa0561a3a6","unresolved":false,"context_lines":[{"line_number":9569,"context_line":"                          self.compute_api.detach_volume, self.context,"},{"line_number":9570,"context_line":"                          fake_instance, volume)"},{"line_number":9571,"context_line":""},{"line_number":9572,"context_line":"    def test_detach_available_volume_not_allowed(self):"},{"line_number":9573,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":9574,"context_line":"        volume \u003d {\u0027id\u0027: 1,"},{"line_number":9575,"context_line":"                  \u0027attach_status\u0027: \u0027in-use\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_9e181d20","line":9572,"updated":"2015-08-19 16:15:54.000000000","message":"this test is not required anymore","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"19ae05a2b2dba46c028f436c09ed4d4f01d61e00","unresolved":false,"context_lines":[{"line_number":9569,"context_line":"                          self.compute_api.detach_volume, self.context,"},{"line_number":9570,"context_line":"                          fake_instance, volume)"},{"line_number":9571,"context_line":""},{"line_number":9572,"context_line":"    def test_detach_available_volume_not_allowed(self):"},{"line_number":9573,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":9574,"context_line":"        volume \u003d {\u0027id\u0027: 1,"},{"line_number":9575,"context_line":"                  \u0027attach_status\u0027: \u0027in-use\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_15d7f5ed","line":9572,"in_reply_to":"fa1b9901_7b850d05","updated":"2015-08-20 00:58:56.000000000","message":"Sure","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"7cad78e27c3f2644c723c334d4b89a3627432362","unresolved":false,"context_lines":[{"line_number":9569,"context_line":"                          self.compute_api.detach_volume, self.context,"},{"line_number":9570,"context_line":"                          fake_instance, volume)"},{"line_number":9571,"context_line":""},{"line_number":9572,"context_line":"    def test_detach_available_volume_not_allowed(self):"},{"line_number":9573,"context_line":"        instance \u003d self._create_fake_instance_obj()"},{"line_number":9574,"context_line":"        volume \u003d {\u0027id\u0027: 1,"},{"line_number":9575,"context_line":"                  \u0027attach_status\u0027: \u0027in-use\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_7b850d05","line":9572,"in_reply_to":"fa1b9901_9e181d20","updated":"2015-08-19 20:29:21.000000000","message":"Yes, I think this test is out-of-scope for this particular patch.","commit_id":"1033ebf2728b39ec74e79d36c7bd1c9ceb90f144"}]}
