)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hpe.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-02-22 17:59:16 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement setup_networks_on_host for Neutron to support Migration"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In order to address the L3 network issues related to the"},{"line_number":10,"context_line":"live-migration in neutron, \u0027setup_networks_on_host\u0027 should"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_8117d143","line":7,"range":{"start_line":7,"start_character":45,"end_line":7,"end_character":65},"updated":"2016-02-24 13:09:30.000000000","message":"nit: please delete as it\u0027s confusing, Neutron already supports live migration","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Swaminathan Vasudevan \u003cswaminathan.vasudevan@hpe.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-02-22 17:59:16 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement setup_networks_on_host for Neutron to support Migration"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In order to address the L3 network issues related to the"},{"line_number":10,"context_line":"live-migration in neutron, \u0027setup_networks_on_host\u0027 should"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_f0ff7a63","line":7,"range":{"start_line":7,"start_character":45,"end_line":7,"end_character":65},"in_reply_to":"bae84128_8117d143","updated":"2016-02-24 15:42:14.000000000","message":"Done","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migration_status\u0027 and \u0027destination\u0027"},{"line_number":15,"context_line":"during the pre-migration phase as shown below."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migration-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_04a74f0b","line":18,"range":{"start_line":17,"start_character":25,"end_line":18,"end_character":58},"updated":"2016-02-24 13:09:30.000000000","message":"are there any other statuses (planned)? Can be just one field: \u0027migrating_to\u0027: \u003cdest host\u003e","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migration_status\u0027 and \u0027destination\u0027"},{"line_number":15,"context_line":"during the pre-migration phase as shown below."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migration-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_c5bc3ade","line":18,"range":{"start_line":17,"start_character":25,"end_line":18,"end_character":58},"in_reply_to":"bae84128_04a74f0b","updated":"2016-02-24 15:42:14.000000000","message":"this was based on your original suggestion to have a status and destination.\nAnd I like this option, since it will be usefull to handle other migration states which may evolve.","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"e8975c7bec8253eeb7c6c09c65c86d44631e5361","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migration_status\u0027 and \u0027destination\u0027"},{"line_number":15,"context_line":"during the pre-migration phase as shown below."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migration-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_e63033eb","line":18,"range":{"start_line":17,"start_character":25,"end_line":18,"end_character":58},"in_reply_to":"bae84128_c5bc3ade","updated":"2016-02-25 09:45:31.000000000","message":"I\u0027d avoid additional complexity without a clear vision why it is needed. We can add fields to this dict anytime when needed.","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migration-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_44c83755","line":20,"range":{"start_line":20,"start_character":7,"end_line":20,"end_character":32},"updated":"2016-02-24 13:09:30.000000000","message":"migrate_instance_finish()","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migration-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"bae84128_d006b684","line":20,"range":{"start_line":20,"start_character":7,"end_line":20,"end_character":32},"in_reply_to":"bae84128_44c83755","updated":"2016-02-24 15:42:14.000000000","message":"Done","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d8f49931c2b74748f7657258180b1e43ae9b2c5e","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migration_status\u0027 and \u0027destination\u0027"},{"line_number":15,"context_line":"during the pre-migration phase as shown below."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migrate-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"bae84128_c6408f38","line":18,"range":{"start_line":17,"start_character":0,"end_line":18,"end_character":60},"updated":"2016-02-25 09:47:03.000000000","message":"please see comment on PS 15","commit_id":"88b03493f21b51c501c78121e9b3b1fe9fa29e8b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d8f49931c2b74748f7657258180b1e43ae9b2c5e","unresolved":false,"context_lines":[{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migration_status\u0027: \u0027migration\u0027,"},{"line_number":18,"context_line":"                         \u0027destination\u0027: \u0027destination-host\u0027}}"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"In the migrate-instance-finish, it should clear the migration"},{"line_number":21,"context_line":"profile before binding the host to the destination port."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"bae84128_26785b8f","line":20,"range":{"start_line":20,"start_character":7,"end_line":20,"end_character":30},"updated":"2016-02-25 09:47:03.000000000","message":"migrate_instance_finish()","commit_id":"88b03493f21b51c501c78121e9b3b1fe9fa29e8b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migrating_to\u0027 key pointing to the"},{"line_number":15,"context_line":"destination host."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"In the migrate_instance_finish(), it should clear the migration"},{"line_number":20,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9aed3d3a_12812d4b","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":49},"updated":"2016-02-25 20:48:21.000000000","message":"Where are any of the values here set/read in Neutron?  Would be good to have some more background information here on the interaction with Neutron and how it expects things to work with Nova.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"profile dictionary with the \u0027migrating_to\u0027 key pointing to the"},{"line_number":15,"context_line":"destination host."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"In the migrate_instance_finish(), it should clear the migration"},{"line_number":20,"context_line":"profile before binding the host to the destination port."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9aed3d3a_9420884b","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":49},"in_reply_to":"9aed3d3a_12812d4b","updated":"2016-02-25 21:51:13.000000000","message":"will add more context in here.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any L3 networks ahead of time"},{"line_number":28,"context_line":"on the destination host before the port lands in the destination"},{"line_number":29,"context_line":"host."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The neutron side changes are handled in different patch sets shown"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9aed3d3a_158dd7d5","line":28,"range":{"start_line":28,"start_character":24,"end_line":28,"end_character":30},"updated":"2016-03-01 08:17:28.000000000","message":"Current patch does not ensure that, please mention that further work is planned to make nova wait for neutron event about router namespaces ready on dest host.","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any L3 networks ahead of time"},{"line_number":28,"context_line":"on the destination host before the port lands in the destination"},{"line_number":29,"context_line":"host."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The neutron side changes are handled in different patch sets shown"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"7af24918_451760a3","line":28,"range":{"start_line":28,"start_character":24,"end_line":28,"end_character":30},"in_reply_to":"9aed3d3a_158dd7d5","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":38,"context_line":"Related-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9aed3d3a_b5850bd0","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":7},"updated":"2016-03-01 08:17:28.000000000","message":"nit: I\u0027d say Partial","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":35,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":38,"context_line":"Related-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"7af24918_a50c6495","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":7},"in_reply_to":"9aed3d3a_b5850bd0","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b1a74549f259149bfcb34ff89af0d215ad88b1c6","unresolved":false,"context_lines":[{"line_number":41,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":44,"context_line":"Partial-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"3afc51ec_957401d0","line":44,"updated":"2016-03-11 18:29:49.000000000","message":"Is it worth add a release note about this fix?","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8ae9d96c0303673ec3b7a460eec1beb9ab5a06e5","unresolved":false,"context_lines":[{"line_number":41,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":44,"context_line":"Partial-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"3afc51ec_1ff9e04d","line":44,"in_reply_to":"3afc51ec_957401d0","updated":"2016-03-14 17:10:15.000000000","message":"will add in a release not here as well.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"19cdd1984cf2dbf8547c7eac9c208de20d10c47d","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"[1] https://review.openstack.org/#/c/275420/"},{"line_number":41,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":44,"context_line":"Partial-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"1af94dfe_1ef669d7","line":42,"updated":"2016-03-15 11:41:40.000000000","message":"Its tempting to have a note it here saying that older versions of neutron will just ignore the extra port binding information.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"cceebacfc670572f5c692913645ebde3ef431e77","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"[1] https://review.openstack.org/#/c/275420/"},{"line_number":41,"context_line":"[2] https://review.openstack.org/#/c/260738/"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"Change-Id: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68"},{"line_number":44,"context_line":"Partial-Bug: #1456073"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":24,"id":"1af94dfe_cd2f2ba0","line":42,"in_reply_to":"1af94dfe_1ef669d7","updated":"2016-03-15 15:45:29.000000000","message":"Yes will add it in.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"2f1d17bb6ddf7c56fa75870b157087f57da34c3a","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_533291f2","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"updated":"2016-08-26 15:22:29.000000000","message":"From looking at the code this is not the case. In post_live_migration_at_destination first migrate_instance_finsh is called (do portbinding) and at the very end of the method setup_networks_on_host is called with teardown option.\n\nWhat\u0027s the reason for removing profile before binding? Or is this description just outdated? If we do portbinding first, we have the migration information available in mechanism drivers, which would allow us to trigger certain things on a migration binding, like I plan with [1]\n\n[1] https://review.openstack.org/361301","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"},{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"8342f22965da470db75f9fa34f73b6efde389114","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_7ecb9fa5","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"in_reply_to":"fa7ab95a_07cc3f88","updated":"2016-08-29 07:18:31.000000000","message":"\"[...] we would clean it up and then do the actual port_binding update.\"\n\nFrom looking at the code is seems to be vice versa. First the portbinding to the remote host is done [1], and after that the port profile is being removed by nova [2].\n\nI\u0027m not saying that this is bad or a problem. I\u0027m just saying this is in contradiction to the commit message.\n\nOr am I missing an important point here?\n\n\nSomething else (not related to -1):\n\n\"[...] and if we still have the \u0027migration profile\u0027 in the port\"\n\nDoes your statement imply that somebody else than nova removes the port profile again?\n\n[1] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L5523\n\n[2] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L5563","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"911cbeeb6ad0827cf4730c1d5de9fe7d87573eca","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_07cc3f88","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"in_reply_to":"fa7ab95a_533291f2","updated":"2016-08-26 16:15:47.000000000","message":"Just to give you a background.\nFor DVR routers, we are proactively creating the L3 plumbing for the port that is yet to be migrated to the destination.\nSo in the pre-live migration phase when nova controller decides to move the VM from original host to the destination host and before migration, we add the port migration profile to the port and do a port update.\n\nWith that info, neutron will be able to precreate the L3 plumbing for the VM that is to be migrated.\n\nSo when the actual migration happens, we would have completed the L3 plumbing work and if we still have the \u0027migration profile\u0027 in the port, we would clean it up and then do the actual port_binding update.\n\nAnd when the port lands in the destination node, the L3 plumbing is already available and it would speed up the process for the DVR routers.\n\nHope this helps.","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2d17468108227e7ae58d3f7dc2752fbd8b6cef1a","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_a75417ff","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"in_reply_to":"fa7ab95a_7ecb9fa5","updated":"2016-08-29 15:44:04.000000000","message":"I am still saying that what is mentioned in the commit message  matches with the code snippet.\n\nBefore doing the port-binding in the post-live-migration as you mentioned in reference [1] we are stripping down the port-profile which is not required anymore.\nThis migration port-profile is only required inbetween the pre-livemigration and post-live-migration we don\u0027t need it anymore.\n\nWe have tested this and also had a integration test in tempest that validates this flow. I am not sure why it is confusing still.","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"89797a26569a3c5d1f7c505ad5c93f4a9943874e","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_1d77d6d3","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"in_reply_to":"fa7ab95a_7ecb9fa5","updated":"2016-08-29 16:20:24.000000000","message":"None other than nova will remove the port profile.","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"81c10244f7b742ffb5d267238dfa6a57a33115d2","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"port:{\u0027binding:profile\u0027:{\u0027migrating_to\u0027: \u0027host\u0027}}"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"When migrate_instance_finish() is called, it should clear"},{"line_number":23,"context_line":"the migration profile before binding the host to the destination"},{"line_number":24,"context_line":"port."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Based on the port profile update with the destination host,"},{"line_number":27,"context_line":"the neutron will be able to create any associated L3 networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":39,"id":"fa7ab95a_1dd196fa","line":24,"range":{"start_line":22,"start_character":0,"end_line":24,"end_character":5},"in_reply_to":"fa7ab95a_a75417ff","updated":"2016-08-29 16:15:56.000000000","message":"Also you concern about the the setup_networks_on_hosts with a teardown option clears up the profile, this is only valid for the source host.\n\nWhat we are doing is the destination host.","commit_id":"5f403280fdb038212bbaf2946d939927f05f2d55"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7be4debe2b00d52ead11378b6e1f1e2761f26b92","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                LOG.exception(_LE(\"Unable to update host of port \""},{"line_number":198,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _teardown_migration_port_profile(self, context, instance, host):"},{"line_number":201,"context_line":"        ports \u003d self._get_instance_ports(context, instance)"},{"line_number":202,"context_line":"        for p in ports:"},{"line_number":203,"context_line":"            # If the port already has a migration profile and if"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_05c74546","line":200,"updated":"2016-02-02 22:59:06.000000000","message":"host unused here as well","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b682d2a420770e62842fd9a0e9c19f3b45a5342c","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":207,"context_line":"            if not port_profile:"},{"line_number":208,"context_line":"                continue"},{"line_number":209,"context_line":"            if port_profile:"},{"line_number":210,"context_line":"                migration_status \u003d port_profile.get(\u0027status\u0027)"},{"line_number":211,"context_line":"                if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":212,"context_line":"                    port_profile[\u0027status\u0027] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_ca1ffc07","line":209,"updated":"2016-02-02 22:54:25.000000000","message":"You don\u0027t need this and L207","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b682d2a420770e62842fd9a0e9c19f3b45a5342c","unresolved":false,"context_lines":[{"line_number":235,"context_line":"                if host and p.get(\u0027binding:host_id\u0027) !\u003d host:"},{"line_number":236,"context_line":"                    port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":237,"context_line":"                    if not port_profile:"},{"line_number":238,"context_line":"                        LOG.debug(\"No profile exists: %s\", port_profile)"},{"line_number":239,"context_line":"                        port_profile \u003d {\u0027status\u0027: \u0027migration\u0027,"},{"line_number":240,"context_line":"                                        \u0027destination\u0027: host}"},{"line_number":241,"context_line":"                        self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_4ab9cceb","line":238,"updated":"2016-02-02 22:54:25.000000000","message":"Maybe this should say \"No profile exists for port %s, creating\" and use p[\u0027id\u0027] as arg","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b682d2a420770e62842fd9a0e9c19f3b45a5342c","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                    if port_profile:"},{"line_number":245,"context_line":"                        migration_status \u003d port_profile.get(\u0027status\u0027)"},{"line_number":246,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":247,"context_line":"                            LOG.debug(\"All ready in migrating state: %s\","},{"line_number":248,"context_line":"                                      migration_status)"},{"line_number":249,"context_line":"                        else:"},{"line_number":250,"context_line":"                            LOG.debug(\"Port profile exists, but migration \""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_cacdbc87","line":247,"updated":"2016-02-02 22:54:25.000000000","message":"s/All ready/Already","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b682d2a420770e62842fd9a0e9c19f3b45a5342c","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                        migration_status \u003d port_profile.get(\u0027status\u0027)"},{"line_number":246,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":247,"context_line":"                            LOG.debug(\"All ready in migrating state: %s\","},{"line_number":248,"context_line":"                                      migration_status)"},{"line_number":249,"context_line":"                        else:"},{"line_number":250,"context_line":"                            LOG.debug(\"Port profile exists, but migration \""},{"line_number":251,"context_line":"                                      \"profile is missing: %s\", port_profile)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_eacd185e","line":248,"updated":"2016-02-02 22:54:25.000000000","message":"Use port id here ?","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b682d2a420770e62842fd9a0e9c19f3b45a5342c","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                            port_profile[\u0027status\u0027] \u003d \u0027migration\u0027"},{"line_number":253,"context_line":"                            port_profile[\u0027destination\u0027] \u003d host"},{"line_number":254,"context_line":"                            self._update_port_with_migration_profile("},{"line_number":255,"context_line":"                                context, instance, p[\u0027id\u0027], port_profile)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def _get_available_networks(self, context, project_id,"},{"line_number":258,"context_line":"                                net_ids\u003dNone, neutron\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_6a2fe8f6","line":255,"updated":"2016-02-02 22:54:25.000000000","message":"I think this code can be re-written to only have a single \"update\" call, let me give it a try.","commit_id":"90bd22c72ec8b0b2d854a38819b5214067ea8656"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"126fade644b37ec7797693af4a5dffe650897566","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                                      p[\u0027id\u0027])"},{"line_number":246,"context_line":"                            return"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"                    port_profile[\u0027status\u0027] \u003d \u0027migration\u0027"},{"line_number":249,"context_line":"                    port_profile[\u0027destination\u0027] \u003d host"},{"line_number":250,"context_line":"                    LOG.debug(\"Updating port %(port_id)s migration profile: \""},{"line_number":251,"context_line":"                              \"%(profile)s\","}],"source_content_type":"text/x-python","patch_set":4,"id":"5a5ae5dd_94eefb89","line":248,"updated":"2016-02-03 22:47:05.000000000","message":"We should probably just call this field \u0027migration_status\u0027 since that\u0027s what it\u0027s intended to be used for and so we don\u0027t confuse it with the main port status.","commit_id":"d77e7248095e62d06a73f2ea58d522f1c58ec047"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":207,"context_line":"            if not port_profile:"},{"line_number":208,"context_line":"                continue"},{"line_number":209,"context_line":"            migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":210,"context_line":"            if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":211,"context_line":"                del port_profile[\u0027migration_status\u0027]"},{"line_number":212,"context_line":"                del port_profile[\u0027destination\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_3aef95b1","line":209,"range":{"start_line":209,"start_character":49,"end_line":209,"end_character":65},"updated":"2016-02-22 09:57:15.000000000","message":"Are we sure that migration_status key is always found in port_profile dict? If not, then it would be better to use port_profile.get(\u0027migration_status\u0027, None) to avoid an exception.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":207,"context_line":"            if not port_profile:"},{"line_number":208,"context_line":"                continue"},{"line_number":209,"context_line":"            migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":210,"context_line":"            if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":211,"context_line":"                del port_profile[\u0027migration_status\u0027]"},{"line_number":212,"context_line":"                del port_profile[\u0027destination\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_4d61f038","line":209,"range":{"start_line":209,"start_character":49,"end_line":209,"end_character":65},"in_reply_to":"bae84128_3aef95b1","updated":"2016-02-22 17:25:56.000000000","message":"Done","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":15130,"name":"Sonu","email":"sonu.sudhakaran@gmail.com","username":"sonu"},"change_message_id":"22bfcc61dd613a534069a0c7979370393882eecd","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                self._update_port_with_migration_profile("},{"line_number":215,"context_line":"                    context, instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":218,"context_line":"                               teardown\u003dFalse):"},{"line_number":219,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":220,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_67b06f44","line":217,"range":{"start_line":217,"start_character":8,"end_line":217,"end_character":30},"updated":"2016-02-22 05:33:22.000000000","message":"Will it be anyway better if we could separate these two calls. For example, setup_networks_on_hosts and teardown_networks_on_hosts. \n\nChanging the functional behavior based on a parameter looks reasonable, but the function name don\u0027t qualify the behavior in case of tear-down.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                self._update_port_with_migration_profile("},{"line_number":215,"context_line":"                    context, instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":218,"context_line":"                               teardown\u003dFalse):"},{"line_number":219,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":220,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_0d9528dd","line":217,"range":{"start_line":217,"start_character":8,"end_line":217,"end_character":30},"in_reply_to":"bae84128_67b06f44","updated":"2016-02-22 17:25:56.000000000","message":"Sonu, this function is used by neutron and by nova networks, so I don\u0027t think it would be a good idea to rename this function at this point.\n\nThis is how it is used in nova networks and for now in order minimize the code changes, let us still on to this.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":237,"context_line":"                # as the given \u0027host\u0027."},{"line_number":238,"context_line":"                if (p.get(\u0027binding:host_id\u0027) and"},{"line_number":239,"context_line":"                    (p.get(\u0027binding:hostid\u0027) !\u003d host)):"},{"line_number":240,"context_line":"                    port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":241,"context_line":"                    if not port_profile:"},{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_fb47f674","line":239,"range":{"start_line":239,"start_character":36,"end_line":239,"end_character":42},"updated":"2016-02-22 09:57:15.000000000","message":"Should it be host_id instead of hostid?","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":237,"context_line":"                # as the given \u0027host\u0027."},{"line_number":238,"context_line":"                if (p.get(\u0027binding:host_id\u0027) and"},{"line_number":239,"context_line":"                    (p.get(\u0027binding:hostid\u0027) !\u003d host)):"},{"line_number":240,"context_line":"                    port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":241,"context_line":"                    if not port_profile:"},{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_adacfc35","line":239,"range":{"start_line":239,"start_character":36,"end_line":239,"end_character":42},"in_reply_to":"bae84128_fb47f674","updated":"2016-02-22 17:25:56.000000000","message":"Yes, thanks will fix it.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":15130,"name":"Sonu","email":"sonu.sudhakaran@gmail.com","username":"sonu"},"change_message_id":"22bfcc61dd613a534069a0c7979370393882eecd","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","},{"line_number":243,"context_line":"                                  p[\u0027id\u0027])"},{"line_number":244,"context_line":"                        port_profile \u003d {}"},{"line_number":245,"context_line":"                    else:"},{"line_number":246,"context_line":"                        migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":247,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":248,"context_line":"                            LOG.debug(\"Port already in migrating state: %s\","}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_47c0cb7c","line":245,"range":{"start_line":245,"start_character":20,"end_line":245,"end_character":24},"updated":"2016-02-22 05:33:22.000000000","message":"You dont need this else. If port_profile is None, create the port_profile. Rest of the code, continues using port_profile variable.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","},{"line_number":243,"context_line":"                                  p[\u0027id\u0027])"},{"line_number":244,"context_line":"                        port_profile \u003d {}"},{"line_number":245,"context_line":"                    else:"},{"line_number":246,"context_line":"                        migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":247,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":248,"context_line":"                            LOG.debug(\"Port already in migrating state: %s\","}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_ad219cb6","line":245,"range":{"start_line":245,"start_character":20,"end_line":245,"end_character":24},"in_reply_to":"bae84128_47c0cb7c","updated":"2016-02-22 17:25:56.000000000","message":"I am not sure if I understand your comment here. This is valid.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":255,"context_line":"                        context, instance, p[\u0027id\u0027],"},{"line_number":256,"context_line":"                        port_profile, neutron_client)"},{"line_number":257,"context_line":"                    if updated_port:"},{"line_number":258,"context_line":"                        LOG.debug(\"Port updated %(port_id)s with migration \""},{"line_number":259,"context_line":"                                  \"profile %(profile_data)s successfully\","},{"line_number":260,"context_line":"                                  {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":261,"context_line":"                                   \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_3a5f950f","line":258,"range":{"start_line":258,"start_character":35,"end_line":258,"end_character":59},"updated":"2016-02-22 09:57:15.000000000","message":"Should it be \"Port %(port_id)s updated...\"?","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":255,"context_line":"                        context, instance, p[\u0027id\u0027],"},{"line_number":256,"context_line":"                        port_profile, neutron_client)"},{"line_number":257,"context_line":"                    if updated_port:"},{"line_number":258,"context_line":"                        LOG.debug(\"Port updated %(port_id)s with migration \""},{"line_number":259,"context_line":"                                  \"profile %(profile_data)s successfully\","},{"line_number":260,"context_line":"                                  {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":261,"context_line":"                                   \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_ed2ba492","line":258,"range":{"start_line":258,"start_character":35,"end_line":258,"end_character":59},"in_reply_to":"bae84128_3a5f950f","updated":"2016-02-22 17:25:56.000000000","message":"Will fix it.","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"31be299bd4d452dc284235e81946c13ec8ffae70","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":207,"context_line":"            if not port_profile:"},{"line_number":208,"context_line":"                continue"},{"line_number":209,"context_line":"            migration_status \u003d port_profile.get(\u0027migration_status\u0027, None)"},{"line_number":210,"context_line":"            if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":211,"context_line":"                del port_profile[\u0027migration_status\u0027]"},{"line_number":212,"context_line":"                del port_profile[\u0027destination\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_cb1f9606","line":209,"range":{"start_line":209,"start_character":68,"end_line":209,"end_character":72},"updated":"2016-02-23 00:35:31.000000000","message":"This is the same thing as in PS12 but more verbose.  Don\u0027t just add gratuitous verbosity for kicks.  :)  Keep it like it is.  This is a common idiom and doesn\u0027t need the extra parameter.\n\n  \u003e\u003e\u003e {}.get(\u0027migration_status\u0027) is None\n  True","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"92b5efb774e2f7ba08e95982ed65de974c392ea6","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":207,"context_line":"            if not port_profile:"},{"line_number":208,"context_line":"                continue"},{"line_number":209,"context_line":"            migration_status \u003d port_profile.get(\u0027migration_status\u0027, None)"},{"line_number":210,"context_line":"            if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":211,"context_line":"                del port_profile[\u0027migration_status\u0027]"},{"line_number":212,"context_line":"                del port_profile[\u0027destination\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_e64d6f3f","line":209,"range":{"start_line":209,"start_character":68,"end_line":209,"end_character":72},"in_reply_to":"bae84128_cb1f9606","updated":"2016-02-23 01:06:37.000000000","message":"will revert it.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"31be299bd4d452dc284235e81946c13ec8ffae70","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                context, instance, neutron_client)"},{"line_number":227,"context_line":"            return"},{"line_number":228,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":229,"context_line":"            # Migration to a new host"},{"line_number":230,"context_line":"            ports \u003d self._get_instance_ports("},{"line_number":231,"context_line":"                context, instance, neutron_client)"},{"line_number":232,"context_line":"            for p in ports:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_6bd5aa1a","line":229,"range":{"start_line":229,"start_character":12,"end_line":229,"end_character":37},"updated":"2016-02-23 00:35:31.000000000","message":"Just a suggestion.  Since this method essentially has two behaviors based on the already established method signature, put the code below into its own method (much like you did with the teardown path on L225) and call it from here.  That way this method is short and clearly only exists to dispatch to one of the two behaviors.\n\n  if teardown:\n      self._teardown...\n  else:\n      self._not_teardown...\n\nSomething like that (but not exactly that!).  To me, it separates the concerns a bit more.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"31be299bd4d452dc284235e81946c13ec8ffae70","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":237,"context_line":"                # as the given \u0027host\u0027."},{"line_number":238,"context_line":"                if (p.get(\u0027binding:host_id\u0027) and"},{"line_number":239,"context_line":"                    (p.get(\u0027binding:host_id\u0027) !\u003d host)):"},{"line_number":240,"context_line":"                    port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":241,"context_line":"                    if not port_profile:"},{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_ebe9bae7","line":239,"range":{"start_line":239,"start_character":36,"end_line":239,"end_character":43},"updated":"2016-02-23 00:35:31.000000000","message":"These things should be constants, IMO.  People often wonder why we go through the trouble to use constants.  This is a great example, pep8 could\u0027ve flagged the problem here on PS12 if a constant had been used.\n\nThere is a lot of opportunity for using constants in the code below.\n\nAlso, I suggest creating a local variable to avoid repeating yourself, too.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"92b5efb774e2f7ba08e95982ed65de974c392ea6","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":237,"context_line":"                # as the given \u0027host\u0027."},{"line_number":238,"context_line":"                if (p.get(\u0027binding:host_id\u0027) and"},{"line_number":239,"context_line":"                    (p.get(\u0027binding:host_id\u0027) !\u003d host)):"},{"line_number":240,"context_line":"                    port_profile \u003d p.get(\u0027binding:profile\u0027)"},{"line_number":241,"context_line":"                    if not port_profile:"},{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_66079fca","line":239,"range":{"start_line":239,"start_character":36,"end_line":239,"end_character":43},"in_reply_to":"bae84128_ebe9bae7","updated":"2016-02-23 01:06:37.000000000","message":"Yes I thought about that, but that would be a different patch, since there were too many variable strings used here instead of constants.\nSo I decided to add a follow on patch.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"31be299bd4d452dc284235e81946c13ec8ffae70","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","},{"line_number":243,"context_line":"                                  p[\u0027id\u0027])"},{"line_number":244,"context_line":"                        port_profile \u003d {}"},{"line_number":245,"context_line":"                    else:"},{"line_number":246,"context_line":"                        migration_status \u003d port_profile.get("},{"line_number":247,"context_line":"                            \u0027migration_status\u0027, None)"},{"line_number":248,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_ebd09a21","line":245,"range":{"start_line":245,"start_character":20,"end_line":245,"end_character":24},"updated":"2016-02-23 00:35:31.000000000","message":"I put a note on the previous PS about this but it is very minor.  Just in case you\u0027re curious.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"ef588a608d99b142ef315e57bd040c1223e1a3a5","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","},{"line_number":243,"context_line":"                                  p[\u0027id\u0027])"},{"line_number":244,"context_line":"                        port_profile \u003d {}"},{"line_number":245,"context_line":"                    else:"},{"line_number":246,"context_line":"                        migration_status \u003d port_profile.get("},{"line_number":247,"context_line":"                            \u0027migration_status\u0027, None)"},{"line_number":248,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"}],"source_content_type":"text/x-python","patch_set":13,"id":"bae84128_c61f8b06","line":245,"range":{"start_line":245,"start_character":20,"end_line":245,"end_character":24},"in_reply_to":"bae84128_ebd09a21","updated":"2016-02-23 01:08:50.000000000","message":"Carl I could not find what you added in the previous patch set here. I could not find any reference to that.","commit_id":"c87f3b187861fa96c2254c3131ae92da82008ea5"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update host of port \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _teardown_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_614e0d3c","line":201,"range":{"start_line":201,"start_character":52,"end_line":201,"end_character":56},"updated":"2016-02-24 13:09:30.000000000","message":"binding profile","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update host of port \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _teardown_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_10349e47","line":201,"range":{"start_line":201,"start_character":52,"end_line":201,"end_character":56},"in_reply_to":"bae84128_614e0d3c","updated":"2016-02-24 15:42:14.000000000","message":"Done","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update host of port \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _teardown_migration_port_profile("},{"line_number":205,"context_line":"            self, context, instance, neutron_client):"},{"line_number":206,"context_line":"        ports \u003d self._get_instance_ports(context, instance, neutron_client)"},{"line_number":207,"context_line":"        for p in ports:"}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_c4528712","line":204,"range":{"start_line":204,"start_character":9,"end_line":204,"end_character":17},"updated":"2016-02-24 13:09:30.000000000","message":"nit: clear?","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update host of port \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _teardown_migration_port_profile("},{"line_number":205,"context_line":"            self, context, instance, neutron_client):"},{"line_number":206,"context_line":"        ports \u003d self._get_instance_ports(context, instance, neutron_client)"},{"line_number":207,"context_line":"        for p in ports:"}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_f0365a4f","line":204,"range":{"start_line":204,"start_character":9,"end_line":204,"end_character":17},"in_reply_to":"bae84128_c4528712","updated":"2016-02-24 15:42:14.000000000","message":"Done","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1ee304734cf81ca74d6776a7d06b08f07aa80e80","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                        port_profile \u003d {}"},{"line_number":241,"context_line":"                    else:"},{"line_number":242,"context_line":"                        migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":243,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":244,"context_line":"                            LOG.debug(\"Port already in migrating state: %s\","},{"line_number":245,"context_line":"                                      p[\u0027id\u0027])"},{"line_number":246,"context_line":"                            return"}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_e14cdd9f","line":243,"range":{"start_line":243,"start_character":24,"end_line":243,"end_character":59},"updated":"2016-02-24 13:09:30.000000000","message":"When could it happen? Was it some unfinished migration? Why don\u0027t we check destination then?","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"e2612309dbb26df36e53f16f328bca1def9c0e1e","unresolved":false,"context_lines":[{"line_number":240,"context_line":"                        port_profile \u003d {}"},{"line_number":241,"context_line":"                    else:"},{"line_number":242,"context_line":"                        migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":243,"context_line":"                        if migration_status \u003d\u003d \u0027migration\u0027:"},{"line_number":244,"context_line":"                            LOG.debug(\"Port already in migrating state: %s\","},{"line_number":245,"context_line":"                                      p[\u0027id\u0027])"},{"line_number":246,"context_line":"                            return"}],"source_content_type":"text/x-python","patch_set":15,"id":"bae84128_5070e60a","line":243,"range":{"start_line":243,"start_character":24,"end_line":243,"end_character":59},"in_reply_to":"bae84128_e14cdd9f","updated":"2016-02-24 15:42:14.000000000","message":"Yes this is to handle unfinished migration, and sure we also need to check the destination host.","commit_id":"f64d8914aadea81f13bac96b43ab0f5470dd1c32"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d4096449868d8b4ae1ad4ac8ec9d29f4ce306fac","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":233,"context_line":"                # as the given \u0027host\u0027."},{"line_number":234,"context_line":"                if (p.get(BINDING_HOST_ID) and"},{"line_number":235,"context_line":"                    (p.get(BINDING_HOST_ID) !\u003d host)):"},{"line_number":236,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":237,"context_line":"                    if not port_profile:"},{"line_number":238,"context_line":"                        LOG.debug(\"No profile exists for port %s, creating\","}],"source_content_type":"text/x-python","patch_set":16,"id":"bae84128_7dc0502b","line":235,"updated":"2016-02-24 20:35:12.000000000","message":"nit: could load the host id into a local:\n\nhost_id \u003d p.get(BINDING_HOST_ID)\nif (host_id and host_id !\u003d host):","commit_id":"ec0a4973fd82fbf57a42b4954c4d7d708e4ed0d7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d4096449868d8b4ae1ad4ac8ec9d29f4ce306fac","unresolved":false,"context_lines":[{"line_number":269,"context_line":"            # Reset the port profile"},{"line_number":270,"context_line":"            self._clear_migration_port_profile("},{"line_number":271,"context_line":"                context, instance, neutron_client)"},{"line_number":272,"context_line":"            return"},{"line_number":273,"context_line":"        else:"},{"line_number":274,"context_line":"            # Setup the port profile"},{"line_number":275,"context_line":"            self._setup_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":16,"id":"bae84128_9d19d425","line":272,"updated":"2016-02-24 20:35:12.000000000","message":"not needed as there\u0027s no code after the else","commit_id":"ec0a4973fd82fbf57a42b4954c4d7d708e4ed0d7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d4096449868d8b4ae1ad4ac8ec9d29f4ce306fac","unresolved":false,"context_lines":[{"line_number":1954,"context_line":"                    port_data \u003d {BINDING_HOST_ID: host,"},{"line_number":1955,"context_line":"                                 BINDING_PROFILE: port_profile}"},{"line_number":1956,"context_line":"                else:"},{"line_number":1957,"context_line":"                    port_data \u003d {BINDING_HOST_ID: host}"},{"line_number":1958,"context_line":"                try:"},{"line_number":1959,"context_line":"                    neutron.update_port(p[\u0027id\u0027],"},{"line_number":1960,"context_line":"                                        {\u0027port\u0027: port_data})"}],"source_content_type":"text/x-python","patch_set":16,"id":"bae84128_3d21a8b5","line":1957,"updated":"2016-02-24 20:35:12.000000000","message":"This could move up to L1947, then L1954 could change to:\n\nport_data[BINDING_PROFILE] \u003d port_profile\n\nReduces some duplication","commit_id":"ec0a4973fd82fbf57a42b4954c4d7d708e4ed0d7"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"d8f49931c2b74748f7657258180b1e43ae9b2c5e","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                                  p[\u0027id\u0027])"},{"line_number":240,"context_line":"                        port_profile \u003d {}"},{"line_number":241,"context_line":"                    else:"},{"line_number":242,"context_line":"                        # Check to see if this is an unfinished migration"},{"line_number":243,"context_line":"                        migration_status \u003d port_profile.get(\u0027migration_status\u0027)"},{"line_number":244,"context_line":"                        migrating_host \u003d port_profile.get(\u0027destination\u0027)"},{"line_number":245,"context_line":"                        if (migration_status \u003d\u003d \u0027migration\u0027 and"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_a66e2b94","line":242,"range":{"start_line":242,"start_character":26,"end_line":242,"end_character":73},"updated":"2016-02-25 09:47:03.000000000","message":"What this check gives us? I think this could be just:\n \n port_profile \u003d p.get(BINDING_PROFILE, {})\n port_profile[\u0027migration_status\u0027] \u003d \u0027migration\u0027\n port_profile[\u0027destination\u0027] \u003d host\n updated_port \u003d ...","commit_id":"88b03493f21b51c501c78121e9b3b1fe9fa29e8b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self.last_neutron_extension_sync \u003d None"},{"line_number":185,"context_line":"        self.extensions \u003d {}"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def _get_instance_ports(self, context, instance, neutron_client):"},{"line_number":188,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":189,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":190,"context_line":"        data \u003d neutron_client.list_ports(**search_opts)"},{"line_number":191,"context_line":"        return data[\u0027ports\u0027]"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def _update_port_with_migration_profile("},{"line_number":194,"context_line":"            self, context, instance, port_id, port_profile, neutron_client):"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_819051ee","line":191,"range":{"start_line":187,"start_character":4,"end_line":191,"end_character":28},"updated":"2016-02-25 20:48:21.000000000","message":"Why can\u0027t we just use the existing list_ports method? I realize we have to recreate the client, but otherwise isn\u0027t it the same?\n\nI\u0027m not really against this I guess, since there does seem to be a pattern of several different methods calling list_ports themselves.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self.last_neutron_extension_sync \u003d None"},{"line_number":185,"context_line":"        self.extensions \u003d {}"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def _get_instance_ports(self, context, instance, neutron_client):"},{"line_number":188,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":189,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":190,"context_line":"        data \u003d neutron_client.list_ports(**search_opts)"},{"line_number":191,"context_line":"        return data[\u0027ports\u0027]"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def _update_port_with_migration_profile("},{"line_number":194,"context_line":"            self, context, instance, port_id, port_profile, neutron_client):"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_2d269468","line":191,"range":{"start_line":187,"start_character":4,"end_line":191,"end_character":28},"in_reply_to":"9aed3d3a_819051ee","updated":"2016-02-25 21:51:13.000000000","message":"This would prevent some code duplication, since i call it twice.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        return data[\u0027ports\u0027]"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def _update_port_with_migration_profile("},{"line_number":194,"context_line":"            self, context, instance, port_id, port_profile, neutron_client):"},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":197,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_bc901897","line":194,"range":{"start_line":194,"start_character":18,"end_line":194,"end_character":25},"updated":"2016-02-25 20:48:21.000000000","message":"This parameter isn\u0027t used.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        return data[\u0027ports\u0027]"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    def _update_port_with_migration_profile("},{"line_number":194,"context_line":"            self, context, instance, port_id, port_profile, neutron_client):"},{"line_number":195,"context_line":"        try:"},{"line_number":196,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":197,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_6d209c4a","line":194,"range":{"start_line":194,"start_character":18,"end_line":194,"end_character":25},"in_reply_to":"9aed3d3a_bc901897","updated":"2016-02-25 21:51:13.000000000","message":"will fix it.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":197,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update binding profile \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_1cf824e5","line":199,"range":{"start_line":199,"start_character":8,"end_line":199,"end_character":24},"updated":"2016-02-25 20:48:21.000000000","message":"Would be nice if we could be more specific in what the failures are...like are there specific 400 cases we have to be aware of?","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":197,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update binding profile \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_8d4b60b0","line":199,"range":{"start_line":199,"start_character":8,"end_line":199,"end_character":24},"in_reply_to":"9aed3d3a_1cf824e5","updated":"2016-02-25 21:51:13.000000000","message":"will address it","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update binding profile \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_1c5ca424","line":201,"range":{"start_line":201,"start_character":60,"end_line":201,"end_character":67},"updated":"2016-02-25 20:48:21.000000000","message":"\u0027Unable to update binding profile for port %s\u0027\n\nit\u0027s good to have context on what the ID is (for reading the logs and translations).","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update binding profile \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_dc2a3c7e","line":201,"range":{"start_line":201,"start_character":16,"end_line":201,"end_character":29},"updated":"2016-02-25 20:48:21.000000000","message":"I don\u0027t think we probably need to trace an exception here, just log the error and re-raise.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            return updated_port"},{"line_number":199,"context_line":"        except Exception:"},{"line_number":200,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":201,"context_line":"                LOG.exception(_LE(\"Unable to update binding profile \""},{"line_number":202,"context_line":"                                  \"%s\"), port_id, instance\u003dinstance)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_cd64484b","line":201,"range":{"start_line":201,"start_character":16,"end_line":201,"end_character":29},"in_reply_to":"9aed3d3a_dc2a3c7e","updated":"2016-02-25 21:51:13.000000000","message":"will fix it.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    def _setup_migration_port_profile("},{"line_number":222,"context_line":"            self, context, instance, host, neutron_client):"},{"line_number":223,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":224,"context_line":"            # Migration to a new host"},{"line_number":225,"context_line":"            ports \u003d self._get_instance_ports("},{"line_number":226,"context_line":"                context, instance, neutron_client)"},{"line_number":227,"context_line":"            for p in ports:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_7cf970c8","line":224,"range":{"start_line":224,"start_character":12,"end_line":224,"end_character":37},"updated":"2016-02-25 20:48:21.000000000","message":"Let\u0027s add a debug log that we\u0027re doing something here.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    def _setup_migration_port_profile("},{"line_number":222,"context_line":"            self, context, instance, host, neutron_client):"},{"line_number":223,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":224,"context_line":"            # Migration to a new host"},{"line_number":225,"context_line":"            ports \u003d self._get_instance_ports("},{"line_number":226,"context_line":"                context, instance, neutron_client)"},{"line_number":227,"context_line":"            for p in ports:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_cdcba81d","line":224,"range":{"start_line":224,"start_character":12,"end_line":224,"end_character":37},"in_reply_to":"9aed3d3a_7cf970c8","updated":"2016-02-25 21:51:13.000000000","message":"will add it in.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."},{"line_number":229,"context_line":"                # But if the destination host is different than the"},{"line_number":230,"context_line":"                # current one, please update the port_profile with"},{"line_number":231,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":232,"context_line":"                # as the given \u0027host\u0027."},{"line_number":233,"context_line":"                host_id \u003d p.get(BINDING_HOST_ID)"},{"line_number":234,"context_line":"                if host_id and host_id !\u003d host:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_fc73c0b2","line":231,"range":{"start_line":231,"start_character":61,"end_line":231,"end_character":72},"updated":"2016-02-25 20:48:21.000000000","message":"Do you mean the \u0027migrating_to\u0027 field?","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."},{"line_number":229,"context_line":"                # But if the destination host is different than the"},{"line_number":230,"context_line":"                # current one, please update the port_profile with"},{"line_number":231,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":232,"context_line":"                # as the given \u0027host\u0027."},{"line_number":233,"context_line":"                host_id \u003d p.get(BINDING_HOST_ID)"},{"line_number":234,"context_line":"                if host_id and host_id !\u003d host:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_2de8547c","line":231,"range":{"start_line":231,"start_character":61,"end_line":231,"end_character":72},"in_reply_to":"9aed3d3a_fc73c0b2","updated":"2016-02-25 21:51:13.000000000","message":"Yes, I will fix it.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                # current one, please update the port_profile with"},{"line_number":231,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":232,"context_line":"                # as the given \u0027host\u0027."},{"line_number":233,"context_line":"                host_id \u003d p.get(BINDING_HOST_ID)"},{"line_number":234,"context_line":"                if host_id and host_id !\u003d host:"},{"line_number":235,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE, {})"},{"line_number":236,"context_line":"                    port_profile[\u0027migrating_to\u0027] \u003d host"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_12aacdd4","line":233,"range":{"start_line":233,"start_character":32,"end_line":233,"end_character":47},"updated":"2016-02-25 20:48:21.000000000","message":"Where is this value set? Neutron?","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"459284b05dee3bf88901e4f2a2acd37847abc72f","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                # current one, please update the port_profile with"},{"line_number":231,"context_line":"                # the \u0027migration_status\u0027 as \u0027migration\u0027 and \u0027destination\u0027"},{"line_number":232,"context_line":"                # as the given \u0027host\u0027."},{"line_number":233,"context_line":"                host_id \u003d p.get(BINDING_HOST_ID)"},{"line_number":234,"context_line":"                if host_id and host_id !\u003d host:"},{"line_number":235,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE, {})"},{"line_number":236,"context_line":"                    port_profile[\u0027migrating_to\u0027] \u003d host"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_6d025c40","line":233,"range":{"start_line":233,"start_character":32,"end_line":233,"end_character":47},"in_reply_to":"9aed3d3a_12aacdd4","updated":"2016-02-25 21:51:13.000000000","message":"This value is set in Neutron.\nBut this host binding is always initiated by Nova.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":248,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":249,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":250,"context_line":"            return"},{"line_number":251,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":252,"context_line":"        if teardown:"},{"line_number":253,"context_line":"            # Reset the port profile"},{"line_number":254,"context_line":"            self._clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_c1cb791d","line":251,"range":{"start_line":251,"start_character":8,"end_line":251,"end_character":56},"updated":"2016-02-25 20:48:21.000000000","message":"I guess this matches the port_client logic in allocate_for_instance, I\u0027m always leary of getting an admin client, but this is needed for port things.","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f854f087ae4ba9e9a1edb26827e90a78f888a031","unresolved":false,"context_lines":[{"line_number":786,"context_line":"                       \u0027physical_network\u0027:"},{"line_number":787,"context_line":"                           devspec.get_tags().get(\u0027physical_network\u0027)"},{"line_number":788,"context_line":"                      }"},{"line_number":789,"context_line":"            port_req_body[\u0027port\u0027][\u0027binding:profile\u0027] \u003d profile"},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"    def _populate_neutron_extension_values(self, context, instance,"},{"line_number":792,"context_line":"                                           pci_request_id, port_req_body,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_d2786592","line":789,"updated":"2016-02-25 20:48:21.000000000","message":"It seems we should have a lock for the various methods that are touching the binding:profile for a given instance (lock on the instance uuid probably).","commit_id":"64484f765e4c2d12121f00818dd218513cfda0c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dbb836df99369f69979018feca31424feab707bb","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return updated_port"},{"line_number":193,"context_line":"        except Exception:"},{"line_number":194,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":195,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":196,"context_line":"                              \"for port id: %s\"), port_id, instance\u003dinstance)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def _clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":19,"id":"9aed3d3a_209663f0","line":195,"updated":"2016-02-26 16:32:27.000000000","message":"We should log the error in here also since we aren\u0027t using LOG.exception, so something like:\n\nexcept Exception as ex:\n...\n    LOG.error(_LE(\"Unable to update binding profile \"\n                  \"for port %(port)s. Error: %(error)s\"),\n              {\u0027port\u0027: port_id, \u0027error\u0027: ex},\n              instance\u003dinstance)","commit_id":"d5f1f6b38d8a0389c467639312279c3f01b5259d"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"a4660c605b302e34665e60dec13df9699e92b82a","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return updated_port"},{"line_number":193,"context_line":"        except Exception:"},{"line_number":194,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":195,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":196,"context_line":"                              \"for port id: %s\"), port_id, instance\u003dinstance)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def _clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":19,"id":"9aed3d3a_284a6626","line":195,"in_reply_to":"9aed3d3a_209663f0","updated":"2016-02-29 17:37:45.000000000","message":"Done","commit_id":"d5f1f6b38d8a0389c467639312279c3f01b5259d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return updated_port"},{"line_number":193,"context_line":"        except Exception as ex:"},{"line_number":194,"context_line":"            LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":195,"context_line":"                          \"for port: %(port)s with failure:%(error)s\"),"},{"line_number":196,"context_line":"                      {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":197,"context_line":"                      instance\u003dinstance)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_55aabf19","line":195,"range":{"start_line":195,"start_character":59,"end_line":195,"end_character":60},"updated":"2016-03-01 08:17:28.000000000","message":"nit: space after :","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return updated_port"},{"line_number":193,"context_line":"        except Exception as ex:"},{"line_number":194,"context_line":"            LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":195,"context_line":"                          \"for port: %(port)s with failure:%(error)s\"),"},{"line_number":196,"context_line":"                      {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":197,"context_line":"                      instance\u003dinstance)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7af24918_e5266c15","line":195,"range":{"start_line":195,"start_character":59,"end_line":195,"end_character":60},"in_reply_to":"9aed3d3a_55aabf19","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":208,"context_line":"            if not port_profile:"},{"line_number":209,"context_line":"                continue"},{"line_number":210,"context_line":"            migrating_host \u003d port_profile.get(\u0027migrating_to\u0027)"},{"line_number":211,"context_line":"            if migrating_host:"},{"line_number":212,"context_line":"                del port_profile[\u0027migrating_to\u0027]"},{"line_number":213,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_b546ab78","line":210,"range":{"start_line":210,"start_character":46,"end_line":210,"end_character":60},"updated":"2016-03-01 08:17:28.000000000","message":"this should be a (cross-project) constant as well","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":207,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":208,"context_line":"            if not port_profile:"},{"line_number":209,"context_line":"                continue"},{"line_number":210,"context_line":"            migrating_host \u003d port_profile.get(\u0027migrating_to\u0027)"},{"line_number":211,"context_line":"            if migrating_host:"},{"line_number":212,"context_line":"                del port_profile[\u0027migrating_to\u0027]"},{"line_number":213,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":20,"id":"7af24918_c5237004","line":210,"range":{"start_line":210,"start_character":46,"end_line":210,"end_character":60},"in_reply_to":"9aed3d3a_b546ab78","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            if not port_profile:"},{"line_number":209,"context_line":"                continue"},{"line_number":210,"context_line":"            migrating_host \u003d port_profile.get(\u0027migrating_to\u0027)"},{"line_number":211,"context_line":"            if migrating_host:"},{"line_number":212,"context_line":"                del port_profile[\u0027migrating_to\u0027]"},{"line_number":213,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":214,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_3553bb3a","line":211,"range":{"start_line":211,"start_character":12,"end_line":211,"end_character":30},"updated":"2016-03-01 08:17:28.000000000","message":"nit: if \u0027migrating_to\u0027 in port_profile","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            if not port_profile:"},{"line_number":209,"context_line":"                continue"},{"line_number":210,"context_line":"            migrating_host \u003d port_profile.get(\u0027migrating_to\u0027)"},{"line_number":211,"context_line":"            if migrating_host:"},{"line_number":212,"context_line":"                del port_profile[\u0027migrating_to\u0027]"},{"line_number":213,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":214,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":20,"id":"7af24918_252174fc","line":211,"range":{"start_line":211,"start_character":12,"end_line":211,"end_character":30},"in_reply_to":"9aed3d3a_3553bb3a","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b1a74549f259149bfcb34ff89af0d215ad88b1c6","unresolved":false,"context_lines":[{"line_number":83,"context_line":"_SESSION \u003d None"},{"line_number":84,"context_line":"_ADMIN_AUTH \u003d None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"# TODO(Swami): Replace all the neutron portbinding attribute string"},{"line_number":87,"context_line":"# literals with neutron-lib constants"},{"line_number":88,"context_line":"BINDING_PROFILE \u003d \u0027binding:profile\u0027"},{"line_number":89,"context_line":"BINDING_HOST_ID \u003d \u0027binding:host_id\u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_9509a134","line":86,"updated":"2016-03-11 18:29:49.000000000","message":"I am not sure if we ever want nova to depend on neutron-lib, so I would not personally add the TODO.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"5d3e2a4c7b8b42dd0307904efe9377318dc08046","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            self, context, instance, host, neutron_client, search_opts):"},{"line_number":219,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":220,"context_line":"            # Migrating to a new host"},{"line_number":221,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":222,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":223,"context_line":"            for p in ports:"},{"line_number":224,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_51dedb3f","line":221,"updated":"2016-03-14 09:21:06.000000000","message":"why not extending the interface of the setup_networks_on_host method to take the network_info object (that was gathered by manager.pre_live_migration [1] before) as argument? Cause now we do the list port (device_id\u003dx, tenant_id\u003dy) twice, once for generating the network_info object, and once here! \n\n[1] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L5208","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8ae9d96c0303673ec3b7a460eec1beb9ab5a06e5","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            self, context, instance, host, neutron_client, search_opts):"},{"line_number":219,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":220,"context_line":"            # Migrating to a new host"},{"line_number":221,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":222,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":223,"context_line":"            for p in ports:"},{"line_number":224,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_bfb1cce3","line":221,"in_reply_to":"3afc51ec_51dedb3f","updated":"2016-03-14 17:10:15.000000000","message":"setup_networks_on_host is being handled by both nova and neutron.\nAt this stage we don\u0027t want to make too many changes and just use the function that is existing to make the necessary changes to port binding profile that would be used by neutron.\n\nI would like to know your opinion, if it is worth while to change it at this point.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"e281c45645bd3ca6f0d77868789cb077e0b00d09","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            self, context, instance, host, neutron_client, search_opts):"},{"line_number":219,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":220,"context_line":"            # Migrating to a new host"},{"line_number":221,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":222,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":223,"context_line":"            for p in ports:"},{"line_number":224,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_a08872c6","line":221,"in_reply_to":"3afc51ec_bfb1cce3","updated":"2016-03-15 07:57:49.000000000","message":"I\u0027m not a nova guy, so my opinion probably isn\u0027t that relevant. I see you point, that adding a new argument would also also cause an interface change on the nova networking method... The current fix is very self contained and that\u0027s a great thing. However it makes communication much more chatty than it needs to be. Maybe it\u0027s a good approach to keep that on the radar and propose a change after this moved into the codebase?\nBTW, I like the approach with the binding profile!","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1f250be9fd00b025f0701d635c2bb92f8bca979d","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":242,"context_line":"                               teardown\u003dFalse):"},{"line_number":243,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":244,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":245,"context_line":"            return"},{"line_number":246,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":247,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_550ef934","line":244,"updated":"2016-03-11 18:02:18.000000000","message":"We need to be able to talk to new neutron API version here.\n\nI think we need another sort of extension or version to detect if its safe to do this extra step when talking to Neutron. Its possibly Neuton just ignores the extra args we send, but that doesn\u0027t seem quite right.\n\nAs an aside, I would expect the neutron change to merge before we merge this one, so its possible to test this code before we merge it.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b1a74549f259149bfcb34ff89af0d215ad88b1c6","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":242,"context_line":"                               teardown\u003dFalse):"},{"line_number":243,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":244,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":245,"context_line":"            return"},{"line_number":246,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":247,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_b872d47a","line":244,"in_reply_to":"3afc51ec_550ef934","updated":"2016-03-11 18:29:49.000000000","message":"John, your statement is accurate: this change leverages the binding profile extension, which is not a super strong contract between Neutron and Nova. It\u0027s been leveraged elsewhere in nova, e.g. to handle Ironic and SRIOV use cases. I am not saying that\u0027s a great interface (rather the contrary in fact ;)), but we have never versioned that interface (on the neutron side) and exceptionally doing it now seems to lead to inconsistency.\n\nA NOTE in the code perhaps might help clarify this aspect, but we should definitely ensure that this code path is not going to break if Nova Mitaka runs against Neutron Liberty or older.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8ae9d96c0303673ec3b7a460eec1beb9ab5a06e5","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":242,"context_line":"                               teardown\u003dFalse):"},{"line_number":243,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":244,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":245,"context_line":"            return"},{"line_number":246,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":247,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_1fd8c01c","line":244,"in_reply_to":"3afc51ec_550ef934","updated":"2016-03-14 17:10:15.000000000","message":"Yes I have removed the depends on for the neutron patch and we will merge it first if that is a requirement.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b025ea562d03934cdaf950935b7dc2f1ab4ae4c5","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":242,"context_line":"                               teardown\u003dFalse):"},{"line_number":243,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":244,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":245,"context_line":"            return"},{"line_number":246,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":247,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_e90c8944","line":244,"in_reply_to":"3afc51ec_b872d47a","updated":"2016-03-11 22:57:04.000000000","message":"Run [1] shows that Nova Mitaka can talk to a Neutron (minus the fix) without issues, thus confirming that the extra args do not cause interference. \n\nhttp://logs.openstack.org/73/275073/22/experimental/gate-tempest-dsvm-neutron-dvr-multinode-full/ab337f3/","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"8ae9d96c0303673ec3b7a460eec1beb9ab5a06e5","unresolved":false,"context_lines":[{"line_number":241,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":242,"context_line":"                               teardown\u003dFalse):"},{"line_number":243,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":244,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":245,"context_line":"            return"},{"line_number":246,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":247,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3afc51ec_1f7440fb","line":244,"in_reply_to":"3afc51ec_b872d47a","updated":"2016-03-14 17:10:15.000000000","message":"Yes we don\u0027t want to introduce too many changes at this point and wanted this work with existing code base and will be easy to back port as well.","commit_id":"a6305c0642349b4fe8f5534ac8ac9dfd3c236692"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"19cdd1984cf2dbf8547c7eac9c208de20d10c47d","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":193,"context_line":"                          \"for port: %(port)s with failure: %(error)s\"),"},{"line_number":194,"context_line":"                      {\u0027port\u0027: port_id, \u0027error\u0027: ex},"}],"source_content_type":"text/x-python","patch_set":24,"id":"1af94dfe_befe5503","line":191,"updated":"2016-03-15 11:41:40.000000000","message":"We normally re-raise exceptions that we hit here.\n\nIs there a reason we don\u0027t do that for this case?\n\nIf we don\u0027t raise the exception on purpose, we should probably say why we don\u0027t do that, and change this to a LOG.warning.\n\nFor example, does this raise errors on older versions of Neutron that don\u0027t support the port binding update? I think its just ignored there, which is OK.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"cceebacfc670572f5c692913645ebde3ef431e77","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":193,"context_line":"                          \"for port: %(port)s with failure: %(error)s\"),"},{"line_number":194,"context_line":"                      {\u0027port\u0027: port_id, \u0027error\u0027: ex},"}],"source_content_type":"text/x-python","patch_set":24,"id":"1af94dfe_1074889a","line":191,"in_reply_to":"1af94dfe_befe5503","updated":"2016-03-15 15:45:29.000000000","message":"this was based on the feedback comment that I got from my early patch from mriedem and it is inconsistent from this file as well.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"19cdd1984cf2dbf8547c7eac9c208de20d10c47d","unresolved":false,"context_lines":[{"line_number":1940,"context_line":"                    neutron.update_port(p[\u0027id\u0027],"},{"line_number":1941,"context_line":"                                        {\u0027port\u0027: port_data})"},{"line_number":1942,"context_line":"                except Exception:"},{"line_number":1943,"context_line":"                    with excutils.save_and_reraise_exception():"},{"line_number":1944,"context_line":"                        LOG.exception(_LE(\"Unable to update host of port %s\"),"},{"line_number":1945,"context_line":"                                      p[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1946,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"1af94dfe_fe6d7dcd","line":1943,"updated":"2016-03-15 11:41:40.000000000","message":"see here for a similar error handling of port updates to line 185","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":193,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":194,"context_line":"                              \"for port: %(port)s with failure: %(error)s\"),"},{"line_number":195,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":196,"context_line":"                          instance\u003dinstance)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_cccde986","line":194,"range":{"start_line":194,"start_character":50,"end_line":194,"end_character":54},"updated":"2016-03-17 16:43:58.000000000","message":"nit: due to","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":193,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":194,"context_line":"                              \"for port: %(port)s with failure: %(error)s\"),"},{"line_number":195,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":196,"context_line":"                          instance\u003dinstance)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_ad7bedbc","line":194,"range":{"start_line":194,"start_character":50,"end_line":194,"end_character":54},"in_reply_to":"1af94dfe_cccde986","updated":"2016-03-18 23:32:52.000000000","message":"Done","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":210,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":211,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":212,"context_line":"                self._update_port_with_migration_profile("},{"line_number":213,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _setup_migration_port_profile("},{"line_number":216,"context_line":"            self, context, instance, host, neutron_client, search_opts):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_ccda09e8","line":213,"range":{"start_line":212,"start_character":16,"end_line":213,"end_character":68},"updated":"2016-03-17 16:43:58.000000000","message":"Same comment as below, what if we\u0027re updating multiple ports and we\u0027ve updated a couple and then fail, do we need to rollback the updates to the previously processed ports?","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":210,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":211,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":212,"context_line":"                self._update_port_with_migration_profile("},{"line_number":213,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _setup_migration_port_profile("},{"line_number":216,"context_line":"            self, context, instance, host, neutron_client, search_opts):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_2d84fd08","line":213,"range":{"start_line":212,"start_character":16,"end_line":213,"end_character":68},"in_reply_to":"1af94dfe_ccda09e8","updated":"2016-03-18 23:32:52.000000000","message":"Rollbacks are supported on a per port transaction. So I don\u0027t think that it would be good for the calling function to also keep track and rollback the changes. If required, we  can address it as a follow on patch.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _setup_migration_port_profile("},{"line_number":216,"context_line":"            self, context, instance, host, neutron_client, search_opts):"},{"line_number":217,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":218,"context_line":"            # Migrating to a new host"},{"line_number":219,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":220,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":221,"context_line":"            for p in ports:"},{"line_number":222,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."},{"line_number":223,"context_line":"                # But if the destination host is different than the"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_4c3ef98c","line":220,"range":{"start_line":217,"start_character":8,"end_line":220,"end_character":33},"updated":"2016-03-17 16:43:58.000000000","message":"As noted elsewhere, I\u0027d prefer to do this outside this method and then list the ports and pass them in rather than passing in the search_opts, but we can clean that up later if we\u0027re in a rush to land this.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def _setup_migration_port_profile("},{"line_number":216,"context_line":"            self, context, instance, host, neutron_client, search_opts):"},{"line_number":217,"context_line":"        if host and instance.host !\u003d host:"},{"line_number":218,"context_line":"            # Migrating to a new host"},{"line_number":219,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":220,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":221,"context_line":"            for p in ports:"},{"line_number":222,"context_line":"                # If the host hasn\u0027t changed, there is nothing to do."},{"line_number":223,"context_line":"                # But if the destination host is different than the"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_ed94d537","line":220,"range":{"start_line":217,"start_character":8,"end_line":220,"end_character":33},"in_reply_to":"1af94dfe_4c3ef98c","updated":"2016-03-18 23:32:52.000000000","message":"will fix it.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                # the \u0027migrating_to\u0027(MIGRATING_ATTR) key pointing to"},{"line_number":226,"context_line":"                # the given \u0027host\u0027."},{"line_number":227,"context_line":"                host_id \u003d p.get(BINDING_HOST_ID)"},{"line_number":228,"context_line":"                if host_id and host_id !\u003d host:"},{"line_number":229,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE, {})"},{"line_number":230,"context_line":"                    port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":231,"context_line":"                    updated_port \u003d self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_ac6cddd0","line":228,"range":{"start_line":228,"start_character":16,"end_line":228,"end_character":47},"updated":"2016-03-17 16:43:58.000000000","message":"nit: it might be better to actually filter the ports upfront by filtering on the binding:host_id:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L602","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                if host_id and host_id !\u003d host:"},{"line_number":229,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE, {})"},{"line_number":230,"context_line":"                    port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":231,"context_line":"                    updated_port \u003d self._update_port_with_migration_profile("},{"line_number":232,"context_line":"                        instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":233,"context_line":"                    if updated_port:"},{"line_number":234,"context_line":"                        LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":235,"context_line":"                                  \"profile %(profile_data)s successfully\","}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_0cc07129","line":232,"range":{"start_line":231,"start_character":35,"end_line":232,"end_character":72},"updated":"2016-03-17 16:43:58.000000000","message":"This can fail, for whatever reason. Maybe the neutron server goes down or we have some timeout. The issue would be, say we\u0027re updating 3 ports and we\u0027ve updated the binding profile on the first 2 and fail on the 3rd, we are going to abort this and raise an exception (_update_port_with_migration_profile re-raises the NeutronClientException). Shouldn\u0027t we be rolling back the old values for the binding profiles on the ports we\u0027ve already updated?","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                if host_id and host_id !\u003d host:"},{"line_number":229,"context_line":"                    port_profile \u003d p.get(BINDING_PROFILE, {})"},{"line_number":230,"context_line":"                    port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":231,"context_line":"                    updated_port \u003d self._update_port_with_migration_profile("},{"line_number":232,"context_line":"                        instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":233,"context_line":"                    if updated_port:"},{"line_number":234,"context_line":"                        LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":235,"context_line":"                                  \"profile %(profile_data)s successfully\","}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_906ba6b6","line":232,"range":{"start_line":231,"start_character":35,"end_line":232,"end_character":72},"in_reply_to":"1af94dfe_0cc07129","updated":"2016-03-18 23:32:52.000000000","message":"Same as above.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                                  {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":237,"context_line":"                                   \u0027profile_data\u0027: port_profile})"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":240,"context_line":"                               teardown\u003dFalse):"},{"line_number":241,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_d14aa225","line":239,"updated":"2016-03-17 16:43:58.000000000","message":"We should remove this comment since the method is now implemented:\n\nhttps://github.com/openstack/nova/blob/a023c32c70b5ddbae122636c26ed32e5dcba66b2/nova/compute/manager.py#L2915","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                                  {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":237,"context_line":"                                   \u0027profile_data\u0027: port_profile})"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":240,"context_line":"                               teardown\u003dFalse):"},{"line_number":241,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_cdf11997","line":239,"in_reply_to":"1af94dfe_d14aa225","updated":"2016-03-18 23:32:52.000000000","message":"will fix it.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":243,"context_line":"            return"},{"line_number":244,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":245,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":246,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":247,"context_line":"        if teardown:"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_d153c269","line":244,"range":{"start_line":244,"start_character":45,"end_line":244,"end_character":55},"updated":"2016-03-17 16:43:58.000000000","message":"Does this have to be an admin client? Looking at _unbind_ports I guess it does since we do port updates later.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":243,"context_line":"            return"},{"line_number":244,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":245,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":246,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":247,"context_line":"        if teardown:"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_0d2e61fa","line":244,"range":{"start_line":244,"start_character":45,"end_line":244,"end_character":55},"in_reply_to":"1af94dfe_d153c269","updated":"2016-03-18 23:32:52.000000000","message":"Yes, it should be admin","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":243,"context_line":"            return"},{"line_number":244,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":245,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":246,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":247,"context_line":"        if teardown:"},{"line_number":248,"context_line":"            # Reset the port profile"},{"line_number":249,"context_line":"            self._clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_ccdcc975","line":246,"range":{"start_line":245,"start_character":8,"end_line":246,"end_character":56},"updated":"2016-03-17 16:43:58.000000000","message":"I\u0027m not in love with creating the search_opts here and passing those into the methods below, I\u0027d prefer to just list the ports and send them in. But in at least in the setup method if the hosts don\u0027t match the instance then we don\u0027t do anything.\n\nI\u0027d prefer to just do that check here and pass the ports in to setup if we\u0027re going to setup, but that could be a later cleanup.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d4dbb2c88a11bfd4217e4b124235d29d109d6e1b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":243,"context_line":"            return"},{"line_number":244,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":245,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":246,"context_line":"                       \u0027tenant_id\u0027: instance.project_id}"},{"line_number":247,"context_line":"        if teardown:"},{"line_number":248,"context_line":"            # Reset the port profile"},{"line_number":249,"context_line":"            self._clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_d061aed4","line":246,"range":{"start_line":245,"start_character":8,"end_line":246,"end_character":56},"in_reply_to":"1af94dfe_ccdcc975","updated":"2016-03-18 23:32:52.000000000","message":"will fix it.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5032ed0e4e2519ea69f40c94e7b4cd22a39999c4","unresolved":false,"context_lines":[{"line_number":1934,"context_line":"                # remove the pre-migration status from the port profile"},{"line_number":1935,"context_line":"                port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":1936,"context_line":"                if port_profile:"},{"line_number":1937,"context_line":"                    if port_profile.get(MIGRATING_ATTR):"},{"line_number":1938,"context_line":"                        del port_profile[MIGRATING_ATTR]"},{"line_number":1939,"context_line":"                    port_data[BINDING_PROFILE] \u003d port_profile"},{"line_number":1940,"context_line":"                try:"},{"line_number":1941,"context_line":"                    neutron.update_port(p[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":25,"id":"1af94dfe_864c629f","line":1938,"range":{"start_line":1937,"start_character":20,"end_line":1938,"end_character":56},"updated":"2016-03-17 16:43:58.000000000","message":"This could just be:\n\n  port_profile.pop(MIGRATING_ATTR, None)\n\nBut it\u0027s a nit.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"a462fe9bf2c09383494d31d7bf74c953815db1c4","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            # Reset the port profile"},{"line_number":248,"context_line":"            self._clear_migration_port_profile("},{"line_number":249,"context_line":"                context, instance, neutron_client, ports)"},{"line_number":250,"context_line":"        elif not teardown and not_migrating:"},{"line_number":251,"context_line":"            # Setup the port profile"},{"line_number":252,"context_line":"            self._setup_migration_port_profile("},{"line_number":253,"context_line":"                context, instance, host, neutron_client, ports)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa0719c6_4fdd660d","line":250,"updated":"2016-03-22 18:47:25.000000000","message":"\"not teardown\" has no effect here as it has to be true","commit_id":"9cd7a579e8759701656fded19109d7eff9940db0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"9fb34bb73aaa7d013c987fb7a0cb13c4276d0ee8","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            # Reset the port profile"},{"line_number":248,"context_line":"            self._clear_migration_port_profile("},{"line_number":249,"context_line":"                context, instance, neutron_client, ports)"},{"line_number":250,"context_line":"        elif not teardown and not_migrating:"},{"line_number":251,"context_line":"            # Setup the port profile"},{"line_number":252,"context_line":"            self._setup_migration_port_profile("},{"line_number":253,"context_line":"                context, instance, host, neutron_client, ports)"}],"source_content_type":"text/x-python","patch_set":27,"id":"fa0719c6_61903644","line":250,"in_reply_to":"fa0719c6_4fdd660d","updated":"2016-03-22 22:26:00.000000000","message":"Done","commit_id":"9cd7a579e8759701656fded19109d7eff9940db0"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6a129bb5f5e021b5d37a5faa7785ef9f5ae6cb3e","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            self, instance, port_id, port_profile, neutron_client):"},{"line_number":187,"context_line":"        try:"},{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a061dce_47487fcc","line":189,"updated":"2016-04-06 17:09:40.000000000","message":"Does setting this cause Neutron to do anything? I\u0027m trying to understand what this patch does and I\u0027m not sure I completely get it. Why exactly is this being set? And if it\u0027s being set so Neutron can do something could we not just make that an explicit call and not use this weird unversioned dict for passing data around?","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"21a01ce0a176c8c6e40ba0889b14b9c60ed994be","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            self, instance, port_id, port_profile, neutron_client):"},{"line_number":187,"context_line":"        try:"},{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a061dce_962c799a","line":189,"in_reply_to":"9a061dce_47487fcc","updated":"2016-04-06 22:34:31.000000000","message":"Hi Andrew Laski,\nNeutron has prefined Binding profile port attribute that can be utilized for definining the purpose of the port or for a functionality.\nNeutron ports have port-binding host_id that points to only one host. Since in the case of migration we are moving from one host to another host, we don\u0027t have a way or an attribute to track such as \u0027current_host\u0027 and \u0027future_host\u0027.\n\nSo we make use of the port-profile to add in a dict saying that this port is in \"migration phase\".\n\u0027migrating_to\u0027: host.\n\nNeutron will utilize this tag to take necessary action to precreate L3 networks on the destination node.\n\nAs mentioned in the commit message, the neutron code to handle this already merged.\n\nHope this helps.","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"15984da1a33f0006683806a7120799323829111e","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            self, instance, port_id, port_profile, neutron_client):"},{"line_number":187,"context_line":"        try:"},{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":28,"id":"9a061dce_bff7568b","line":189,"in_reply_to":"9a061dce_962c799a","updated":"2016-04-08 19:16:46.000000000","message":"Thanks for the explanation, that helps me to better understand what is happening here. I\u0027m still concerned that Nova is not interacting with Neutron through a well defined interface here. Why not add a call neutron_client.pre_migrate_port() or something like that which makes a call to Neutron providing this info?\n\nIdeally that call would not just update the port-profile like this is doing but would instead use a call intended for this purpose, but that\u0027s a decision for Neutron.","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"881939d03e1366c9de5b2bea4775f943610b1f94","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            self, instance, port_id, port_profile, neutron_client):"},{"line_number":187,"context_line":"        try:"},{"line_number":188,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":189,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":190,"context_line":"            return updated_port"},{"line_number":191,"context_line":"        except Exception as ex:"},{"line_number":192,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a1b2928_15bf47fc","line":189,"in_reply_to":"9a061dce_bff7568b","updated":"2016-04-11 16:28:05.000000000","message":"Hi Andrew, this implementation was based on the feedback that we received from nova during the mid cycle that this setup_networks_on_host can be used.\n\nWe do have plans to add in more clear handshake api to process the l3 in neutron and provide a state information to nova before it proceeds with the migration.\nBut that is work in progress.\n\nI dont\u0027 think we should hold of on this patch.\nWhat do you think?","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"ac7b175ff31d9bca509884cea5e1d4830ebe0a47","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":226,"context_line":"                updated_port \u003d self._update_port_with_migration_profile("},{"line_number":227,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":228,"context_line":"                if updated_port:"},{"line_number":229,"context_line":"                    LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":230,"context_line":"                              \"profile %(profile_data)s successfully\","},{"line_number":231,"context_line":"                              {\u0027port_id\u0027: p[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"5a18252c_9f09bf2f","line":228,"range":{"start_line":228,"start_character":19,"end_line":228,"end_character":31},"updated":"2016-04-12 14:07:49.000000000","message":"this conditional seems redundant. (always true)","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"37f37f2d483429e6d58d307e0dbf522c65397b72","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":226,"context_line":"                updated_port \u003d self._update_port_with_migration_profile("},{"line_number":227,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":228,"context_line":"                if updated_port:"},{"line_number":229,"context_line":"                    LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":230,"context_line":"                              \"profile %(profile_data)s successfully\","},{"line_number":231,"context_line":"                              {\u0027port_id\u0027: p[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":28,"id":"1a122d0e_0209dddd","line":228,"range":{"start_line":228,"start_character":19,"end_line":228,"end_character":31},"in_reply_to":"5a18252c_9f09bf2f","updated":"2016-04-21 20:45:04.000000000","message":"ok, will fix it.","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"ac7b175ff31d9bca509884cea5e1d4830ebe0a47","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                               \u0027profile_data\u0027: port_profile})"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":235,"context_line":"                               teardown\u003dFalse):"},{"line_number":236,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":237,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":238,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":28,"id":"5a18252c_e202d83d","line":235,"updated":"2016-04-12 14:07:49.000000000","message":"this is called after vifs are plugged, right?\nonce vifs are plugged, l2 agent on the host can start working on them.\nisn\u0027t it simpler to do this before plugging vifs?","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"38e1830007ec48f47f2d40ea81d0d7494a40d218","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                               \u0027profile_data\u0027: port_profile})"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":235,"context_line":"                               teardown\u003dFalse):"},{"line_number":236,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":237,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":238,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":28,"id":"dada55a8_567663d7","line":235,"in_reply_to":"1a122d0e_6225315b","updated":"2016-07-21 05:13:09.000000000","message":"who agreed upon?","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"37f37f2d483429e6d58d307e0dbf522c65397b72","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                               \u0027profile_data\u0027: port_profile})"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":235,"context_line":"                               teardown\u003dFalse):"},{"line_number":236,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":237,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":238,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":28,"id":"1a122d0e_6225315b","line":235,"in_reply_to":"5a18252c_e202d83d","updated":"2016-04-21 20:45:04.000000000","message":"I think we need to do it after the vifs are plugged, only then we might be able to get the port_binding information.\n\nAlso this was the recommended path that we agreed upon.","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"dec366d27deb598f12cf8798f72da3d5d7c8fc30","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                               \u0027profile_data\u0027: port_profile})"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def setup_networks_on_host(self, context, instance, host\u003dNone,"},{"line_number":235,"context_line":"                               teardown\u003dFalse):"},{"line_number":236,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":237,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":238,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":28,"id":"bacf61ea_be664627","line":235,"in_reply_to":"dada55a8_567663d7","updated":"2016-08-02 15:14:20.000000000","message":"I had a discussion with Kevin, Brian and Oleg on this approach before we proceeded in this path.","commit_id":"77448b3e48a2594c30c9aae586c644649b2f5d23"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ef58740280433c1364225bba081d4b6c1dbf531e","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            # it is to be torn down, then we need to clean up"},{"line_number":266,"context_line":"            # the migration profile."},{"line_number":267,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":268,"context_line":"            if not port_profile:"},{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":34,"id":"bacf61ea_1f9dfbbb","line":270,"range":{"start_line":268,"start_character":0,"end_line":270,"end_character":46},"updated":"2016-08-06 09:23:05.000000000","message":"nit: this can be said with a single if:\n\nif port_profile and MIGRATING_ATTR in port_profile:\n    del ...\n\nbut it is clean enough already so I have no hard opinion about it.","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6ebf9a07e46219ce36b21bf110ac101ea7db4c3e","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            # it is to be torn down, then we need to clean up"},{"line_number":266,"context_line":"            # the migration profile."},{"line_number":267,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":268,"context_line":"            if not port_profile:"},{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":34,"id":"9ad45d7e_3146f923","line":270,"range":{"start_line":268,"start_character":0,"end_line":270,"end_character":46},"in_reply_to":"bacf61ea_1f9dfbbb","updated":"2016-08-08 17:26:39.000000000","message":"Ok, will leave it as it is.","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":49,"context_line":"_ADMIN_AUTH \u003d None"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"DEFAULT_SECGROUP \u003d \u0027default\u0027"},{"line_number":52,"context_line":"BINDING_PROFILE \u003d \u0027binding:profile\u0027"},{"line_number":53,"context_line":"BINDING_HOST_ID \u003d \u0027binding:host_id\u0027"},{"line_number":54,"context_line":"MIGRATING_ATTR \u003d \u0027migrating_to\u0027"},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_a5ed678d","line":52,"updated":"2016-08-20 14:19:34.000000000","message":"We could throw these in:\n\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/constants.py\n\nBut I don\u0027t really care, and actually prefer the constants to be defined in the module where they are used. I think the https://github.com/openstack/nova/blob/master/nova/network/neutronv2/constants.py module might be a neutron-ism, or from a subset of it\u0027s core team. :)","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, neutron_client, ports):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_5863b6b1","line":259,"range":{"start_line":254,"start_character":8,"end_line":259,"end_character":44},"updated":"2016-08-20 14:19:34.000000000","message":"There is no unit test for this case.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, neutron_client, ports):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_1e04aac4","line":259,"range":{"start_line":254,"start_character":8,"end_line":259,"end_character":44},"in_reply_to":"1ac06dbe_5863b6b1","updated":"2016-08-24 17:33:23.000000000","message":"Will add one.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":268,"context_line":"            if not port_profile:"},{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_d86fa690","line":270,"updated":"2016-08-20 14:19:34.000000000","message":"There isn\u0027t a unit test for the case that we have a binding:profile but migrating_to isn\u0027t in it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":268,"context_line":"            if not port_profile:"},{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_de3332f5","line":270,"in_reply_to":"1ac06dbe_d86fa690","updated":"2016-08-24 17:33:23.000000000","message":"Will address it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"65ecea1194d169f07ae9779cd61e95446d3dee54","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            port_profile \u003d p.get(BINDING_PROFILE)"},{"line_number":268,"context_line":"            if not port_profile:"},{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("}],"source_content_type":"text/x-python","patch_set":35,"id":"9a89bdaa_d192d99e","line":270,"in_reply_to":"1ac06dbe_de3332f5","updated":"2016-09-06 18:24:31.000000000","message":"Covered by test:\n\ntest_update_port_profile_for_migration_teardown_true_no_profile.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("},{"line_number":274,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_25fa1743","line":272,"updated":"2016-08-20 14:19:34.000000000","message":"Throw instance\u003dinstance kwarg in here for context.\n\nIt\u0027s a bit odd that I don\u0027t see this log message show up in the DVR live migration job logs:\n\nhttp://logs.openstack.org/55/286855/10/experimental/gate-tempest-dsvm-neutron-dvr-multinode-full/0a24466/logs/","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                continue"},{"line_number":270,"context_line":"            if MIGRATING_ATTR in port_profile:"},{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027])"},{"line_number":273,"context_line":"                self._update_port_with_migration_profile("},{"line_number":274,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_5e562207","line":272,"in_reply_to":"1ac06dbe_25fa1743","updated":"2016-08-24 17:33:23.000000000","message":"Will fix it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":289,"context_line":"                self._update_port_with_migration_profile("},{"line_number":290,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":291,"context_line":"                LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":292,"context_line":"                          \"profile %(profile_data)s successfully\","},{"line_number":293,"context_line":"                          {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":294,"context_line":"                           \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_65cc0f36","line":291,"updated":"2016-08-20 14:19:34.000000000","message":"Ack from the dvr multinode job:\n\nhttp://logs.openstack.org/55/286855/10/experimental/gate-tempest-dsvm-neutron-dvr-multinode-full/0a24466/logs/screen-n-cpu.txt.gz#_2016-08-17_13_14_40_208","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":288,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":289,"context_line":"                self._update_port_with_migration_profile("},{"line_number":290,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":291,"context_line":"                LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":292,"context_line":"                          \"profile %(profile_data)s successfully\","},{"line_number":293,"context_line":"                          {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":294,"context_line":"                           \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_3e5b6630","line":291,"in_reply_to":"1ac06dbe_65cc0f36","updated":"2016-08-24 17:33:23.000000000","message":"Thanks.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":299,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":300,"context_line":"            return"},{"line_number":301,"context_line":"        port_migrating \u003d host and (instance.host !\u003d host)"},{"line_number":302,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":303,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":304,"context_line":"                       \u0027tenant_id\u0027: instance.project_id,"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_782cb24a","line":301,"range":{"start_line":301,"start_character":35,"end_line":301,"end_character":56},"updated":"2016-08-20 14:19:34.000000000","message":"I don\u0027t see a unit test where these are the same value and asserts that we don\u0027t attempt to update any ports, so instance.host \u003d\u003d host and not teardown.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        \"\"\"Setup or teardown the network structures.\"\"\""},{"line_number":299,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":300,"context_line":"            return"},{"line_number":301,"context_line":"        port_migrating \u003d host and (instance.host !\u003d host)"},{"line_number":302,"context_line":"        neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":303,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":304,"context_line":"                       \u0027tenant_id\u0027: instance.project_id,"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_be47564a","line":301,"range":{"start_line":301,"start_character":35,"end_line":301,"end_character":56},"in_reply_to":"1ac06dbe_782cb24a","updated":"2016-08-24 17:33:23.000000000","message":"Will a unit test case.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"752ccd47414750806a62175c6ece2613a62c36ab","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":304,"context_line":"                       \u0027tenant_id\u0027: instance.project_id,"},{"line_number":305,"context_line":"                       BINDING_HOST_ID: instance.host}"},{"line_number":306,"context_line":"        data \u003d self.list_ports(context, **search_opts)"},{"line_number":307,"context_line":"        ports \u003d data[\u0027ports\u0027]"},{"line_number":308,"context_line":"        if teardown:"},{"line_number":309,"context_line":"            # Reset the port profile"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_a53a8734","line":306,"updated":"2016-08-20 13:25:30.000000000","message":"Just following along, we\u0027re on the destination host for live migration at this point and we\u0027re asking neutron for the list of ports owned by this project/instance and bound to the source host.\n\nMore comments in the code flow would be helpful since live migration is always super confusing.\n\nAlso, setup_networks_on_host is called several times, like it\u0027s called 3 times from post_live_migration_at_destination alone, twice to setup networks on the target host and once to teardown networks on the source host.\n\nSince we only use the ports if we\u0027re doing the teardown on the source host or migrating the ports, how about we don\u0027t actually get the ports unless we\u0027re doing one of those actions? Otherwise it\u0027s a wasted call to create the admin client and query neutron for the ports.\n\nLive migration is very time sensitive given the computes are doing RPC calls back and forth to each other right now.\n\n-1 for this.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":304,"context_line":"                       \u0027tenant_id\u0027: instance.project_id,"},{"line_number":305,"context_line":"                       BINDING_HOST_ID: instance.host}"},{"line_number":306,"context_line":"        data \u003d self.list_ports(context, **search_opts)"},{"line_number":307,"context_line":"        ports \u003d data[\u0027ports\u0027]"},{"line_number":308,"context_line":"        if teardown:"},{"line_number":309,"context_line":"            # Reset the port profile"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_3ef7e6f6","line":306,"in_reply_to":"1ac06dbe_4578f3f2","updated":"2016-08-24 17:33:23.000000000","message":"Will check this out and correct the behavior.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f4be05c07129fc7b246d45632a9b108497b387ed","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":304,"context_line":"                       \u0027tenant_id\u0027: instance.project_id,"},{"line_number":305,"context_line":"                       BINDING_HOST_ID: instance.host}"},{"line_number":306,"context_line":"        data \u003d self.list_ports(context, **search_opts)"},{"line_number":307,"context_line":"        ports \u003d data[\u0027ports\u0027]"},{"line_number":308,"context_line":"        if teardown:"},{"line_number":309,"context_line":"            # Reset the port profile"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_4578f3f2","line":306,"in_reply_to":"1ac06dbe_a53a8734","updated":"2016-08-20 13:28:28.000000000","message":"\u003e Just following along, we\u0027re on the destination host for live \n\u003e migration at this point and we\u0027re asking neutron for the \n\u003e list of ports owned by this project/instance and bound to \n\u003e the source host.\n\nTo clarify, we could be on the source host tearing down networking too from post_live_migration_at_destination.\n\n--\n\nStill, we should only create the admin client and list the ports if teardown or port_migrating.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":2274,"context_line":""},{"line_number":2275,"context_line":"    def setup_instance_network_on_host(self, context, instance, host):"},{"line_number":2276,"context_line":"        \"\"\"Setup network for specified instance on host.\"\"\""},{"line_number":2277,"context_line":"        self._update_port_binding_for_instance(context, instance, host)"},{"line_number":2278,"context_line":""},{"line_number":2279,"context_line":"    def cleanup_instance_network_on_host(self, context, instance, host):"},{"line_number":2280,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_05b1db8f","line":2277,"updated":"2016-08-20 14:19:34.000000000","message":"note to self, this is not called from a live migration flow - it\u0027s just confusing that we have multiple network API methods like this with similar names.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":2274,"context_line":""},{"line_number":2275,"context_line":"    def setup_instance_network_on_host(self, context, instance, host):"},{"line_number":2276,"context_line":"        \"\"\"Setup network for specified instance on host.\"\"\""},{"line_number":2277,"context_line":"        self._update_port_binding_for_instance(context, instance, host)"},{"line_number":2278,"context_line":""},{"line_number":2279,"context_line":"    def cleanup_instance_network_on_host(self, context, instance, host):"},{"line_number":2280,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_9ec37a8a","line":2277,"in_reply_to":"1ac06dbe_05b1db8f","updated":"2016-08-24 17:33:23.000000000","message":"I think this is still being called when you wanted to update the port binding of the port. It might be due to live migration or some other actions.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"                    pci_mapping \u003d self._get_pci_mapping_for_migration(context,"},{"line_number":2342,"context_line":"                        instance)"},{"line_number":2343,"context_line":""},{"line_number":2344,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":2345,"context_line":"                pci_slot \u003d binding_profile.get(\u0027pci_slot\u0027)"},{"line_number":2346,"context_line":"                new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":2347,"context_line":"                if new_dev:"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_7882f253","line":2344,"range":{"start_line":2344,"start_character":16,"end_line":2344,"end_character":62},"updated":"2016-08-20 14:19:34.000000000","message":"This is going to overwrite the binding_profile being used above...and is redundant, right?","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"                    pci_mapping \u003d self._get_pci_mapping_for_migration(context,"},{"line_number":2342,"context_line":"                        instance)"},{"line_number":2343,"context_line":""},{"line_number":2344,"context_line":"                binding_profile \u003d p.get(\u0027binding:profile\u0027, {})"},{"line_number":2345,"context_line":"                pci_slot \u003d binding_profile.get(\u0027pci_slot\u0027)"},{"line_number":2346,"context_line":"                new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":2347,"context_line":"                if new_dev:"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_fe3a6e97","line":2344,"range":{"start_line":2344,"start_character":16,"end_line":2344,"end_character":62},"in_reply_to":"1ac06dbe_7882f253","updated":"2016-08-24 17:33:23.000000000","message":"Will check this out and fix it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":2346,"context_line":"                new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":2347,"context_line":"                if new_dev:"},{"line_number":2348,"context_line":"                    binding_profile.update(get_pci_device_profile(new_dev))"},{"line_number":2349,"context_line":"                    updates[BINDING_PROFILE] \u003d binding_profile"},{"line_number":2350,"context_line":"                else:"},{"line_number":2351,"context_line":"                    raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":2352,"context_line":"                        reason\u003d_(\"Unable to correlate PCI slot %s\") %"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_f896e292","line":2349,"updated":"2016-08-20 14:19:34.000000000","message":"Yeah this is a different binding_profile at this point and the migrating_to attr might still be in here I\u0027d think.\n\nHmm, actually, I guess updating the binding_profile is by reference and reflects the change back in the port:\n\n\u003e\u003e\u003e port \u003d {\u0027profile\u0027: {\u0027migrating_to\u0027: \u0027fake-host\u0027}}\n\u003e\u003e\u003e port\n{\u0027profile\u0027: {\u0027migrating_to\u0027: \u0027fake-host\u0027}}\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e profile \u003d port.get(\u0027profile\u0027, {})\n\u003e\u003e\u003e profile\n{\u0027migrating_to\u0027: \u0027fake-host\u0027}\n\u003e\u003e\u003e del profile[\u0027migrating_to\u0027]\n\u003e\u003e\u003e profile\n{}\n\u003e\u003e\u003e port\n{\u0027profile\u0027: {}}\n\u003e\u003e\u003e\n\nDefinitely confusing and error prone though...seems like it would be safer if we removed L2344 and just used the same binding_profile variable throughout here.\n\nIt would be good to have a unit test that has a binding:profile with both the migrating_to in it and pci_slot with a pci mapping that gets updated in here to make sure we don\u0027t lose anything based on the two cases.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":2346,"context_line":"                new_dev \u003d pci_mapping.get(pci_slot)"},{"line_number":2347,"context_line":"                if new_dev:"},{"line_number":2348,"context_line":"                    binding_profile.update(get_pci_device_profile(new_dev))"},{"line_number":2349,"context_line":"                    updates[BINDING_PROFILE] \u003d binding_profile"},{"line_number":2350,"context_line":"                else:"},{"line_number":2351,"context_line":"                    raise exception.PortUpdateFailed(port_id\u003dp[\u0027id\u0027],"},{"line_number":2352,"context_line":"                        reason\u003d_(\"Unable to correlate PCI slot %s\") %"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_de6b3284","line":2349,"in_reply_to":"1ac06dbe_f896e292","updated":"2016-08-24 17:33:23.000000000","message":"Ok will fix this.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, neutron_client, ports):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_314ea56f","line":259,"range":{"start_line":254,"start_character":8,"end_line":259,"end_character":44},"updated":"2016-09-06 18:24:21.000000000","message":"Where is this tested?","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a47c146e35bb8c7580a472214f057f049934b30f","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, neutron_client, ports):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_d3fd793b","line":259,"range":{"start_line":254,"start_character":8,"end_line":259,"end_character":44},"in_reply_to":"9a89bdaa_045fa10e","updated":"2016-09-06 21:10:44.000000000","message":"The test isn\u0027t that update_port fails, the test is that the error is handled in this new method _update_port_with_migration_profile and re-raised. Since _update_port_with_migration_profile is new, there would have to be a new test for checking this.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            updated_port \u003d neutron_client.update_port("},{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, neutron_client, ports):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_045fa10e","line":259,"range":{"start_line":254,"start_character":8,"end_line":259,"end_character":44},"in_reply_to":"9a89bdaa_314ea56f","updated":"2016-09-06 18:39:54.000000000","message":"I did see that the tests/unit/network/test_neutronv2.py already has a test for checking if update_port fails.\nSo it would be a redundant one here other than the context of the LOG.error.\nDo you still need a test case for this.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %(port)s migration profile for \""},{"line_number":273,"context_line":"                          \"instance %(instance)s\", {\u0027port\u0027: p[\u0027id\u0027],"},{"line_number":274,"context_line":"                                                    \u0027instance\u0027: instance})"},{"line_number":275,"context_line":"                self._update_port_with_migration_profile("},{"line_number":276,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":277,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_3a64bf20","line":274,"range":{"start_line":274,"start_character":64,"end_line":274,"end_character":72},"updated":"2016-09-06 18:24:21.000000000","message":"We don\u0027t want to log the entire Instance object. To be clear, all I wanted was to pass the instance\u003dinstance kwarg to the LOG.debug method as that provides a context in the logs, e.g.:\n\nhttp://logs.openstack.org/50/365050/1/experimental/gate-tempest-dsvm-lvm-multibackend/12b2e39/logs/screen-n-cpu.txt.gz#_2016-09-02_20_22_05_496\n\nPassing instance\u003dinstance gives this prefix in the message:\n\n[instance: 29e38501-5d6a-4c2f-bb49-189f57ed4f13]\n\nSo you just need this:\n\n  LOG.debug(\"Removing port %s migration profile\", p[\u0027id\u0027],\n            instance\u003dinstance)","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                del port_profile[MIGRATING_ATTR]"},{"line_number":272,"context_line":"                LOG.debug(\"Removing port %(port)s migration profile for \""},{"line_number":273,"context_line":"                          \"instance %(instance)s\", {\u0027port\u0027: p[\u0027id\u0027],"},{"line_number":274,"context_line":"                                                    \u0027instance\u0027: instance})"},{"line_number":275,"context_line":"                self._update_port_with_migration_profile("},{"line_number":276,"context_line":"                    instance, p[\u0027id\u0027], port_profile, neutron_client)"},{"line_number":277,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_4403690d","line":274,"range":{"start_line":274,"start_character":64,"end_line":274,"end_character":72},"in_reply_to":"9a89bdaa_3a64bf20","updated":"2016-09-06 18:39:54.000000000","message":"will fix it.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":302,"context_line":"            return"},{"line_number":303,"context_line":"        # Check if the instance is migrating to a new host."},{"line_number":304,"context_line":"        port_migrating \u003d host and (instance.host !\u003d host)"},{"line_number":305,"context_line":"        # If the port is migrating to a new host or if it is a"},{"line_number":306,"context_line":"        # teardown on the original host, then proceed."},{"line_number":307,"context_line":"        if port_migrating or teardown:"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_b1c5558f","line":304,"updated":"2016-09-06 18:24:21.000000000","message":"I don\u0027t see a unit test where these are the same value and asserts that we don\u0027t attempt to update any ports, so instance.host \u003d\u003d host and not teardown.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":301,"context_line":"        if not self._has_port_binding_extension(context, refresh_cache\u003dTrue):"},{"line_number":302,"context_line":"            return"},{"line_number":303,"context_line":"        # Check if the instance is migrating to a new host."},{"line_number":304,"context_line":"        port_migrating \u003d host and (instance.host !\u003d host)"},{"line_number":305,"context_line":"        # If the port is migrating to a new host or if it is a"},{"line_number":306,"context_line":"        # teardown on the original host, then proceed."},{"line_number":307,"context_line":"        if port_migrating or teardown:"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_e4babd22","line":304,"in_reply_to":"9a89bdaa_b1c5558f","updated":"2016-09-06 18:39:54.000000000","message":"I will try to add one if not there.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":312,"context_line":"            # binding profile info."},{"line_number":313,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":314,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":315,"context_line":"            neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":316,"context_line":"            if teardown:"},{"line_number":317,"context_line":"                # Reset the port profile"},{"line_number":318,"context_line":"                self._clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_ba0d2f40","line":315,"range":{"start_line":315,"start_character":12,"end_line":315,"end_character":26},"updated":"2016-09-06 18:24:21.000000000","message":"nit: I\u0027d maybe rename this to be \u0027admin_client\u0027 or something a bit more indicative that it\u0027s using the admin credentials, which is actually something I thought we wanted to stop doing, but John Garbutt would know more about that.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":312,"context_line":"            # binding profile info."},{"line_number":313,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":314,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":315,"context_line":"            neutron_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":316,"context_line":"            if teardown:"},{"line_number":317,"context_line":"                # Reset the port profile"},{"line_number":318,"context_line":"                self._clear_migration_port_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_84801148","line":315,"range":{"start_line":315,"start_character":12,"end_line":315,"end_character":26},"in_reply_to":"9a89bdaa_ba0d2f40","updated":"2016-09-06 18:39:54.000000000","message":"will try to see what makes sense here.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c672adfd309dde6f001125eae96be1c99ba83aa","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, admin_client, ports):"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_ef18d177","line":259,"range":{"start_line":255,"start_character":12,"end_line":259,"end_character":44},"updated":"2016-09-06 21:16:18.000000000","message":"As noted in PS40, this is a new method, so we should have a test that hits this exception case. So mock update_port to raise some NeutronClientException and make sure that\u0027s re-raised up the stack.","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"20528ed9af4b29bea221b68cf5e3f4abe79ea6dc","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                port_id, {\u0027port\u0027: {BINDING_PROFILE: port_profile}})"},{"line_number":253,"context_line":"            return updated_port"},{"line_number":254,"context_line":"        except Exception as ex:"},{"line_number":255,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":256,"context_line":"                LOG.error(_LE(\"Unable to update binding profile \""},{"line_number":257,"context_line":"                              \"for port: %(port)s due to failure: %(error)s\"),"},{"line_number":258,"context_line":"                          {\u0027port\u0027: port_id, \u0027error\u0027: ex},"},{"line_number":259,"context_line":"                          instance\u003dinstance)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def _clear_migration_port_profile("},{"line_number":262,"context_line":"            self, context, instance, admin_client, ports):"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_aa884e72","line":259,"range":{"start_line":255,"start_character":12,"end_line":259,"end_character":44},"in_reply_to":"9a89bdaa_ef18d177","updated":"2016-09-07 13:54:47.000000000","message":"Yes will add a test case for this.","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c672adfd309dde6f001125eae96be1c99ba83aa","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":290,"context_line":"                self._update_port_with_migration_profile("},{"line_number":291,"context_line":"                    instance, p[\u0027id\u0027], port_profile, admin_client)"},{"line_number":292,"context_line":"                LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":293,"context_line":"                          \"profile %(profile_data)s successfully\","},{"line_number":294,"context_line":"                          {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":295,"context_line":"                           \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_f37d1db2","line":292,"range":{"start_line":292,"start_character":20,"end_line":292,"end_character":25},"updated":"2016-09-06 21:16:18.000000000","message":"nit: pass instance\u003dinstance kwarg here if you have to respin","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"20528ed9af4b29bea221b68cf5e3f4abe79ea6dc","unresolved":false,"context_lines":[{"line_number":289,"context_line":"                port_profile[MIGRATING_ATTR] \u003d host"},{"line_number":290,"context_line":"                self._update_port_with_migration_profile("},{"line_number":291,"context_line":"                    instance, p[\u0027id\u0027], port_profile, admin_client)"},{"line_number":292,"context_line":"                LOG.debug(\"Port %(port_id)s updated with migration \""},{"line_number":293,"context_line":"                          \"profile %(profile_data)s successfully\","},{"line_number":294,"context_line":"                          {\u0027port_id\u0027: p[\u0027id\u0027],"},{"line_number":295,"context_line":"                           \u0027profile_data\u0027: port_profile})"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_aaef6e1c","line":292,"range":{"start_line":292,"start_character":20,"end_line":292,"end_character":25},"in_reply_to":"9a89bdaa_f37d1db2","updated":"2016-09-07 13:54:47.000000000","message":"will fix it.","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0578264de8b34dc7dac3053284e538c619346373","unresolved":false,"context_lines":[{"line_number":306,"context_line":"        # teardown on the original host, then proceed."},{"line_number":307,"context_line":"        if port_migrating or teardown:"},{"line_number":308,"context_line":"            search_opts \u003d {\u0027device_id\u0027: instance.uuid,"},{"line_number":309,"context_line":"                           \u0027tenant_id\u0027: instance.project_id,"},{"line_number":310,"context_line":"                           BINDING_HOST_ID: instance.host}"},{"line_number":311,"context_line":"            # Now get the port details to process the ports"},{"line_number":312,"context_line":"            # binding profile info."}],"source_content_type":"text/x-python","patch_set":45,"id":"9a89bdaa_b6e0872a","line":309,"updated":"2016-09-08 10:45:08.000000000","message":"Nit: seems odd adding this when you are using the user context here, but I think this works, and makes it clearer to read here.","commit_id":"55f3d476a12dce8a70d3e485f0f2f9c752cf0b3d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0578264de8b34dc7dac3053284e538c619346373","unresolved":false,"context_lines":[{"line_number":310,"context_line":"                           BINDING_HOST_ID: instance.host}"},{"line_number":311,"context_line":"            # Now get the port details to process the ports"},{"line_number":312,"context_line":"            # binding profile info."},{"line_number":313,"context_line":"            data \u003d self.list_ports(context, **search_opts)"},{"line_number":314,"context_line":"            ports \u003d data[\u0027ports\u0027]"},{"line_number":315,"context_line":"            admin_client \u003d get_client(context, admin\u003dTrue)"},{"line_number":316,"context_line":"            if teardown:"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a89bdaa_36855759","line":313,"updated":"2016-09-08 10:45:08.000000000","message":"Something tells me this is yet another place we can have a token timeout issue, but I am just getting distracted, we have that issue in other places anyways.","commit_id":"55f3d476a12dce8a70d3e485f0f2f9c752cf0b3d"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":3478,"context_line":"        self, get_client_mock):"},{"line_number":3479,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3480,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3481,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3482,"context_line":"        # port will be moving."},{"line_number":3483,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3484,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_48bbb30e","line":3481,"range":{"start_line":3481,"start_character":61,"end_line":3481,"end_character":65},"updated":"2016-02-22 09:57:15.000000000","message":"nit: where","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":3478,"context_line":"        self, get_client_mock):"},{"line_number":3479,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3480,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3481,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3482,"context_line":"        # port will be moving."},{"line_number":3483,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3484,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_6d167456","line":3481,"range":{"start_line":3481,"start_character":61,"end_line":3481,"end_character":65},"in_reply_to":"bae84128_48bbb30e","updated":"2016-02-22 17:25:56.000000000","message":"Done","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":3498,"context_line":"        self, get_client_mock):"},{"line_number":3499,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3500,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3501,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3502,"context_line":"        # port will be moving."},{"line_number":3503,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3504,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_e842870f","line":3501,"range":{"start_line":3501,"start_character":61,"end_line":3501,"end_character":65},"updated":"2016-02-22 09:57:15.000000000","message":"ditto","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":3498,"context_line":"        self, get_client_mock):"},{"line_number":3499,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3500,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3501,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3502,"context_line":"        # port will be moving."},{"line_number":3503,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3504,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_cd0d0040","line":3501,"range":{"start_line":3501,"start_character":61,"end_line":3501,"end_character":65},"in_reply_to":"bae84128_e842870f","updated":"2016-02-22 17:25:56.000000000","message":"Done","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"95737bedccec6af81a9888307edeac6121b566e5","unresolved":false,"context_lines":[{"line_number":3520,"context_line":"        self, get_client_mock):"},{"line_number":3521,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3522,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3523,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3524,"context_line":"        # port will be moving."},{"line_number":3525,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3526,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_4800d3aa","line":3523,"range":{"start_line":3523,"start_character":61,"end_line":3523,"end_character":65},"updated":"2016-02-22 09:57:15.000000000","message":"ditto","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"c6bf9fbbb7e607b4171db70bea71c96c39bd297c","unresolved":false,"context_lines":[{"line_number":3520,"context_line":"        self, get_client_mock):"},{"line_number":3521,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3522,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3523,"context_line":"        # We test with an instance host and destination_host were the"},{"line_number":3524,"context_line":"        # port will be moving."},{"line_number":3525,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3526,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"bae84128_ed02840a","line":3523,"range":{"start_line":3523,"start_character":61,"end_line":3523,"end_character":65},"in_reply_to":"bae84128_4800d3aa","updated":"2016-02-22 17:25:56.000000000","message":"Done","commit_id":"9bd8c773a00af9b19a3edac9ee8d91c930f046f6"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":3497,"context_line":"                                        instance,"},{"line_number":3498,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3499,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3500,"context_line":"        self.assertEqual(1, update_port_mock.call_count)"},{"line_number":3501,"context_line":""},{"line_number":3502,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3503,"context_line":"    def test_update_port_profile_for_migration_teardown_false("}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_19efd11e","line":3500,"range":{"start_line":3500,"start_character":28,"end_line":3500,"end_character":44},"updated":"2016-03-01 08:17:28.000000000","message":"why not check arguments of update call?","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":3497,"context_line":"                                        instance,"},{"line_number":3498,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3499,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3500,"context_line":"        self.assertEqual(1, update_port_mock.call_count)"},{"line_number":3501,"context_line":""},{"line_number":3502,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3503,"context_line":"    def test_update_port_profile_for_migration_teardown_false("}],"source_content_type":"text/x-python","patch_set":20,"id":"7af24918_652b7cec","line":3500,"range":{"start_line":3500,"start_character":28,"end_line":3500,"end_character":44},"in_reply_to":"9aed3d3a_19efd11e","updated":"2016-03-01 18:08:07.000000000","message":"Done","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"9d74d3815b72ba298ed729271449ad6a0d91f26d","unresolved":false,"context_lines":[{"line_number":3516,"context_line":"                                        instance,"},{"line_number":3517,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3518,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3519,"context_line":"        self.assertEqual(0, update_port_mock.call_count)"},{"line_number":3520,"context_line":""},{"line_number":3521,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3522,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":20,"id":"9aed3d3a_19d6b14e","line":3519,"range":{"start_line":3519,"start_character":28,"end_line":3519,"end_character":44},"updated":"2016-03-01 08:17:28.000000000","message":"ditto","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3a278c3a79e785c21244c1aa0f34c4367ae4c8b3","unresolved":false,"context_lines":[{"line_number":3516,"context_line":"                                        instance,"},{"line_number":3517,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3518,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3519,"context_line":"        self.assertEqual(0, update_port_mock.call_count)"},{"line_number":3520,"context_line":""},{"line_number":3521,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3522,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":20,"id":"7af24918_c53c1032","line":3519,"range":{"start_line":3519,"start_character":28,"end_line":3519,"end_character":44},"in_reply_to":"9aed3d3a_19d6b14e","updated":"2016-03-01 18:08:07.000000000","message":"Will check if \"False\" rather than checking for the arguments here.","commit_id":"85232ba39ba7b0bf1b2bc83064ba9325aee728a8"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"3f1dcc5291068881781a188f88840e0a8aac8cfd","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"BINDING_PROFILE \u003d \u0027binding:profile\u0027"},{"line_number":67,"context_line":"BINDING_HOST_ID \u003d \u0027binding:host_id\u0027"},{"line_number":68,"context_line":"MIGRATING_ATTR \u003d \u0027migrating_to\u0027"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"class MyComparator(mox.Comparator):"}],"source_content_type":"text/x-python","patch_set":24,"id":"3afc51ec_e5b57331","line":68,"updated":"2016-03-15 01:34:54.000000000","message":"Could have just used the neutronapi import for these, but it would have led to some interesting wrapping below.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8689db7aa7c946e93a92b08e51205beeab622738","unresolved":false,"context_lines":[{"line_number":3733,"context_line":""},{"line_number":3734,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3735,"context_line":"    def test_update_port_profile_for_a_migrating_instance_true("},{"line_number":3736,"context_line":"        self, get_client_mock):"},{"line_number":3737,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3738,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3739,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3740,"context_line":"        # port will be moving."},{"line_number":3741,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_5a861614","line":3738,"range":{"start_line":3736,"start_character":0,"end_line":3738,"end_character":1},"updated":"2016-08-03 06:48:46.000000000","message":"nit: needs some indentation or empty line to separate function params from code of the function","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d716441c23d33857235f4884e5b5cd8b10fdeadc","unresolved":false,"context_lines":[{"line_number":3733,"context_line":""},{"line_number":3734,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3735,"context_line":"    def test_update_port_profile_for_a_migrating_instance_true("},{"line_number":3736,"context_line":"        self, get_client_mock):"},{"line_number":3737,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3738,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3739,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3740,"context_line":"        # port will be moving."},{"line_number":3741,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_415d6d78","line":3738,"range":{"start_line":3736,"start_character":0,"end_line":3738,"end_character":1},"in_reply_to":"bacf61ea_5a861614","updated":"2016-08-03 16:13:55.000000000","message":"will fix it.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8689db7aa7c946e93a92b08e51205beeab622738","unresolved":false,"context_lines":[{"line_number":3757,"context_line":""},{"line_number":3758,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3759,"context_line":"    def test_update_port_profile_for_migration_teardown_false("},{"line_number":3760,"context_line":"        self, get_client_mock):"},{"line_number":3761,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3762,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3763,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3764,"context_line":"        # port will be moving."},{"line_number":3765,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_7a431a6d","line":3762,"range":{"start_line":3760,"start_character":0,"end_line":3762,"end_character":1},"updated":"2016-08-03 06:48:46.000000000","message":"ditto","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d716441c23d33857235f4884e5b5cd8b10fdeadc","unresolved":false,"context_lines":[{"line_number":3757,"context_line":""},{"line_number":3758,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3759,"context_line":"    def test_update_port_profile_for_migration_teardown_false("},{"line_number":3760,"context_line":"        self, get_client_mock):"},{"line_number":3761,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":3762,"context_line":"        self.api._has_port_binding_extension \u003d mock.Mock(return_value\u003dTrue)"},{"line_number":3763,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3764,"context_line":"        # port will be moving."},{"line_number":3765,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_a1542954","line":3762,"range":{"start_line":3760,"start_character":0,"end_line":3762,"end_character":1},"in_reply_to":"bacf61ea_7a431a6d","updated":"2016-08-03 16:13:55.000000000","message":"will fix it.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8689db7aa7c946e93a92b08e51205beeab622738","unresolved":false,"context_lines":[{"line_number":3772,"context_line":"                                        instance,"},{"line_number":3773,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3774,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3775,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3776,"context_line":""},{"line_number":3777,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3778,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_5a71f6df","line":3775,"updated":"2016-08-03 06:48:46.000000000","message":"I\u0027m confused. The name of the test case says \u0027update port profile\u0027 but then we assert that there was no call on update_port_mock.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d716441c23d33857235f4884e5b5cd8b10fdeadc","unresolved":false,"context_lines":[{"line_number":3772,"context_line":"                                        instance,"},{"line_number":3773,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3774,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3775,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3776,"context_line":""},{"line_number":3777,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3778,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_fc76c6a1","line":3775,"in_reply_to":"bacf61ea_5a71f6df","updated":"2016-08-03 16:13:55.000000000","message":"The reason here is the migrating attribute is missing in the port_data and so the even though the teardown is true, the update_port will not be called.\n\nThe function name should be also changed to \u0027test_update_port_profile_for_migration_teardown_true\u0027, since we are passing \u003d\u003dtrue to teardown.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8689db7aa7c946e93a92b08e51205beeab622738","unresolved":false,"context_lines":[{"line_number":3773,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3774,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3775,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3776,"context_line":""},{"line_number":3777,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3778,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"},{"line_number":3779,"context_line":"        mocked_comp_utils.get_nw_info_for_instance.return_value \u003d [model.VIF("}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_fada6a16","line":3776,"updated":"2016-08-03 06:48:46.000000000","message":"Do we have a third case when teardown is False and we recreate the instance on the same host? Or I missunderstood the two cases above?","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d716441c23d33857235f4884e5b5cd8b10fdeadc","unresolved":false,"context_lines":[{"line_number":3773,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3774,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3775,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3776,"context_line":""},{"line_number":3777,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3778,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"},{"line_number":3779,"context_line":"        mocked_comp_utils.get_nw_info_for_instance.return_value \u003d [model.VIF("}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_5c58b2fa","line":3776,"in_reply_to":"bacf61ea_fada6a16","updated":"2016-08-03 16:13:55.000000000","message":"I think the first test case handles it and I don\u0027t think we need a third test case explicitly to say teardown\u003dFAlse.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8689db7aa7c946e93a92b08e51205beeab622738","unresolved":false,"context_lines":[{"line_number":4486,"context_line":"        self.mox.ReplayAll()"},{"line_number":4487,"context_line":"        func(*args)"},{"line_number":4488,"context_line":""},{"line_number":4489,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4490,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4491,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4492,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_55a9c7de","line":4489,"range":{"start_line":4489,"start_character":8,"end_line":4489,"end_character":66},"updated":"2016-08-03 06:48:46.000000000","message":"I only see a single call of this function from test_update_port_binding_true_with_migration_port_profile. Why do we need this as a separate function? This seems unnecessary complication especially with the func_name, *args parameters","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6cdb7ccf0cf0ccf1a0542ebdced4f5aa79f22a3f","unresolved":false,"context_lines":[{"line_number":4486,"context_line":"        self.mox.ReplayAll()"},{"line_number":4487,"context_line":"        func(*args)"},{"line_number":4488,"context_line":""},{"line_number":4489,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4490,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4491,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4492,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_f0706674","line":4489,"range":{"start_line":4489,"start_character":8,"end_line":4489,"end_character":66},"in_reply_to":"bacf61ea_14a423b7","updated":"2016-08-04 17:44:17.000000000","message":"I think Matt also had the similar comment, so will merge it to a single function.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"3086c89eb551fd0bbfc4d4c8b50ba80e931f1411","unresolved":false,"context_lines":[{"line_number":4486,"context_line":"        self.mox.ReplayAll()"},{"line_number":4487,"context_line":"        func(*args)"},{"line_number":4488,"context_line":""},{"line_number":4489,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4490,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4491,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4492,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_fcd5261b","line":4489,"range":{"start_line":4489,"start_character":8,"end_line":4489,"end_character":66},"in_reply_to":"bacf61ea_55a9c7de","updated":"2016-08-03 16:15:33.000000000","message":"Just to segregate the operations separate and not to have too many big functions we decided to go this way.","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"314f6be064ba99f80b65211c7cdff3ef8d0f5377","unresolved":false,"context_lines":[{"line_number":4486,"context_line":"        self.mox.ReplayAll()"},{"line_number":4487,"context_line":"        func(*args)"},{"line_number":4488,"context_line":""},{"line_number":4489,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4490,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4491,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4492,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bacf61ea_14a423b7","line":4489,"range":{"start_line":4489,"start_character":8,"end_line":4489,"end_character":66},"in_reply_to":"bacf61ea_fcd5261b","updated":"2016-08-04 11:57:41.000000000","message":"The current split does not really help as:\n* the new function have a same name as the testcase so when I read the test case I don\u0027t really get information about what the extra function does so I anyhow needs to read that function.\n* The argument list of _test_update_port_binding_true_with_migration_port_profile is over complicated, instead of passing func_name and * args you could simply call the necessary function with its arguments directly","commit_id":"29f710f5220edccb84c0c2333dc4f83cd96a736f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f0e1589ec10473688e013244727766fea9c4e21","unresolved":false,"context_lines":[{"line_number":4490,"context_line":"        self.mox.ReplayAll()"},{"line_number":4491,"context_line":"        func(*args)"},{"line_number":4492,"context_line":""},{"line_number":4493,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4494,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4495,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4496,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_2cef5b1f","line":4493,"updated":"2016-08-04 13:51:52.000000000","message":"Why is this a private function if only one thing is calling it? I\u0027d just merge it into the other test that\u0027s calling it.","commit_id":"2e235f6c1ccf253bb89a2ed60944497263a96f2f"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"d254ed39cccb43de386f4436359ade3a72149657","unresolved":false,"context_lines":[{"line_number":4490,"context_line":"        self.mox.ReplayAll()"},{"line_number":4491,"context_line":"        func(*args)"},{"line_number":4492,"context_line":""},{"line_number":4493,"context_line":"    def _test_update_port_binding_true_with_migration_port_profile("},{"line_number":4494,"context_line":"            self, expected_bind_host, func_name, *args):"},{"line_number":4495,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4496,"context_line":"        func \u003d getattr(api, func_name)"}],"source_content_type":"text/x-python","patch_set":33,"id":"bacf61ea_50bcd205","line":4493,"in_reply_to":"bacf61ea_2cef5b1f","updated":"2016-08-04 17:43:24.000000000","message":"Ok will fix it.","commit_id":"2e235f6c1ccf253bb89a2ed60944497263a96f2f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ef58740280433c1364225bba081d4b6c1dbf531e","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        func \u003d getattr(api, \u0027migrate_instance_finish\u0027)"},{"line_number":4535,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4536,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4537,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"}],"source_content_type":"text/x-python","patch_set":34,"id":"bacf61ea_5f5653ce","line":4534,"updated":"2016-08-06 09:23:05.000000000","message":"why don\u0027t you say simply:\n\napi.migration_instance_finish(self.context, instance, migration) in the last line of the test case?","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6ebf9a07e46219ce36b21bf110ac101ea7db4c3e","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        func \u003d getattr(api, \u0027migrate_instance_finish\u0027)"},{"line_number":4535,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4536,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4537,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9ad45d7e_113775b1","line":4534,"in_reply_to":"bacf61ea_5f5653ce","updated":"2016-08-08 17:26:39.000000000","message":"Will fix this.","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ef58740280433c1364225bba081d4b6c1dbf531e","unresolved":false,"context_lines":[{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        func \u003d getattr(api, \u0027migrate_instance_finish\u0027)"},{"line_number":4535,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4536,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4537,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4538,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":34,"id":"bacf61ea_7f6fd791","line":4535,"updated":"2016-08-06 09:23:05.000000000","message":"Could you use mock instead of mox?","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"6ebf9a07e46219ce36b21bf110ac101ea7db4c3e","unresolved":false,"context_lines":[{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        func \u003d getattr(api, \u0027migrate_instance_finish\u0027)"},{"line_number":4535,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4536,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4537,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4538,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":34,"id":"9ad45d7e_91c40593","line":4535,"in_reply_to":"bacf61ea_7f6fd791","updated":"2016-08-08 17:26:39.000000000","message":"Is this an issue?","commit_id":"69a0c4f4ff0b50c945d5523415fd1a598f694895"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \u0027network_info\u0027: \u0027[]\u0027,"},{"line_number":68,"context_line":"    }"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"BINDING_PROFILE \u003d \u0027binding:profile\u0027"},{"line_number":71,"context_line":"BINDING_HOST_ID \u003d \u0027binding:host_id\u0027"},{"line_number":72,"context_line":"MIGRATING_ATTR \u003d \u0027migrating_to\u0027"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class MyComparator(mox.Comparator):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_d8c16682","line":72,"range":{"start_line":70,"start_character":0,"end_line":72,"end_character":31},"updated":"2016-08-20 14:19:34.000000000","message":"We shouldn\u0027t redefine these in the tests, just use them from the neutronv2.api module, or move them into the neutronv2.constants module.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \u0027network_info\u0027: \u0027[]\u0027,"},{"line_number":68,"context_line":"    }"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"BINDING_PROFILE \u003d \u0027binding:profile\u0027"},{"line_number":71,"context_line":"BINDING_HOST_ID \u003d \u0027binding:host_id\u0027"},{"line_number":72,"context_line":"MIGRATING_ATTR \u003d \u0027migrating_to\u0027"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"class MyComparator(mox.Comparator):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_7ef5dec9","line":72,"range":{"start_line":70,"start_character":0,"end_line":72,"end_character":31},"in_reply_to":"1ac06dbe_d8c16682","updated":"2016-08-24 17:33:23.000000000","message":"ok, will fix it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":3776,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3777,"context_line":"        # port will be moving."},{"line_number":3778,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3779,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"},{"line_number":3780,"context_line":"                         BINDING_HOST_ID: instance.host}]}"},{"line_number":3781,"context_line":"        self.api.list_ports \u003d mock.Mock(return_value\u003dget_ports)"},{"line_number":3782,"context_line":"        update_port_mock \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_783792b0","line":3779,"range":{"start_line":3779,"start_character":32,"end_line":3779,"end_character":43},"updated":"2016-08-20 14:19:34.000000000","message":"nit: this would really be a uuid, but meh","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":3776,"context_line":"        # We test with an instance host and destination_host where the"},{"line_number":3777,"context_line":"        # port will be moving."},{"line_number":3778,"context_line":"        get_ports \u003d {\u0027ports\u0027: ["},{"line_number":3779,"context_line":"                        {\u0027id\u0027: \u0027fake-port-1\u0027,"},{"line_number":3780,"context_line":"                         BINDING_HOST_ID: instance.host}]}"},{"line_number":3781,"context_line":"        self.api.list_ports \u003d mock.Mock(return_value\u003dget_ports)"},{"line_number":3782,"context_line":"        update_port_mock \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_de0212b4","line":3779,"range":{"start_line":3779,"start_character":32,"end_line":3779,"end_character":43},"in_reply_to":"1ac06dbe_783792b0","updated":"2016-08-24 17:33:23.000000000","message":"will fix it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":3812,"context_line":"                                        instance,"},{"line_number":3813,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3814,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3815,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3816,"context_line":""},{"line_number":3817,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3818,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_3856bad2","line":3815,"updated":"2016-08-20 14:19:34.000000000","message":"I guess update isn\u0027t called because the port doesn\u0027t have a binding:profile.\n\nThese tests are a bit obscure. There are multiple reasons update_port might not be called in this flow, and this test is testing it from the top-level, which is a bit less unit-y for my tastes. In other words, I like to see the conditionals tested on a per-method basis.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":3812,"context_line":"                                        instance,"},{"line_number":3813,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3814,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3815,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3816,"context_line":""},{"line_number":3817,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3818,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_5e25825a","line":3815,"in_reply_to":"1ac06dbe_3856bad2","updated":"2016-08-24 17:33:23.000000000","message":"ok will fix it.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3bb9007adacea1512d1bedba5079dd826ba667de","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4535,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4536,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4537,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":35,"id":"3ac371cc_e3997a7a","line":4534,"updated":"2016-08-18 08:08:22.000000000","message":"We should really not be adding tests that use mox, we are trying to remove all of these.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5df5a9c0213c76e1a372fb70ea16c9939bbad801","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4535,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4536,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4537,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_785e72ea","line":4534,"in_reply_to":"1ac06dbe_65a6cfc2","updated":"2016-08-20 14:19:34.000000000","message":"Yeah this test is definitely hard to follow, we shouldn\u0027t need to re-use all of the stubbed out mox garbage in the base class, this should be a pretty straight-forward test with mock in the TestNeutronv2WithMock class.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"5d395458a92559c4b282f7d1e0428eeef42d4309","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4535,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4536,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4537,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_dec7b262","line":4534,"in_reply_to":"1ac06dbe_785e72ea","updated":"2016-08-24 17:33:23.000000000","message":"will fix this.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c66a2684ae54c6fa55d3f78ee0a19e406af9d1f","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4535,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4536,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4537,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":35,"id":"1ac06dbe_65a6cfc2","line":4534,"in_reply_to":"3ac371cc_7d483788","updated":"2016-08-20 13:10:03.000000000","message":"TestNeutronv2WithMock is really the place to be, this is in a test class that extends the one base test class that\u0027s really old and has the tons of confusing setup which makes it hard to really tell what\u0027s being tested and what\u0027s stubbed out.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d542af9304d9f8c04bb1b6da163858d60d36b02d","unresolved":false,"context_lines":[{"line_number":4531,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4532,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":4533,"context_line":"        api \u003d neutronapi.API()"},{"line_number":4534,"context_line":"        self.mox.StubOutWithMock(api, \u0027_has_port_binding_extension\u0027)"},{"line_number":4535,"context_line":"        api._has_port_binding_extension(mox.IgnoreArg(),"},{"line_number":4536,"context_line":"                                        refresh_cache\u003dTrue).AndReturn(True)"},{"line_number":4537,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).AndReturn("}],"source_content_type":"text/x-python","patch_set":35,"id":"3ac371cc_7d483788","line":4534,"in_reply_to":"3ac371cc_e3997a7a","updated":"2016-08-19 09:18:16.000000000","message":"I looked briefly at converting this test to mock this morning. It is being added as a new variation in a class full of other related tests that all use mox. The class sets up some common resources based on mox. Wouldn\u0027t it be better to add this test following the pattern of the other tests around it and convert them all to mock in one shot than to add a new test that duplicates the common stuff using mock to begin with?\n\nAlternatively, do you know of another place where there are similar tests that have already been converted to using mock? Maybe you have another suggestion to avoid adding this test here. Let me know and I can work on it today.","commit_id":"9c0c05d5aa139cc651232d7a16a0e6222459d3e6"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"2255a63ebabaf6b1cf4946f3cfa2ad21d2cfa56c","unresolved":false,"context_lines":[{"line_number":4599,"context_line":"        self.mox.ReplayAll()"},{"line_number":4600,"context_line":"        func(*args)"},{"line_number":4601,"context_line":""},{"line_number":4602,"context_line":"    def test_update_port_binding_with_migration_port_profile(self):"},{"line_number":4603,"context_line":"        migration \u003d {\u0027source_compute\u0027: self.instance.get(\u0027host\u0027),"},{"line_number":4604,"context_line":"                     \u0027dest_compute\u0027: \u0027dest_host\u0027}"},{"line_number":4605,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"}],"source_content_type":"text/x-python","patch_set":36,"id":"1ac06dbe_adc0c57d","line":4602,"updated":"2016-08-24 20:18:13.000000000","message":"will try to re-write it with mock, while it is being reviewed","commit_id":"f62cb9579dcf1f682e6127a99261075b75a53b1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":3850,"context_line":"            port_data)"},{"line_number":3851,"context_line":""},{"line_number":3852,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3853,"context_line":"    def test__clear_migration_port_profile_called_on_teardown_true("},{"line_number":3854,"context_line":"        self, get_client_mock):"},{"line_number":3855,"context_line":""},{"line_number":3856,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_312dc546","line":3853,"range":{"start_line":3853,"start_character":8,"end_line":3853,"end_character":66},"updated":"2016-09-06 18:24:21.000000000","message":"Isn\u0027t this essentially redundant with test_update_port_profile_for_migration_teardown_true_with_profile below? But test_update_port_profile_for_migration_teardown_true_with_profile actually tests a bit further into the _clear_migration_port_profile method.\n\nIf so, then let\u0027s remove this redundant test.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":3850,"context_line":"            port_data)"},{"line_number":3851,"context_line":""},{"line_number":3852,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3853,"context_line":"    def test__clear_migration_port_profile_called_on_teardown_true("},{"line_number":3854,"context_line":"        self, get_client_mock):"},{"line_number":3855,"context_line":""},{"line_number":3856,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_e4bf1df9","line":3853,"range":{"start_line":3853,"start_character":8,"end_line":3853,"end_character":66},"in_reply_to":"9a89bdaa_312dc546","updated":"2016-09-06 18:39:54.000000000","message":"As you wish, if you want me to remove it I will remove.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":3881,"context_line":"                                        instance,"},{"line_number":3882,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3883,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3884,"context_line":"        self.assertTrue(self.api._setup_migration_port_profile.called)"},{"line_number":3885,"context_line":""},{"line_number":3886,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3887,"context_line":"    def test_update_port_profile_for_migration_teardown_true_with_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_71de6d40","line":3884,"updated":"2016-09-06 18:24:21.000000000","message":"I\u0027d prefer to see self.api._setup_migration_port_profile.assert_called_once_with(...) used to verify the args.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":3881,"context_line":"                                        instance,"},{"line_number":3882,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3883,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3884,"context_line":"        self.assertTrue(self.api._setup_migration_port_profile.called)"},{"line_number":3885,"context_line":""},{"line_number":3886,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3887,"context_line":"    def test_update_port_profile_for_migration_teardown_true_with_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_443b699c","line":3884,"in_reply_to":"9a89bdaa_71de6d40","updated":"2016-09-06 18:39:54.000000000","message":"will fix it.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":3902,"context_line":"                                        instance,"},{"line_number":3903,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3904,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3905,"context_line":"        self.assertTrue(update_port_mock.called)"},{"line_number":3906,"context_line":""},{"line_number":3907,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3908,"context_line":"    def test_update_port_profile_for_migration_teardown_true_no_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_f1a0bda1","line":3905,"updated":"2016-09-06 18:24:21.000000000","message":"I\u0027d prefer to see update_port_mock.assert_called_once_with(...) since it validates the args passed to update_port().","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":3902,"context_line":"                                        instance,"},{"line_number":3903,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3904,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3905,"context_line":"        self.assertTrue(update_port_mock.called)"},{"line_number":3906,"context_line":""},{"line_number":3907,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3908,"context_line":"    def test_update_port_profile_for_migration_teardown_true_no_profile("}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_84457118","line":3905,"in_reply_to":"9a89bdaa_f1a0bda1","updated":"2016-09-06 18:39:54.000000000","message":"will fix it.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69c4d4c440a447ffa9963872efa5fdb9c583c9e8","unresolved":false,"context_lines":[{"line_number":3921,"context_line":"                                        instance,"},{"line_number":3922,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3923,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3924,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3925,"context_line":""},{"line_number":3926,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3927,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_51a5e9b2","line":3924,"updated":"2016-09-06 18:24:21.000000000","message":"I\u0027d prefer to see this instead since the error message is better if it fails:\n\n  update_port.assert_not_called()","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"16d9bcd17046a3ab54b060036df23ea8a283c46d","unresolved":false,"context_lines":[{"line_number":3921,"context_line":"                                        instance,"},{"line_number":3922,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3923,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3924,"context_line":"        self.assertFalse(update_port_mock.called)"},{"line_number":3925,"context_line":""},{"line_number":3926,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3927,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a89bdaa_c447791b","line":3924,"in_reply_to":"9a89bdaa_51a5e9b2","updated":"2016-09-06 18:39:54.000000000","message":"will fix it.","commit_id":"7cebc26c7e81eae50063210b3d556e948e00e201"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"ed885e53914edb776c5d368bb5d15a6534a20f4d","unresolved":false,"context_lines":[{"line_number":3882,"context_line":"                                        host\u003d\u0027my-new-host\u0027,"},{"line_number":3883,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3884,"context_line":"        self.api._setup_migration_port_profile.assert_called_once_with("},{"line_number":3885,"context_line":"            self.context, instance, \u0027my-new-host\u0027, get_client_mock, get_ports)"},{"line_number":3886,"context_line":""},{"line_number":3887,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3888,"context_line":"    def test__setup_migration_port_profile_not_called_with_host_match("}],"source_content_type":"text/x-python","patch_set":41,"id":"9a89bdaa_e2f2add1","line":3885,"updated":"2016-09-06 19:33:40.000000000","message":"I see an issue when I pass the get_client_mock in here since does not match. Any clues why it does not match.?","commit_id":"7c4532eb4a314bc9db07b2322f24d972b25e6005"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c672adfd309dde6f001125eae96be1c99ba83aa","unresolved":false,"context_lines":[{"line_number":3902,"context_line":"                                        instance,"},{"line_number":3903,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3904,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3905,"context_line":"        self.assertFalse(self.api._setup_migration_port_profile.called)"},{"line_number":3906,"context_line":"        self.assertFalse(self.api._clear_migration_port_profile.called)"},{"line_number":3907,"context_line":""},{"line_number":3908,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3909,"context_line":"    def test_update_port_profile_for_migration_teardown_true_with_profile("}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_930db140","line":3906,"range":{"start_line":3905,"start_character":8,"end_line":3906,"end_character":71},"updated":"2016-09-06 21:16:18.000000000","message":"nit: use assert_not_called() on the mocks for a better error message on failure.","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"20528ed9af4b29bea221b68cf5e3f4abe79ea6dc","unresolved":false,"context_lines":[{"line_number":3902,"context_line":"                                        instance,"},{"line_number":3903,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3904,"context_line":"                                        teardown\u003dFalse)"},{"line_number":3905,"context_line":"        self.assertFalse(self.api._setup_migration_port_profile.called)"},{"line_number":3906,"context_line":"        self.assertFalse(self.api._clear_migration_port_profile.called)"},{"line_number":3907,"context_line":""},{"line_number":3908,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3909,"context_line":"    def test_update_port_profile_for_migration_teardown_true_with_profile("}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_8ad1ca59","line":3906,"range":{"start_line":3905,"start_character":8,"end_line":3906,"end_character":71},"in_reply_to":"9a89bdaa_930db140","updated":"2016-09-07 13:54:47.000000000","message":"Done","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0c672adfd309dde6f001125eae96be1c99ba83aa","unresolved":false,"context_lines":[{"line_number":3925,"context_line":"                                        instance,"},{"line_number":3926,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3927,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3928,"context_line":"        self.assertTrue(update_port_mock.called)"},{"line_number":3929,"context_line":"        update_port_mock.assert_called_once_with("},{"line_number":3930,"context_line":"            port_id, {\u0027port\u0027: {neutronapi.BINDING_PROFILE: migrate_profile}})"},{"line_number":3931,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_6f0cc13b","line":3928,"range":{"start_line":3928,"start_character":8,"end_line":3928,"end_character":48},"updated":"2016-09-06 21:16:18.000000000","message":"You can remove this since assert_called_once_with below is going to validate the same thing.","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"20528ed9af4b29bea221b68cf5e3f4abe79ea6dc","unresolved":false,"context_lines":[{"line_number":3925,"context_line":"                                        instance,"},{"line_number":3926,"context_line":"                                        host\u003dinstance.host,"},{"line_number":3927,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3928,"context_line":"        self.assertTrue(update_port_mock.called)"},{"line_number":3929,"context_line":"        update_port_mock.assert_called_once_with("},{"line_number":3930,"context_line":"            port_id, {\u0027port\u0027: {neutronapi.BINDING_PROFILE: migrate_profile}})"},{"line_number":3931,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"9a89bdaa_0ac69a99","line":3928,"range":{"start_line":3928,"start_character":8,"end_line":3928,"end_character":48},"in_reply_to":"9a89bdaa_6f0cc13b","updated":"2016-09-07 13:54:47.000000000","message":"Done","commit_id":"01fb3917ad29e574d57deac81cdff783047e1dbf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1ddbc832a6bbf1e3ecf8c3becba39ca3135f8ed6","unresolved":false,"context_lines":[{"line_number":3947,"context_line":"                                        teardown\u003dTrue)"},{"line_number":3948,"context_line":"        update_port_mock.assert_not_called()"},{"line_number":3949,"context_line":""},{"line_number":3950,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027, return_value\u003dmock.Mock())"},{"line_number":3951,"context_line":"    def test__update_port_with_migration_profile_raise_exception("},{"line_number":3952,"context_line":"        self, get_client_mock):"},{"line_number":3953,"context_line":""}],"source_content_type":"text/x-python","patch_set":44,"id":"9a89bdaa_ab8e7ecd","line":3950,"range":{"start_line":3950,"start_character":36,"end_line":3950,"end_character":46},"updated":"2016-09-07 20:21:05.000000000","message":"I\u0027m not sure why this is mocked for this test since _update_port_with_migration_profile doesn\u0027t call get_client.","commit_id":"a760cad44538d6cd25ec346fd3783cb54aabea0f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14e5e29355fa1cb8e7326ae9c1ad7f68570bb03c","unresolved":false,"context_lines":[{"line_number":3961,"context_line":"        update_port_mock \u003d mock.Mock("},{"line_number":3962,"context_line":"            side_effect\u003dexceptions.NeutronClientException(error_msg))"},{"line_number":3963,"context_line":"        get_client_mock.return_value.update_port \u003d update_port_mock"},{"line_number":3964,"context_line":"        self.api._update_port_with_migration_profile("},{"line_number":3965,"context_line":"            instance, port_id, migrate_profile,"},{"line_number":3966,"context_line":"            get_client_mock)"},{"line_number":3967,"context_line":"        exc \u003d self.assertRaises("},{"line_number":3968,"context_line":"            exceptions.NeutronClientException,"},{"line_number":3969,"context_line":"            update_port_mock,"}],"source_content_type":"text/x-python","patch_set":44,"id":"9a89bdaa_cb13c2b6","line":3966,"range":{"start_line":3964,"start_character":8,"end_line":3966,"end_character":28},"updated":"2016-09-07 20:15:54.000000000","message":"Why doesn\u0027t this have the assertRaises on it?","commit_id":"a760cad44538d6cd25ec346fd3783cb54aabea0f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14e5e29355fa1cb8e7326ae9c1ad7f68570bb03c","unresolved":false,"context_lines":[{"line_number":3964,"context_line":"        self.api._update_port_with_migration_profile("},{"line_number":3965,"context_line":"            instance, port_id, migrate_profile,"},{"line_number":3966,"context_line":"            get_client_mock)"},{"line_number":3967,"context_line":"        exc \u003d self.assertRaises("},{"line_number":3968,"context_line":"            exceptions.NeutronClientException,"},{"line_number":3969,"context_line":"            update_port_mock,"},{"line_number":3970,"context_line":"            get_client_mock,"},{"line_number":3971,"context_line":"            instance,"},{"line_number":3972,"context_line":"            port_id,"},{"line_number":3973,"context_line":"            port_profile)"},{"line_number":3974,"context_line":"        self.assertIn(error_msg, str(exc))"},{"line_number":3975,"context_line":""},{"line_number":3976,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"}],"source_content_type":"text/x-python","patch_set":44,"id":"9a89bdaa_4b2892e2","line":3973,"range":{"start_line":3967,"start_character":8,"end_line":3973,"end_character":25},"updated":"2016-09-07 20:15:54.000000000","message":"I\u0027m confused, this is asserting that calling the mock raises the side_effect? That\u0027s redundant and doesn\u0027t test that _update_port_with_migration_profile handles it.","commit_id":"a760cad44538d6cd25ec346fd3783cb54aabea0f"}],"releasenotes/notes/implement-setup-networks-on-host-for-neutron-f12eddef0588bf82.yaml":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"21b762be83995975f307de23ee591dea50fed61d","unresolved":false,"context_lines":[{"line_number":3,"context_line":"    Implement setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks"},{"line_number":5,"context_line":"    for DVR routers."},{"line_number":6,"context_line":"features:"},{"line_number":7,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":8,"context_line":"    networks. This would add port binding migrating"},{"line_number":9,"context_line":"    profile to the migrating port in pre-migration"}],"source_content_type":"text/x-yaml","patch_set":23,"id":"3afc51ec_b4f43f87","line":6,"updated":"2016-03-14 23:41:15.000000000","message":"technically this is a bug fix rather than a feature, so this should be \u0027fixes\u0027 rather than \u0027features\u0027","commit_id":"d5b2aef5b42126927165d8d6eb20af548e34e072"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"19cdd1984cf2dbf8547c7eac9c208de20d10c47d","unresolved":false,"context_lines":[{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Implement setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks"},{"line_number":5,"context_line":"    for DVR routers."},{"line_number":6,"context_line":"fixes:"},{"line_number":7,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":8,"context_line":"    networks. This would add port binding migrating"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"1af94dfe_3b89b7cb","line":5,"updated":"2016-03-15 11:41:40.000000000","message":"this isn\u0027t important enough to go here, please look at how this gets rendered.\n\nI think this whole file should be just this line added to the fixes section.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"cceebacfc670572f5c692913645ebde3ef431e77","unresolved":false,"context_lines":[{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Implement setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks"},{"line_number":5,"context_line":"    for DVR routers."},{"line_number":6,"context_line":"fixes:"},{"line_number":7,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":8,"context_line":"    networks. This would add port binding migrating"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"1af94dfe_102c8849","line":5,"in_reply_to":"1af94dfe_3b89b7cb","updated":"2016-03-15 15:45:29.000000000","message":"will fix it.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ff23b598da3020ac43775fa335b7d98d09710974","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    networks to handle creation of L3 networks"},{"line_number":5,"context_line":"    for DVR routers."},{"line_number":6,"context_line":"fixes:"},{"line_number":7,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":8,"context_line":"    networks. This would add port binding migrating"},{"line_number":9,"context_line":"    profile to the migrating port in pre-migration"},{"line_number":10,"context_line":"    phase."}],"source_content_type":"text/x-yaml","patch_set":24,"id":"3afc51ec_4a4ef66f","line":7,"updated":"2016-03-15 00:48:53.000000000","message":"This is end-user facing information. As general rule, I would suggest to talk in more general terms and describe the user perceived issue being fixed (i.e. floating ip traffic disruption over live migration) rather than diving into the codebase details, but this would do I guess :)","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"cceebacfc670572f5c692913645ebde3ef431e77","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    networks to handle creation of L3 networks"},{"line_number":5,"context_line":"    for DVR routers."},{"line_number":6,"context_line":"fixes:"},{"line_number":7,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":8,"context_line":"    networks. This would add port binding migrating"},{"line_number":9,"context_line":"    profile to the migrating port in pre-migration"},{"line_number":10,"context_line":"    phase."}],"source_content_type":"text/x-yaml","patch_set":24,"id":"1af94dfe_301424f4","line":7,"in_reply_to":"3afc51ec_4a4ef66f","updated":"2016-03-15 15:45:29.000000000","message":"ok will make those changes here.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"19cdd1984cf2dbf8547c7eac9c208de20d10c47d","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    networks. This would add port binding migrating"},{"line_number":9,"context_line":"    profile to the migrating port in pre-migration"},{"line_number":10,"context_line":"    phase."},{"line_number":11,"context_line":"  - This patch would also clean up the migrating"},{"line_number":12,"context_line":"    profile if it is a teardown."},{"line_number":13,"context_line":"issues:"},{"line_number":14,"context_line":"  - Right now there is no mechanism to return the"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"1af94dfe_3b02573f","line":11,"updated":"2016-03-15 11:41:40.000000000","message":"This creates two very separate bullet points in the release notes.\n\nI don\u0027t think that what we want, see my comment above.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"cceebacfc670572f5c692913645ebde3ef431e77","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    networks. This would add port binding migrating"},{"line_number":9,"context_line":"    profile to the migrating port in pre-migration"},{"line_number":10,"context_line":"    phase."},{"line_number":11,"context_line":"  - This patch would also clean up the migrating"},{"line_number":12,"context_line":"    profile if it is a teardown."},{"line_number":13,"context_line":"issues:"},{"line_number":14,"context_line":"  - Right now there is no mechanism to return the"}],"source_content_type":"text/x-yaml","patch_set":24,"id":"1af94dfe_b00034ac","line":11,"in_reply_to":"1af94dfe_3b02573f","updated":"2016-03-15 15:45:29.000000000","message":"will remove it.","commit_id":"86b2c028b2ed151904b7dcc64f3a41b0c0a116f0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"66e9b2df3b975713d32f814c5a6737f0bd37196c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks for"},{"line_number":5,"context_line":"    DVR routers in pre-migration phase."}],"source_content_type":"text/x-yaml","patch_set":25,"id":"1af94dfe_c624aa61","line":5,"range":{"start_line":3,"start_character":4,"end_line":5,"end_character":39},"updated":"2016-03-17 16:07:17.000000000","message":"Does this make sense to an operator reading this? It\u0027s pretty heavy on implementation details. What are we trying to express here? That live migration with L3 networks and DVR routers should now work as long as you have the appropriate neutron agent/server fixes deployed first? If so, we should say that.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6ba1c2043fe2a38dbfe2b09ad1adc0324e620b5d","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks for"},{"line_number":5,"context_line":"    DVR routers in pre-migration phase."}],"source_content_type":"text/x-yaml","patch_set":25,"id":"1af94dfe_268c6e7e","line":5,"updated":"2016-03-17 16:08:12.000000000","message":"that\u0027s not necessary to add a relnote for that.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"230e3aecef9aa2056a376667f9764f1acdd4aa7e","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - Implements setup_networks_on_host for Neutron"},{"line_number":4,"context_line":"    networks to handle creation of L3 networks for"},{"line_number":5,"context_line":"    DVR routers in pre-migration phase."}],"source_content_type":"text/x-yaml","patch_set":25,"id":"1af94dfe_30b292e5","line":5,"in_reply_to":"1af94dfe_268c6e7e","updated":"2016-03-18 23:33:30.000000000","message":"Will make it simple.","commit_id":"47b3aafb5f9efa4f59038582914e8ad07bb18cea"}]}
