)]}'
{"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"957033a491c987663668cb2dcd0a9710c8ad3cb8","unresolved":false,"context_lines":[{"line_number":1163,"context_line":"                raise q_exc.SubnetInUse(subnet_id\u003did)"},{"line_number":1164,"context_line":""},{"line_number":1165,"context_line":"            # remove network owned ports"},{"line_number":1166,"context_line":"            for allocation in allocated:"},{"line_number":1167,"context_line":"                port_id \u003d allocation.port_id"},{"line_number":1168,"context_line":"                port \u003d self._get_port(context, port_id) if port_id else None"},{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FYPc%3D","line":1166,"updated":"2013-01-24 19:55:20.000000000","message":"Consider replacing lines 1167-1174 with:\n\nfor port in [a.ports for a in allocated]:\n    context.session.delete(port)","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"ab65e6b08d1150ab62e23f756c2ad92cf3054b64","unresolved":false,"context_lines":[{"line_number":1163,"context_line":"                raise q_exc.SubnetInUse(subnet_id\u003did)"},{"line_number":1164,"context_line":""},{"line_number":1165,"context_line":"            # remove network owned ports"},{"line_number":1166,"context_line":"            for allocation in allocated:"},{"line_number":1167,"context_line":"                port_id \u003d allocation.port_id"},{"line_number":1168,"context_line":"                port \u003d self._get_port(context, port_id) if port_id else None"},{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FWGM%3D","line":1166,"in_reply_to":"AAAAM3%2F%2FYPc%3D","updated":"2013-01-27 17:26:41.000000000","message":"I was worried about the case where a.port_id is unset. It is specifically set to nullable, and it is checked for in the only_auto_del variable setting. So, in that case I would expect port to not be set for some reason (that eludes mes). If that were the case, a.ports would possibly be None, and context.session.delete(port) would make no sense--and also the IPAllocation would not be deleted. So, I decided to make it a little more verbose and specifically delete the port if it exists, and if it doesn\u0027t fall back to the existing behavior of just deleting the IPAllocation.\n\nHave I messed up the logic here? I\u0027m relatively new to the code so it is a distinct possibility.","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FXao%3D","line":1172,"updated":"2013-01-25 11:27:57.000000000","message":"In (rare) cases where multiple subnets are configured for a network, this will remove the network-owned port even if there are still other subnets on the network, thus probably preventing correct functioning of the other subnet (you\u0027ll probably lose DHCP for instance).\nhttp://paste.openstack.org/show/29821/","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FSeI%3D","line":1172,"in_reply_to":"AAAAM3%2F%2FSfI%3D","updated":"2013-01-30 03:36:15.000000000","message":"Ah sorry, my comment is invalid.\nMy point was the case network has a dhcp enabled subnet and dhcp disabled subnet, the port should not be deleted.\nHowever no port is needed for dhcp disabled subnet","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FSfI%3D","line":1172,"in_reply_to":"AAAAM3%2F%2FSwk%3D","updated":"2013-01-30 03:27:12.000000000","message":"The subnet is being deleted in line 1176.  Why do we need to set enable_dhcp to False?","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FSwk%3D","line":1172,"in_reply_to":"AAAAM3%2F%2FV7s%3D","updated":"2013-01-29 23:29:29.000000000","message":"Also we can disable dhcp by setting enable_dhcp\u003dFalse","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FV7s%3D","line":1172,"in_reply_to":"AAAAM3%2F%2FWGQ%3D","updated":"2013-01-28 07:49:42.000000000","message":"I might be wrong because this is not my principal are of expertise. However, the DHCP ports are created in the get_dhcp_port method quantum.db.dhcp_rpc_base.DhcpRpcCallbackMixin.\n\nIt seems the logic of that method reuses a dhcp port if available, and adds a new fixed_ip for each additional subnet. This seems to be confirmed from the quick experiment I did.","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"ab65e6b08d1150ab62e23f756c2ad92cf3054b64","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"                # If the port was set and deleted, it will cascade to the"},{"line_number":1170,"context_line":"                # allocation, otherwise delete it directly"},{"line_number":1171,"context_line":"                if port:"},{"line_number":1172,"context_line":"                    context.session.delete(port)"},{"line_number":1173,"context_line":"                else:"},{"line_number":1174,"context_line":"                    context.session.delete(allocation)"},{"line_number":1175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FWGQ%3D","line":1172,"in_reply_to":"AAAAM3%2F%2FXao%3D","updated":"2013-01-27 17:26:41.000000000","message":"If multiple subnets are created, there is a DHCP port created for each subnet as far as I can tell. If you delete the port that is related to a particular subnet, you aren\u0027t touching the other one.\n\nExample:\nquantum net-create net1\nquantum subnet-create net1 10.1.0.0/24 --name subnet1\nquantum subnet-create net1 10.2.0.0/24 --name subnet2\nquantum port-list\n\n--------------------------------------------------------------------+\n| id                                   | name | mac_address       | fixed_ips                                                                       |\n+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+\n| 24952893-7a8b-4fea-a6c4-a0c2667a9b2e |      | fa:16:3e:b3:08:c2 | {\"subnet_id\": \"afdac03f-c4b4-4582-b9d5-6e4e7918a7cf\", \"ip_address\": \"10.1.0.2\"} |\n|                                      |      |                   | {\"subnet_id\": \"908c6505-f090-4911-94d4-510709db4122\", \"ip_address\": \"10.2.0.2\"} |\n+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+\n\nSince this is in the subnet_delete and we are only deleting ports where the subnet_id matches, wouldn\u0027t this be safe in the above situation?","commit_id":"9bd934b4d39192ac9fc11f4a81230b80cae980c6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1165,"context_line":"            # remove network owned ports"},{"line_number":1166,"context_line":"            for allocation in allocated:"},{"line_number":1167,"context_line":"                port_id \u003d allocation.port_id"},{"line_number":1168,"context_line":"                num_allocs \u003d allocated_qry.filter_by(port_id\u003dport_id).count()"},{"line_number":1169,"context_line":"                port \u003d self._get_port(context, port_id) if port_id else None"},{"line_number":1170,"context_line":"                if port and num_allocs \u003c 2:"},{"line_number":1171,"context_line":"                    context.session.delete(port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bs0M%3D","line":1168,"updated":"2013-02-21 06:41:30.000000000","message":"Consider reading the port iff num_allocs is \u003c 2. This will save an access on the database","commit_id":"4492de8212600f79b80b4f66e78c14ab62183300"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"ab65e6b08d1150ab62e23f756c2ad92cf3054b64","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"            # remove network owned ports"},{"line_number":1166,"context_line":"            for allocation in allocated:"},{"line_number":1167,"context_line":"                port_id \u003d allocation.port_id"},{"line_number":1168,"context_line":"                num_allocs \u003d allocated_qry.filter_by(port_id\u003dport_id).count()"},{"line_number":1169,"context_line":"                port \u003d self._get_port(context, port_id) if port_id else None"},{"line_number":1170,"context_line":"                if port and num_allocs \u003c 2:"},{"line_number":1171,"context_line":"                    context.session.delete(port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BrMw%3D","line":1168,"in_reply_to":"AAAAM3%2F%2Bs0M%3D","updated":"2013-02-21 23:15:05.000000000","message":"Done","commit_id":"4492de8212600f79b80b4f66e78c14ab62183300"}],"quantum/db/l3_db.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":750,"context_line":"                LOG.debug(_(\"Port %(port_id)s has owner %(port_owner)s, but \""},{"line_number":751,"context_line":"                            \"no IP address, so it can be deleted\"),"},{"line_number":752,"context_line":"                          {\u0027port_id\u0027: port_db[\u0027id\u0027],"},{"line_number":753,"context_line":"                           \u0027port_owner\u0027: port_db[\u0027device_owner\u0027]})"},{"line_number":754,"context_line":""},{"line_number":755,"context_line":"    def disassociate_floatingips(self, context, port_id):"},{"line_number":756,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAN3%2F%2F%2FCY%3D","line":753,"updated":"2013-03-04 17:24:18.000000000","message":"750-753 is not covered by unit tests.\nProbably it might be good adding one.","commit_id":"fb9e2288eb4ec401e2f9b604809bfad74749257a"}]}
