)]}'
{"ironic/conductor/manager.py":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"60d0479c6fc5b292449abbf6d7ce3fa251ac0078","unresolved":false,"context_lines":[{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port) as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2336,"context_line":"                                                    \u0027port\u0027: port.uuid,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_e22b997f","line":2333,"range":{"start_line":2333,"start_character":48,"end_line":2333,"end_character":55},"updated":"2019-06-18 03:38:18.000000000","message":"Should this be %(port)s to fix that py27 unit test failure?","commit_id":"add1314adb1a3b839779b0d975d0a21a30338259"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"0524d84b19700226022c26d88c4eac3b3910f0d7","unresolved":false,"context_lines":[{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port) as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2336,"context_line":"                                                    \u0027port\u0027: port.uuid,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_c911d1ae","line":2333,"range":{"start_line":2333,"start_character":48,"end_line":2333,"end_character":55},"in_reply_to":"9fb8cfa7_e22b997f","updated":"2019-06-18 14:30:04.000000000","message":"Good catch!","commit_id":"add1314adb1a3b839779b0d975d0a21a30338259"},{"author":{"_account_id":24828,"name":"Kaifeng Wang","email":"kaifeng.w@gmail.com","username":"wangkf"},"change_message_id":"7312d1cc294fdff1c15abc4af178ab47477eafe9","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_ded96122","line":2332,"updated":"2019-06-20 02:34:50.000000000","message":"I think we should allow removing a port when the node is in maintenance state.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"bb8ef601b89961f8145dc1ed5dc829afe1f1ae4b","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_a8082591","line":2332,"in_reply_to":"9fb8cfa7_166a2619","updated":"2019-07-03 14:06:36.000000000","message":"Mark you raise a very good point. Hmm.. Maybe test we return a different record for rescuing that the node must be active and no vif attached for the physical port to be deleted. Thoughts?","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"bb8ef601b89961f8145dc1ed5dc829afe1f1ae4b","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_e8c37d56","line":2332,"in_reply_to":"9fb8cfa7_73c7f413","updated":"2019-07-03 14:06:36.000000000","message":"\u003e I don\u0027t know, maybe something has changed in the neutron side (from\n \u003e the context above) that means we must detach VIFs before the node\n \u003e can be re-used, but I think it\u0027s the responsibility of users to\n \u003e handle clean up after they put node into maintenance.\n\nI kind of agree with you, but I\u0027ve seen far too many cases where people have miss-used putting a node into maintenance to delete it, and then wonder why they can\u0027t bind a port because there is an orphaned vif record.\n\n \u003e As you mentioned, if a node is destroyed, we can still have\n \u003e orphaned VIFs, maybe you are considering a behavior change to\n \u003e prohibit node removal (even in maintenance) when there are VIFs\n \u003e existing?\n\nYeah, that is likely something we ought to do next....","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"5ae3a17812f778405244c381ba4c99c99b5a986f","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_166a2619","line":2332,"in_reply_to":"9fb8cfa7_73c7f413","updated":"2019-06-26 08:46:16.000000000","message":"get_current_vif will return any of the following:\n\ncleaning port\nprovisioning port\nrescuing port\ninstance port\n\nOnly the latter is in the control of the user (or nova). The first three are owned by ironic. Should we distinguish these cases and provide a different message, given that the action required by the user is different?","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"5375a6e163f96163d9fe93908793560063cb5a4b","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_94688e87","line":2332,"in_reply_to":"9fb8cfa7_8f2ddefe","updated":"2019-06-21 13:23:29.000000000","message":"I concur in theory, however we still orphan the VIF then... The vif shouldn\u0027t be still attached otherwise networking config becomes orphaned.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"96791c313599d3e618a58c862bf1bacacab7d802","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_f77f51dc","line":2332,"in_reply_to":"9fb8cfa7_911c0e14","updated":"2019-06-26 06:41:36.000000000","message":"\u003e We have expected that ironic has no assumption on node in\n \u003e maintenance state, I think it\u0027s also true for port.\n \u003e \n\nI concur, but the problem is that if a vif has been bound, we\u0027re orphaning data in neutron which results in a user creating a situation for themselves where they are just trying to destroy a node, and then struggle to figure out why things are not working when they try to deploy it again. We see this time and time again with TripleO where for some insane reason, people\u0027s default reaction is to delete the node, and often we end up with orphaned vif data.\n\n \u003e We can remove a port when it\u0027s in active \u0026 maintenance, but this\n \u003e change will change the behavior, which I think is not appropriate.\n\nIt does, and I think this is behavior that we should change otherwise we create a situation where a vif is orpaned and people have to know that is a behavioral issue because they forced their way out of a situation, that the neutron port is still an object. The presence of the vif record at least blocks them temporarily until the vif record has been removed.\n\n \u003e Another worry is we may have orphaned VIFs during deployment, it\n \u003e prohibits the node from being used. To manually move the node into\n \u003e available pool, we need to remove tenant_vif_port_id, but there is\n \u003e no way to clear it from API since it\u0027s in the internal_info. I\n \u003e would prefer to reconstruct the port, compared with hacking into\n \u003e database.\n\nOrphaned vif attachments already prohibit node re-use because neutron doesn\u0027t support duplicate mac addresses. We\u0027e landed other code on detachment to reset the mac, but we still need to perform the detachment so it makes sense to force the user to trigger a vif detachment and/or remove the port completely from neutron prior to deleting the node..\n\nThat duplication in neutron doesn\u0027t have anything to do with needing to manually move or try and edit field contents, because the fundimental problem is the orphaned record in neutron that was never reconciled.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"b97d8a07ba0fb4a148a580f296458681ea8392d3","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_7f913399","line":2332,"in_reply_to":"9fb8cfa7_94688e87","updated":"2019-06-21 14:00:00.000000000","message":"Agreed, that is an issue. Isn\u0027t maintenance mode the big hammer though to prevent undeletable nodes?","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":24828,"name":"Kaifeng Wang","email":"kaifeng.w@gmail.com","username":"wangkf"},"change_message_id":"ed835f4280bf83ba621bf49e0d5b340a769b742c","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_911c0e14","line":2332,"in_reply_to":"9fb8cfa7_94688e87","updated":"2019-06-24 01:52:23.000000000","message":"We have expected that ironic has no assumption on node in maintenance state, I think it\u0027s also true for port.\n\nWe can remove a port when it\u0027s in active \u0026 maintenance, but this change will change the behavior, which I think is not appropriate.\n\nAnother worry is we may have orphaned VIFs during deployment, it prohibits the node from being used. To manually move the node into available pool, we need to remove tenant_vif_port_id, but there is no way to clear it from API since it\u0027s in the internal_info. I would prefer to reconstruct the port, compared with hacking into database.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"17326594c1eef5d6db344fbc94b7e8300fdda164","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_8f2ddefe","line":2332,"in_reply_to":"9fb8cfa7_ded96122","updated":"2019-06-21 08:38:23.000000000","message":"That would be consistent with node deletion.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"b9e058bd77026b7134d15e4b2d9866cc5d7b4eb2","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_6384fc0b","line":2332,"in_reply_to":"9fb8cfa7_e8c37d56","updated":"2019-08-16 10:10:05.000000000","message":"I think we discussed in IRC checking the node state, and giving a different \u0027node is in state transition\u0027 message in the cleaning/provisioning/rescuing case. The current message could still be used for instance ports that the user has control over.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":24828,"name":"Kaifeng Wang","email":"kaifeng.w@gmail.com","username":"wangkf"},"change_message_id":"11a0d99810442ac484e8eebb55052c742249332e","unresolved":false,"context_lines":[{"line_number":2329,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":2330,"context_line":"                                                        \u0027port\u0027: port.uuid})"},{"line_number":2331,"context_line":"            vif_attachment \u003d task.driver.network.get_current_vif(task, port)"},{"line_number":2332,"context_line":"            if vif_attachment:"},{"line_number":2333,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as VIF \""},{"line_number":2334,"context_line":"                        \"%(vif)s is attached to it on node %(node)s\")"},{"line_number":2335,"context_line":"                raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_73c7f413","line":2332,"in_reply_to":"9fb8cfa7_f77f51dc","updated":"2019-06-26 08:00:58.000000000","message":"I don\u0027t know, maybe something has changed in the neutron side (from the context above) that means we must detach VIFs before the node can be re-used, but I think it\u0027s the responsibility of users to handle clean up after they put node into maintenance.\nAs you mentioned, if a node is destroyed, we can still have orphaned VIFs, maybe you are considering a behavior change to prohibit node removal (even in maintenance) when there are VIFs existing?","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"            node \u003d task.node"},{"line_number":2342,"context_line":"            vifs \u003d task.driver.network.get_current_vif_with_tag(task, port)"},{"line_number":2343,"context_line":"            if vifs:"},{"line_number":2344,"context_line":"                if vifs.get(\u0027tenant_vif_port_id\u0027) is not None:"},{"line_number":2345,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s is bound \""},{"line_number":2346,"context_line":"                            \"to VIF %(vif)s\")"},{"line_number":2347,"context_line":"                    raise exception.InvalidState("}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_ee0dfee6","line":2344,"range":{"start_line":2344,"start_character":50,"end_line":2344,"end_character":61},"updated":"2019-11-22 12:12:11.000000000","message":"nit: not necessary","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":2341,"context_line":"            node \u003d task.node"},{"line_number":2342,"context_line":"            vifs \u003d task.driver.network.get_current_vif_with_tag(task, port)"},{"line_number":2343,"context_line":"            if vifs:"},{"line_number":2344,"context_line":"                if vifs.get(\u0027tenant_vif_port_id\u0027) is not None:"},{"line_number":2345,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s is bound \""},{"line_number":2346,"context_line":"                            \"to VIF %(vif)s\")"},{"line_number":2347,"context_line":"                    raise exception.InvalidState("}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_b8bf4cfa","line":2344,"range":{"start_line":2344,"start_character":50,"end_line":2344,"end_character":61},"in_reply_to":"3fa7e38b_ee0dfee6","updated":"2019-12-11 18:20:21.000000000","message":"Done","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":2342,"context_line":"            vifs \u003d task.driver.network.get_current_vif_with_tag(task, port)"},{"line_number":2343,"context_line":"            if vifs:"},{"line_number":2344,"context_line":"                if vifs.get(\u0027tenant_vif_port_id\u0027) is not None:"},{"line_number":2345,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s is bound \""},{"line_number":2346,"context_line":"                            \"to VIF %(vif)s\")"},{"line_number":2347,"context_line":"                    raise exception.InvalidState("},{"line_number":2348,"context_line":"                        msg % {\u0027port\u0027: port.uuid,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_aef386e6","line":2345,"range":{"start_line":2345,"start_character":61,"end_line":2345,"end_character":63},"updated":"2019-11-22 12:12:11.000000000","message":"as it is","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":2342,"context_line":"            vifs \u003d task.driver.network.get_current_vif_with_tag(task, port)"},{"line_number":2343,"context_line":"            if vifs:"},{"line_number":2344,"context_line":"                if vifs.get(\u0027tenant_vif_port_id\u0027) is not None:"},{"line_number":2345,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s is bound \""},{"line_number":2346,"context_line":"                            \"to VIF %(vif)s\")"},{"line_number":2347,"context_line":"                    raise exception.InvalidState("},{"line_number":2348,"context_line":"                        msg % {\u0027port\u0027: port.uuid,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_98c4d093","line":2345,"range":{"start_line":2345,"start_character":61,"end_line":2345,"end_character":63},"in_reply_to":"3fa7e38b_aef386e6","updated":"2019-12-11 18:20:21.000000000","message":"Done","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":2348,"context_line":"                        msg % {\u0027port\u0027: port.uuid,"},{"line_number":2349,"context_line":"                               \u0027vif\u0027: vifs[\u0027tenant_vif_port_id\u0027]})"},{"line_number":2350,"context_line":""},{"line_number":2351,"context_line":"                if (vifs.get(\u0027cleaning_vif_port_id\u0027) is not None or"},{"line_number":2352,"context_line":"                    vifs.get(\u0027provisioning_vif_port_id\u0027) is not None or"},{"line_number":2353,"context_line":"                    vifs.get(\u0027rescuing_vif_port_id\u0027) is not None):"},{"line_number":2354,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_ce236257","line":2351,"range":{"start_line":2351,"start_character":53,"end_line":2351,"end_character":64},"updated":"2019-11-22 12:12:11.000000000","message":"If the dict only contained valid VIFs as values rather than None, we could just do:\n\nif vifs.get(\u0027tenant_vif_port_id\u0027):\n    \u003ctenant VIF error\u003e\nelse:\n    \u003cother VIF error\u003e","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":2348,"context_line":"                        msg % {\u0027port\u0027: port.uuid,"},{"line_number":2349,"context_line":"                               \u0027vif\u0027: vifs[\u0027tenant_vif_port_id\u0027]})"},{"line_number":2350,"context_line":""},{"line_number":2351,"context_line":"                if (vifs.get(\u0027cleaning_vif_port_id\u0027) is not None or"},{"line_number":2352,"context_line":"                    vifs.get(\u0027provisioning_vif_port_id\u0027) is not None or"},{"line_number":2353,"context_line":"                    vifs.get(\u0027rescuing_vif_port_id\u0027) is not None):"},{"line_number":2354,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_38eb5c12","line":2351,"range":{"start_line":2351,"start_character":53,"end_line":2351,"end_character":64},"in_reply_to":"3fa7e38b_ce236257","updated":"2019-12-11 18:20:21.000000000","message":"That makes way too much sense :)","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":2352,"context_line":"                    vifs.get(\u0027provisioning_vif_port_id\u0027) is not None or"},{"line_number":2353,"context_line":"                    vifs.get(\u0027rescuing_vif_port_id\u0027) is not None):"},{"line_number":2354,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""},{"line_number":2355,"context_line":"                            \"in transition state and has one of the \""},{"line_number":2356,"context_line":"                            \"cleaning, provisioning or rescuing VIF \""},{"line_number":2357,"context_line":"                            \"%(vif)s attached to it.\")"},{"line_number":2358,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_2e31d6a2","line":2355,"range":{"start_line":2355,"start_character":57,"end_line":2355,"end_character":67},"updated":"2019-11-22 12:12:11.000000000","message":"remove","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":2352,"context_line":"                    vifs.get(\u0027provisioning_vif_port_id\u0027) is not None or"},{"line_number":2353,"context_line":"                    vifs.get(\u0027rescuing_vif_port_id\u0027) is not None):"},{"line_number":2354,"context_line":"                    msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""},{"line_number":2355,"context_line":"                            \"in transition state and has one of the \""},{"line_number":2356,"context_line":"                            \"cleaning, provisioning or rescuing VIF \""},{"line_number":2357,"context_line":"                            \"%(vif)s attached to it.\")"},{"line_number":2358,"context_line":"                    raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_f8c944aa","line":2355,"range":{"start_line":2355,"start_character":57,"end_line":2355,"end_character":67},"in_reply_to":"3fa7e38b_2e31d6a2","updated":"2019-12-11 18:20:21.000000000","message":"Done","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3c752b796e34ecf3b420b57a81d3fc80ae04b0c2","unresolved":false,"context_lines":[{"line_number":2047,"context_line":"                        \"to VIF %(vif)s\")"},{"line_number":2048,"context_line":"                raise exception.InvalidState("},{"line_number":2049,"context_line":"                    msg % {\u0027port\u0027: port.uuid,"},{"line_number":2050,"context_line":"                           \u0027vif\u0027: vif})"},{"line_number":2051,"context_line":"            port.destroy()"},{"line_number":2052,"context_line":"            LOG.info(\u0027Successfully deleted port %(port)s. \u0027"},{"line_number":2053,"context_line":"                     \u0027The node associated with the port was %(node)s\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_d3143451","line":2050,"updated":"2020-03-25 16:49:04.000000000","message":"This version is a lot \u0027cleaner\u0027.  I have two thoughts: I don\u0027t think it makes sense to put the is_vif_attached() in utils; it doesn\u0027t seem general enough to be used elsewhere (unless you think there is a use elsewhere?). And it seems to me that the method might as well handle the tenant VIF case too, instead of handling it here.","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":2047,"context_line":"                        \"to VIF %(vif)s\")"},{"line_number":2048,"context_line":"                raise exception.InvalidState("},{"line_number":2049,"context_line":"                    msg % {\u0027port\u0027: port.uuid,"},{"line_number":2050,"context_line":"                           \u0027vif\u0027: vif})"},{"line_number":2051,"context_line":"            port.destroy()"},{"line_number":2052,"context_line":"            LOG.info(\u0027Successfully deleted port %(port)s. \u0027"},{"line_number":2053,"context_line":"                     \u0027The node associated with the port was %(node)s\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_9a056114","line":2050,"in_reply_to":"df33271e_d3143451","updated":"2020-04-17 21:58:56.000000000","message":"I put it in utils largely for future re-usability up front and also it is a lot of code to embed in destroy_port. It should also handle the tenant vif case, if someone re-attached a vif and orphaned it somehow. At least that is my thought/perception.","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"cf8df165b26bab0b2a64369b9101a8dec0e49f23","unresolved":false,"context_lines":[{"line_number":2043,"context_line":"        :raises: NodeLocked if node is locked by another conductor."},{"line_number":2044,"context_line":"        :raises: NodeNotFound if the node associated with the port does not"},{"line_number":2045,"context_line":"                 exist."},{"line_number":2046,"context_line":"        :raises: InvalidState if a vif is still attached th the port."},{"line_number":2047,"context_line":""},{"line_number":2048,"context_line":"        \"\"\""},{"line_number":2049,"context_line":"        LOG.debug(\u0027RPC destroy_port called for port %(port)s\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_b4b87876","line":2046,"updated":"2020-04-15 13:06:25.000000000","message":"nit s/th/to the/","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"952371124089903f1625d5d0de0bf7505f5a032e","unresolved":false,"context_lines":[{"line_number":2051,"context_line":"        with task_manager.acquire(context, port.node_id,"},{"line_number":2052,"context_line":"                                  purpose\u003d\u0027port deletion\u0027) as task:"},{"line_number":2053,"context_line":"            vif, vif_use \u003d utils.get_attached_vif(port)"},{"line_number":2054,"context_line":"            if vif:"},{"line_number":2055,"context_line":"                msg \u003d _(\"Cannot delete the port %(port)s as it is bound \""},{"line_number":2056,"context_line":"                        \"to VIF %(vif)s for %(use)s use.\")"},{"line_number":2057,"context_line":"                raise exception.InvalidState("}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_e190f1ef","line":2054,"updated":"2020-07-14 13:53:33.000000000","message":"we should have kept the check on maintenance, otherwise we risk ending up with ports that cannot be deleted if e.g. anything is wrong on the neutron side (neutron port accidentally removed?)","commit_id":"64674bf0ed966c3e8f241d555b772f03e7407951"}],"ironic/conductor/utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3c752b796e34ecf3b420b57a81d3fc80ae04b0c2","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"        \u0027agent_secret_token_pregenerated\u0027, False)"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":""},{"line_number":1104,"context_line":"def is_vif_attached(task, port):"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"    def error(node, port, vif):"},{"line_number":1107,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_33a80076","line":1104,"updated":"2020-03-25 16:49:04.000000000","message":"this method name is odd. Looks like you are returning the tenant VIF if it exists, None if there is no tenant VIF, and raises an exception if there is a non-tenant VIF.","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3c752b796e34ecf3b420b57a81d3fc80ae04b0c2","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"def is_vif_attached(task, port):"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"    def error(node, port, vif):"},{"line_number":1107,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""},{"line_number":1108,"context_line":"                \"in a transition state and has a \""},{"line_number":1109,"context_line":"                \"cleaning, provisioning or rescuing VIF \""},{"line_number":1110,"context_line":"                \"%(vif)s attached to it. Please move the node to \""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_7309e893","line":1107,"updated":"2020-03-25 16:49:04.000000000","message":"maybe s/%(node)s/node %(node)s/","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3c752b796e34ecf3b420b57a81d3fc80ae04b0c2","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"    def error(node, port, vif):"},{"line_number":1107,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""},{"line_number":1108,"context_line":"                \"in a transition state and has a \""},{"line_number":1109,"context_line":"                \"cleaning, provisioning or rescuing VIF \""},{"line_number":1110,"context_line":"                \"%(vif)s attached to it. Please move the node to \""},{"line_number":1111,"context_line":"                \"a stable provision state before proceeding.\")"},{"line_number":1112,"context_line":"        raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_f3f4d889","line":1109,"updated":"2020-03-25 16:49:04.000000000","message":"we might as well pass in the type of VIF (\u0027cleaning\u0027, \u0027provisioning\u0027, \u0027rescuing\u0027) so that this msg is more accurate. might help with debugging etc.","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"    def error(node, port, vif):"},{"line_number":1107,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s as %(node)s is \""},{"line_number":1108,"context_line":"                \"in a transition state and has a \""},{"line_number":1109,"context_line":"                \"cleaning, provisioning or rescuing VIF \""},{"line_number":1110,"context_line":"                \"%(vif)s attached to it. Please move the node to \""},{"line_number":1111,"context_line":"                \"a stable provision state before proceeding.\")"},{"line_number":1112,"context_line":"        raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_da59a935","line":1109,"in_reply_to":"df33271e_f3f4d889","updated":"2020-04-17 21:58:56.000000000","message":"I\u0027d prefer that we just get them to move it to a stable state and remove the vifs. The operator can\u0027t really remove an internal vif any other way.","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3c752b796e34ecf3b420b57a81d3fc80ae04b0c2","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"    # and make this method generally more usable."},{"line_number":1117,"context_line":"    for port_like_obj in task.ports + task.portgroups:"},{"line_number":1118,"context_line":"        if port_like_obj.uuid !\u003d port:"},{"line_number":1119,"context_line":"            pass"},{"line_number":1120,"context_line":""},{"line_number":1121,"context_line":"        tenant_vif \u003d port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027)"},{"line_number":1122,"context_line":"        if tenant_vif:"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_b3ea50a9","line":1119,"updated":"2020-03-25 16:49:04.000000000","message":"i think you might want \u0027continue\u0027 instead of \u0027pass\u0027","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":1116,"context_line":"    # and make this method generally more usable."},{"line_number":1117,"context_line":"    for port_like_obj in task.ports + task.portgroups:"},{"line_number":1118,"context_line":"        if port_like_obj.uuid !\u003d port:"},{"line_number":1119,"context_line":"            pass"},{"line_number":1120,"context_line":""},{"line_number":1121,"context_line":"        tenant_vif \u003d port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027)"},{"line_number":1122,"context_line":"        if tenant_vif:"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_7a333df7","line":1119,"in_reply_to":"df33271e_b3ea50a9","updated":"2020-04-17 21:58:56.000000000","message":"doh!","commit_id":"757c14edba607df411e10d1339a3318e0ac587a0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"cf8df165b26bab0b2a64369b9101a8dec0e49f23","unresolved":false,"context_lines":[{"line_number":1140,"context_line":"    \"\"\"Get any attached vif ID for the port"},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"    :param task: A taskmanager task object."},{"line_number":1143,"context_line":"    :param port: The port UUID we should check for any vif attachment"},{"line_number":1144,"context_line":"                 records."},{"line_number":1145,"context_line":"    :returns: tenant VIF id if found or None."},{"line_number":1146,"context_line":"    :raises: InvalidState exception upon finding a port with a"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_d4ac2437","line":1143,"updated":"2020-04-15 13:06:25.000000000","message":"looks like it is a port object, not UUID.","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":1140,"context_line":"    \"\"\"Get any attached vif ID for the port"},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"    :param task: A taskmanager task object."},{"line_number":1143,"context_line":"    :param port: The port UUID we should check for any vif attachment"},{"line_number":1144,"context_line":"                 records."},{"line_number":1145,"context_line":"    :returns: tenant VIF id if found or None."},{"line_number":1146,"context_line":"    :raises: InvalidState exception upon finding a port with a"}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_3b71d7e1","line":1143,"in_reply_to":"3f4c43b2_d4ac2437","updated":"2020-04-17 21:58:56.000000000","message":"Done","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"cf8df165b26bab0b2a64369b9101a8dec0e49f23","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"             transient state vif on the port."},{"line_number":1148,"context_line":"    \"\"\""},{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"    def error(node, port, vif):"},{"line_number":1151,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s from node %(node)s \""},{"line_number":1152,"context_line":"                \"as a tenant or ironic internal VIF is attached for \""},{"line_number":1153,"context_line":"                \"cleaning, provisioning or rescuing VIF \""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_d45a644e","line":1150,"updated":"2020-04-15 13:06:25.000000000","message":"you could add another parameter, eg \u0027how_used\u0027 which could have value \u0027cleaning\u0027, \u0027provisioning\u0027, or \u0027rescuing\u0027. Then use this string in the error msg.","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"             transient state vif on the port."},{"line_number":1148,"context_line":"    \"\"\""},{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"    def error(node, port, vif):"},{"line_number":1151,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s from node %(node)s \""},{"line_number":1152,"context_line":"                \"as a tenant or ironic internal VIF is attached for \""},{"line_number":1153,"context_line":"                \"cleaning, provisioning or rescuing VIF \""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_5b6e6301","line":1150,"in_reply_to":"3f4c43b2_d45a644e","updated":"2020-04-17 21:58:56.000000000","message":"Done","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"cf8df165b26bab0b2a64369b9101a8dec0e49f23","unresolved":false,"context_lines":[{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"    def error(node, port, vif):"},{"line_number":1151,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s from node %(node)s \""},{"line_number":1152,"context_line":"                \"as a tenant or ironic internal VIF is attached for \""},{"line_number":1153,"context_line":"                \"cleaning, provisioning or rescuing VIF \""},{"line_number":1154,"context_line":"                \"%(vif)s attached to it. Please move the node to \""},{"line_number":1155,"context_line":"                \"a stable provision state and remove attached VIFs \""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_f47680d8","line":1152,"updated":"2020-04-15 13:06:25.000000000","message":"it wouldn\u0027t be a tenant, since you return the tenant VIF in that case.","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"73f9d325c55fb11f86610816271d950857663cd3","unresolved":false,"context_lines":[{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"    def error(node, port, vif):"},{"line_number":1151,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s from node %(node)s \""},{"line_number":1152,"context_line":"                \"as a tenant or ironic internal VIF is attached for \""},{"line_number":1153,"context_line":"                \"cleaning, provisioning or rescuing VIF \""},{"line_number":1154,"context_line":"                \"%(vif)s attached to it. Please move the node to \""},{"line_number":1155,"context_line":"                \"a stable provision state and remove attached VIFs \""}],"source_content_type":"text/x-python","patch_set":11,"id":"3f4c43b2_fb980f1c","line":1152,"in_reply_to":"3f4c43b2_f47680d8","updated":"2020-04-17 21:58:56.000000000","message":"++","commit_id":"896e2c73d41e6ef102ca525d890bd5060f67d852"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"15c8e39ebda9f6cdd5fb4c649bd6ee1a1227235e","unresolved":false,"context_lines":[{"line_number":1136,"context_line":"    return crypt.crypt(password, make_salt())"},{"line_number":1137,"context_line":""},{"line_number":1138,"context_line":""},{"line_number":1139,"context_line":"def get_attached_vif(task, port):"},{"line_number":1140,"context_line":"    \"\"\"Get any attached vif ID for the port"},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"    :param task: A taskmanager task object."}],"source_content_type":"text/x-python","patch_set":12,"id":"1f493fa4_a58e59cd","line":1139,"range":{"start_line":1139,"start_character":4,"end_line":1139,"end_character":20},"updated":"2020-04-24 19:47:00.000000000","message":"A unit test for this would be nice.","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"15c8e39ebda9f6cdd5fb4c649bd6ee1a1227235e","unresolved":false,"context_lines":[{"line_number":1140,"context_line":"    \"\"\"Get any attached vif ID for the port"},{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"    :param task: A taskmanager task object."},{"line_number":1143,"context_line":"    :param port: The port object upon which to b"},{"line_number":1144,"context_line":"    :returns: tenant VIF id if found or None."},{"line_number":1145,"context_line":"    :raises: InvalidState exception upon finding a port with a"},{"line_number":1146,"context_line":"             transient state vif on the port."}],"source_content_type":"text/x-python","patch_set":12,"id":"1f493fa4_6551f162","line":1143,"range":{"start_line":1143,"start_character":47,"end_line":1143,"end_character":48},"updated":"2020-04-24 19:47:00.000000000","message":"b... what?","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"15c8e39ebda9f6cdd5fb4c649bd6ee1a1227235e","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"    \"\"\""},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def error(node, port, vif, port_use):"},{"line_number":1150,"context_line":"        msg \u003d _(\"Cannot delete the port %(port)s from node %(node)s \""},{"line_number":1151,"context_line":"                \"as an ironic internal VIF is attached for \""},{"line_number":1152,"context_line":"                \"%(port_use)s VIF \""},{"line_number":1153,"context_line":"                \"%(vif)s attached to it. Please move the node to \""},{"line_number":1154,"context_line":"                \"a stable provision state and remove attached VIFs \""},{"line_number":1155,"context_line":"                \"before proceeding.\")"},{"line_number":1156,"context_line":"        raise exception.InvalidState(msg % {\u0027node\u0027: node.uuid,"},{"line_number":1157,"context_line":"                                            \u0027port\u0027: port.uuid,"},{"line_number":1158,"context_line":"                                            \u0027vif\u0027: vif,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f493fa4_45d2f5d3","line":1155,"range":{"start_line":1150,"start_character":0,"end_line":1155,"end_character":37},"updated":"2020-04-24 19:47:00.000000000","message":"This message is too specific for a function called get_attached_vif. Seems like this function should return the VIF id and port_use, then the caller can form an error message.","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"15c8e39ebda9f6cdd5fb4c649bd6ee1a1227235e","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"                                            \u0027port_use\u0027: port_use})"},{"line_number":1160,"context_line":"    # This loops through the entire list just to be on the safe side"},{"line_number":1161,"context_line":"    # and make this method generally more usable."},{"line_number":1162,"context_line":"    for port_like_obj in task.ports + task.portgroups:"},{"line_number":1163,"context_line":"        if port_like_obj.uuid !\u003d port.uuid:"},{"line_number":1164,"context_line":"            continue"},{"line_number":1165,"context_line":"        tenant_vif \u003d port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f493fa4_45eb1578","line":1162,"range":{"start_line":1162,"start_character":3,"end_line":1162,"end_character":54},"updated":"2020-04-24 19:47:00.000000000","message":"I don\u0027t follow why we\u0027re not just using the port object passed in.","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"952371124089903f1625d5d0de0bf7505f5a032e","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"        return (prov_vif, \u0027provisioning\u0027)"},{"line_number":1160,"context_line":"    rescue_vif \u003d port.internal_info.get(\u0027rescuing_vif_port_id\u0027)"},{"line_number":1161,"context_line":"    if rescue_vif:"},{"line_number":1162,"context_line":"        return (rescue_vif, \u0027rescuing\u0027)"},{"line_number":1163,"context_line":"    return (None, None)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_019a4512","line":1162,"updated":"2020-07-14 13:53:33.000000000","message":"missing inspection_vif_port_id","commit_id":"64674bf0ed966c3e8f241d555b772f03e7407951"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"0ef9d7414cb5bf9d07cb2cf3dea46552e2556070","unresolved":false,"context_lines":[{"line_number":1159,"context_line":"        return (prov_vif, \u0027provisioning\u0027)"},{"line_number":1160,"context_line":"    rescue_vif \u003d port.internal_info.get(\u0027rescuing_vif_port_id\u0027)"},{"line_number":1161,"context_line":"    if rescue_vif:"},{"line_number":1162,"context_line":"        return (rescue_vif, \u0027rescuing\u0027)"},{"line_number":1163,"context_line":"    return (None, None)"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf51134e_214e6996","line":1162,"in_reply_to":"bf51134e_019a4512","updated":"2020-07-14 13:57:18.000000000","message":"doh, I started this over a year ago, so yeah. :(","commit_id":"64674bf0ed966c3e8f241d555b772f03e7407951"}],"ironic/drivers/base.py":[{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_2ea476b8","line":1335,"range":{"start_line":1335,"start_character":8,"end_line":1335,"end_character":32},"updated":"2019-11-22 12:12:11.000000000","message":"Could just be get_current_vifs()?","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_b8442c1a","line":1335,"range":{"start_line":1335,"start_character":8,"end_line":1335,"end_character":32},"in_reply_to":"3fa7e38b_2ea476b8","updated":"2019-12-11 18:20:21.000000000","message":"There is a get_current_vif(), so pluralizing it may... or may not make sense. I\u0027m not sure to be honest.","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a965cb0514e1e07639acc7c64b51c8e6f27f7d3d","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_b8fd0c3c","line":1335,"range":{"start_line":1335,"start_character":8,"end_line":1335,"end_character":32},"in_reply_to":"3fa7e38b_b8442c1a","updated":"2019-12-11 18:22:55.000000000","message":"Yeah, having both get_current_vifs and get_current_vif will get confusing.","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"606cc147c2addcfd03ad053bcea015baefeb94c4","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_f8b5c47d","line":1335,"range":{"start_line":1335,"start_character":8,"end_line":1335,"end_character":32},"in_reply_to":"3fa7e38b_b8fd0c3c","updated":"2019-12-11 18:24:47.000000000","message":"mkrai put a note into merge the methods, and maybe that makes sense at some point. I dunno. ETOOMANYTHINGS","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"},{"line_number":1339,"context_line":"        cleaning_vif_port_id means we\u0027re doing cleaning,"},{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant network"},{"line_number":1343,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_6e882e6a","line":1340,"range":{"start_line":1340,"start_character":8,"end_line":1340,"end_character":10},"updated":"2019-11-22 12:12:11.000000000","message":"or","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":1339,"context_line":"        cleaning_vif_port_id means we\u0027re doing cleaning,"},{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant network"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        :param task: A TaskManager instance."},{"line_number":1345,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_2eec7627","line":1342,"range":{"start_line":1342,"start_character":8,"end_line":1342,"end_character":17},"updated":"2019-11-22 12:12:11.000000000","message":"Let\u0027s document the key name","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"        :param task: A TaskManager instance."},{"line_number":1345,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":1346,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":1347,"context_line":"        \"\"\""},{"line_number":1348,"context_line":""},{"line_number":1349,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_0e609aa4","line":1346,"range":{"start_line":1346,"start_character":60,"end_line":1346,"end_character":68},"updated":"2019-11-22 12:12:11.000000000","message":"Might be cleaner to return an empty dict?","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"be33a2a895c74d47c6632fe44cea28b08786e581","unresolved":false,"context_lines":[{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":1347,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":1348,"context_line":"        \"\"\""},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_c0fdb43b","line":1347,"range":{"start_line":1347,"start_character":60,"end_line":1347,"end_character":68},"updated":"2020-01-02 15:00:02.000000000","message":"Not None any more.","commit_id":"5ba0780c118c397ca4ddcf59b2a9784220b9906d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"acdb5604fc81294ae5877aa0f3f49b31d060c5be","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_f3a2ecac","line":1335,"updated":"2020-01-06 19:18:23.000000000","message":"We\u0027re adding a new driver API here, so apologies for nit-picking, but after it lands, it\u0027ll be more difficult to change.\n\nThis is returning a dictionary, so get_current_vifs() makes more sense. Except... do we actually have cases where there is more than one (type of) VIF associated with a port?\n\nBy \u0027tag\u0027, we mean keyed in the dictionary, right?","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e7fa46e2bbd71c0385223306d354702a560cb6c6","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"        \"\"\""},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"    @abc.abstractmethod"},{"line_number":1335,"context_line":"    def get_current_vif_with_tag(self, task, p_obj):"},{"line_number":1336,"context_line":"        \"\"\"Returns VIFs with tag associated with port or portgroup"},{"line_number":1337,"context_line":""},{"line_number":1338,"context_line":"        We are booting the node only in one network at a time, and presence of"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_09e08d26","line":1335,"in_reply_to":"3fa7e38b_f3a2ecac","updated":"2020-01-09 11:57:09.000000000","message":"get_current_vifs was my preference too. There were reasonable arguments against it.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"acdb5604fc81294ae5877aa0f3f49b31d060c5be","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant_vif_port_id indicating it is for"},{"line_number":1343,"context_line":"        the instance\u0027s networking."},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_1edc6f6f","line":1343,"updated":"2020-01-06 19:18:23.000000000","message":"I was wondering. If there is only max one VIF associated with a port at any given time, then really, if the node isn\u0027t in some clean/provision/rescue state, it\u0027ll be the tenant VIF? Having said that, it seems like a PITA to code \u0027if node.state is clean*, deploy*, rescuing*\u0027 if the info is already there in the port\u0027s internal info.\n\nWould \u0027get_current_vif_and_use()\u0027 which returns a tuple: (vid_id, use) work? where use could be one of None, \u0027cleaning\u0027, \u0027rescuing\u0027, \u0027provisioning\u0027, \u0027tenant\u0027.\n\nI\u0027m not totally against returning a dictionary; I\u0027m just wondering whether it makes sense. (Where \u0027makes sense\u0027 means the possibility of there being more than one VIF).","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e7fa46e2bbd71c0385223306d354702a560cb6c6","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant_vif_port_id indicating it is for"},{"line_number":1343,"context_line":"        the instance\u0027s networking."},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_a95619cc","line":1343,"in_reply_to":"3fa7e38b_1edc6f6f","updated":"2020-01-09 11:57:09.000000000","message":"We may have multiple items in the dict - during provisioning we could have a tenant port and a provisioning port. At most one should be bound at any time though, and if there is a cleaning/provisioning/rescuing port then that will be the active one rather than the tenant port.\n\nReturning the one active port here makes sense to me. We already have a method to get the VIF ID - we could just add another to return it\u0027s type: get_current_vif_(type|tag|something). This could hide the tag name (which has changed in the past) from the caller, and just return cleaning/provisioning/rescusing/inspection/tenant.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"a2dcd622c1626f42189128fe14b3f971811b6adf","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant_vif_port_id indicating it is for"},{"line_number":1343,"context_line":"        the instance\u0027s networking."},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_4a0bd020","line":1343,"in_reply_to":"3fa7e38b_9507aa70","updated":"2020-01-09 17:14:54.000000000","message":"ah.... it is coming back to me. So... we need to know if there are any VIFs associated with this port. There could be more than one VIF, but there is at most one VIF that is (currently) bound. 1. if there is a tenant VIF associated with this port we want the user to do a vif-detach (else can\u0027t delete port). 2. or if there is some non-tenant VIF then we need to wait for operation to finish before we can delete the port.\n\nThe info we need is in this returned dict. Ok, that makes sense. What I\u0027d like is for this method name and description to change, because it doesn\u0027t reflect what I think it is meant to. Does the term \u0027current\u0027 mean the VIF that is currently bound to the port? If so, then I would suggest get_vifs(self, task, p_obj). With a description that reflects what is in the dictionary.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"38bdbe4f2def22b94fc0e7b4ac96cc4bd5acce25","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant_vif_port_id indicating it is for"},{"line_number":1343,"context_line":"        the instance\u0027s networking."},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_b580a6f7","line":1343,"in_reply_to":"3fa7e38b_a95619cc","updated":"2020-01-09 15:54:49.000000000","message":"Ah. The code in manager.py will check if there is a tenant VIF, so if there is another port that is actually bound, the error msg will be incorrect. So I\u0027d prefer returning a tuple that reflects the active port.\n\nNote that I don\u0027t like \u0027tag\u0027 since we were going to add a \u0027tag\u0027 feature (or did we finish adding it?) that is a different \u0027tag\u0027 than this. \u0027type\u0027 is overloaded so why not overload it a bit more :) \u0027get_current_vif_and_type()\u0027 ?","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"0b64ac5e9fc44fcbfb7c57c852428ec14c45db51","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"        of provisioning_vif_port_id - provisioning,"},{"line_number":1341,"context_line":"        of rescuing_vif_port_id - rescuing."},{"line_number":1342,"context_line":"        Otherwise it\u0027s a tenant_vif_port_id indicating it is for"},{"line_number":1343,"context_line":"        the instance\u0027s networking."},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_9507aa70","line":1343,"in_reply_to":"3fa7e38b_b580a6f7","updated":"2020-01-09 16:01:06.000000000","message":"Hmm, now that you mention it, I think the logic in manager.py is correct right now - the tenant VIF is something that the user can do something about (remove the port, delete the instance) so that info should take precedence. Ironic internal ports (cleaning etc) are mostly a case of \u0027wait for state transition to complete\u0027.\n\nGiven all that, simply returning the bound port is insufficient.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"acdb5604fc81294ae5877aa0f3f49b31d060c5be","unresolved":false,"context_lines":[{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        :param task: A TaskManager instance."},{"line_number":1346,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":1347,"context_line":"        :returns: dictionary of VIF ID associated with p_obj."},{"line_number":1348,"context_line":"        \"\"\""},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_b381d4fc","line":1347,"updated":"2020-01-06 19:18:23.000000000","message":"I think we should be explicit here about what the dictionary keys are: \u0027cleaning_vif_port_id\u0027, \u0027provisioning_vif_port_id\u0027, \u0027rescuing_vif_port_id\u0027, \u0027tenant_vif_port_id\u0027. (I guess we don\u0027t want to just do \u0027cleaning\u0027, \u0027provisioning\u0027, \u0027rescuing\u0027, \u0027tenant\u0027? I\u0027m fine with what is there, just thought I\u0027d ask).","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"}],"ironic/drivers/modules/network/common.py":[{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":414,"context_line":"            \"rescuing_vif_port_id\": p_obj.internal_info.get("},{"line_number":415,"context_line":"                \u0027rescuing_vif_port_id\u0027),"},{"line_number":416,"context_line":"            \"tenant_vif_port_id\": self._get_vif_id_by_port_like_obj(p_obj)}"},{"line_number":417,"context_line":"        return vifs"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"class NeutronVIFPortIDMixin(VIFPortIDMixin):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_4e50d2d5","line":417,"range":{"start_line":417,"start_character":15,"end_line":417,"end_character":19},"updated":"2019-11-22 12:12:11.000000000","message":"Should we remove keys where the item is None?\n\nreturn {k: v for k, v in vifs.items() if v}","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":414,"context_line":"            \"rescuing_vif_port_id\": p_obj.internal_info.get("},{"line_number":415,"context_line":"                \u0027rescuing_vif_port_id\u0027),"},{"line_number":416,"context_line":"            \"tenant_vif_port_id\": self._get_vif_id_by_port_like_obj(p_obj)}"},{"line_number":417,"context_line":"        return vifs"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"class NeutronVIFPortIDMixin(VIFPortIDMixin):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_1889c024","line":417,"range":{"start_line":417,"start_character":15,"end_line":417,"end_character":19},"in_reply_to":"3fa7e38b_4e50d2d5","updated":"2019-12-11 18:20:21.000000000","message":"Makes sense I guess.","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"be33a2a895c74d47c6632fe44cea28b08786e581","unresolved":false,"context_lines":[{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        :param task: A TaskManager instance."},{"line_number":405,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":406,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":407,"context_line":"        \"\"\""},{"line_number":408,"context_line":"        # TODO(mkrai): Merge this method with `get_current_vif`"},{"line_number":409,"context_line":"        vifs \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_209288fd","line":406,"range":{"start_line":406,"start_character":60,"end_line":406,"end_character":68},"updated":"2020-01-02 15:00:02.000000000","message":"ditto","commit_id":"5ba0780c118c397ca4ddcf59b2a9784220b9906d"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"acdb5604fc81294ae5877aa0f3f49b31d060c5be","unresolved":false,"context_lines":[{"line_number":414,"context_line":"            \"rescuing_vif_port_id\": p_obj.internal_info.get("},{"line_number":415,"context_line":"                \u0027rescuing_vif_port_id\u0027),"},{"line_number":416,"context_line":"            \"tenant_vif_port_id\": self._get_vif_id_by_port_like_obj(p_obj)}"},{"line_number":417,"context_line":"        return {k: v for k, v in vifs.items() if v}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"class NeutronVIFPortIDMixin(VIFPortIDMixin):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_7066f257","line":417,"updated":"2020-01-06 19:18:23.000000000","message":"Do we actually have cases where there is more than one VIF associated with a port? If not -- a followup could be to change this so that we return a tuple: the VIF and VIF-type.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e7fa46e2bbd71c0385223306d354702a560cb6c6","unresolved":false,"context_lines":[{"line_number":414,"context_line":"            \"rescuing_vif_port_id\": p_obj.internal_info.get("},{"line_number":415,"context_line":"                \u0027rescuing_vif_port_id\u0027),"},{"line_number":416,"context_line":"            \"tenant_vif_port_id\": self._get_vif_id_by_port_like_obj(p_obj)}"},{"line_number":417,"context_line":"        return {k: v for k, v in vifs.items() if v}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"class NeutronVIFPortIDMixin(VIFPortIDMixin):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_a90b79d1","line":417,"in_reply_to":"3fa7e38b_7066f257","updated":"2020-01-09 11:57:09.000000000","message":"Commented elsewhere.","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"}],"ironic/drivers/modules/network/noop.py":[{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"2c81ca8cbe8e29b1cf514e60fc6e073cafa23d30","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":92,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        pass"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def add_provisioning_network(self, task):"},{"line_number":97,"context_line":"        \"\"\"Add the provisioning network to a node."}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_ae6e2693","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":12},"updated":"2019-11-22 12:12:11.000000000","message":"or:\n\nreturn {}","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"469dfd13678f0bdd970bab2930aad8342c772a03","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":92,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        pass"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def add_provisioning_network(self, task):"},{"line_number":97,"context_line":"        \"\"\"Add the provisioning network to a node."}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_38911c47","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":12},"in_reply_to":"3fa7e38b_ae6e2693","updated":"2019-12-11 18:20:21.000000000","message":"Done","commit_id":"ba23e3f3eefaff99213b37ae9645669a6611afcf"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"be33a2a895c74d47c6632fe44cea28b08786e581","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        :param task: A TaskManager instance."},{"line_number":91,"context_line":"        :param p_obj: Ironic port or portgroup object."},{"line_number":92,"context_line":"        :returns: dictionary of VIF ID associated with p_obj or None."},{"line_number":93,"context_line":"        \"\"\""},{"line_number":94,"context_line":"        return {}"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3fa7e38b_409784ec","line":92,"range":{"start_line":92,"start_character":60,"end_line":92,"end_character":68},"updated":"2020-01-02 15:00:02.000000000","message":"ditto","commit_id":"5ba0780c118c397ca4ddcf59b2a9784220b9906d"}],"ironic/tests/unit/conductor/test_manager.py":[{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"9282c0eacaebebcdea3bd27755dd879cdd0f9fb5","unresolved":false,"context_lines":[{"line_number":8059,"context_line":"                                          maintenance\u003dTrue)"},{"line_number":8060,"context_line":"        port \u003d obj_utils.create_test_port(self.context,"},{"line_number":8061,"context_line":"                                          node_id\u003dnode.id)"},{"line_number":8062,"context_line":"        self.service.destroy_port(self.context, port)"},{"line_number":8063,"context_line":"        self.assertRaises(exception.PortNotFound,"},{"line_number":8064,"context_line":"                          self.dbapi.get_port_by_uuid,"},{"line_number":8065,"context_line":"                          port.uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_11be23ff","line":8062,"updated":"2019-06-19 04:21:17.000000000","message":"Can we add test \"test_destroy_port_node_not_active_and_maintenance_vif_present\"?","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"5375a6e163f96163d9fe93908793560063cb5a4b","unresolved":false,"context_lines":[{"line_number":8059,"context_line":"                                          maintenance\u003dTrue)"},{"line_number":8060,"context_line":"        port \u003d obj_utils.create_test_port(self.context,"},{"line_number":8061,"context_line":"                                          node_id\u003dnode.id)"},{"line_number":8062,"context_line":"        self.service.destroy_port(self.context, port)"},{"line_number":8063,"context_line":"        self.assertRaises(exception.PortNotFound,"},{"line_number":8064,"context_line":"                          self.dbapi.get_port_by_uuid,"},{"line_number":8065,"context_line":"                          port.uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_94fdeeb2","line":8062,"in_reply_to":"9fb8cfa7_11be23ff","updated":"2019-06-21 13:23:29.000000000","message":"I guess we can, but there seems to be a disagreement about maintenance.","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"}],"releasenotes/notes/prevent-ports-with-vif-deletion-3edac3df5aa1becf.yaml":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"4a4ed8a7c115c25bc4b113d4cb1424c2be21a787","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"7faddb67_15e3f706","line":8,"updated":"2019-08-16 18:15:59.000000000","message":"It looks like this is a bug that we\u0027re trying to fix. But that some people have leveraged as the-way-things-work. (And based on the discussion, there are other places that we ought to fix, but that\u0027s a different patch...)\n\nI think we should have a story for this, maybe a 2nd story or in the same story, capture Kaifeng\u0027s use case/argument. And maybe be a bit more explicit here about the bug cuz this will change behaviour.\n\neg, \"It now prevents ports from being deleted if there is a VIF attachment.\"","commit_id":"343143c4e6ee1acbfaf8d918f5b13120d2bb3299"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"acdb5604fc81294ae5877aa0f3f49b31d060c5be","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixes logic that is applied to port deletions to also consider the"},{"line_number":5,"context_line":"    presence of a VIF attachment record, which should be removed before"},{"line_number":6,"context_line":"    attempting to delete the node. Failure to do so can result in"},{"line_number":7,"context_line":"    erroneous records in the Networking Service."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"3fa7e38b_feb71321","line":5,"updated":"2020-01-06 19:18:23.000000000","message":"s/should/must/","commit_id":"4e4552ffd88d646ee14c5242ce3b571b75af7be1"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"bc35418c7e67ad03f2be74c8286ffb053b7f959f","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Fixes logic that is applied to port deletions to also consider the"},{"line_number":5,"context_line":"    presence of a VIF attachment record, which should be removed before"},{"line_number":6,"context_line":"    attempting to delete the node. Failure to do so can result in"},{"line_number":7,"context_line":"    erroneous records in the Networking Service."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"3f4c43b2_c7aa666f","line":7,"updated":"2020-04-20 14:44:12.000000000","message":"nit. We could add a link to the story, although I don\u0027t know if the story itself has more info about this change; I didn\u0027t look ;)","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ae430b0e5fee60a9126520a3e97acddab5151abe","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Fixes logic that is applied to port deletions to also consider the"},{"line_number":5,"context_line":"    presence of a VIF attachment record, which should be removed before"},{"line_number":6,"context_line":"    attempting to delete the node. Failure to do so can result in"},{"line_number":7,"context_line":"    erroneous records in the Networking Service."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"1f493fa4_19121ab2","line":7,"in_reply_to":"3f4c43b2_c7aa666f","updated":"2020-04-24 17:05:25.000000000","message":"We\u0027ve really fallen down on that in general, and I agree we likely should, but also I hope that the errors provide enough guidance should somebody go \"what?!?\"\n :)","commit_id":"03acd1b8f3bf05f7f6772635f29c91b553acb58c"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"226315db801f414899773c48d094f340b4a072d0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"bf51134e_ec84e80e","line":8,"updated":"2020-06-18 07:23:18.000000000","message":"nit: can be useful to add a reference to the story in the release note","commit_id":"64674bf0ed966c3e8f241d555b772f03e7407951"}]}
