)]}'
{"$instances_path/aaa.info":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d94f44ee97c832e0befb50ff71656538a23760e7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{\"sha1\": \"57fd7a360e522824f72044376de9bf3506b5922f\", \"sha1-timestamp\": 1391431963.913543}"}],"source_content_type":"application/octet-stream","patch_set":13,"id":"AAAAUX%2F%2Fofk%3D","line":1,"updated":"2014-02-11 21:36:46.000000000","message":"whooop!","commit_id":"809bb59b95fa4f6b78cbebe7d9b08d6a0ecb264f"}],"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c2aaa8475b7e4b2cf5bd6c8f0ebfb367cc4d5b6c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"nova list (through the periodic heal task)."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request timesout (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"},{"line_number":19,"context_line":"neutron again to create a port. In this case two ports will show"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"AAAAUX%2F%2B01w%3D","line":16,"updated":"2014-02-18 19:48:55.000000000","message":"\"times out\"","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"nova list (through the periodic heal task)."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request timesout (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"},{"line_number":19,"context_line":"neutron again to create a port. In this case two ports will show"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"AAAAUX%2F%2Bz5g%3D","line":16,"in_reply_to":"AAAAUX%2F%2B01w%3D","updated":"2014-02-19 00:15:32.000000000","message":"Done","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"221b319db1d5b960fc43f72949ea9911b6584493","unresolved":false,"context_lines":[{"line_number":12,"context_line":"of their existing instance_ids that port will eventually show up in"},{"line_number":13,"context_line":"nova list (through the periodic heal task)."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request times out (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"AAAAVn%2F%2Fn%2Fs%3D","line":15,"updated":"2014-03-05 00:36:20.000000000","message":"grammer nit: it\u0027s \u003d\u003e its","commit_id":"bef5ce26273b05cb455a8429cdbc60de180ee64f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6493d494a9f1b51901386c013d1b7ac857f19847","unresolved":false,"context_lines":[{"line_number":12,"context_line":"of their existing instance_ids that port will eventually show up in"},{"line_number":13,"context_line":"nova list (through the periodic heal task)."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request times out (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"AAAAVn%2F%2Fn1g%3D","line":15,"in_reply_to":"AAAAVn%2F%2Fn%2Fs%3D","updated":"2014-03-05 01:00:38.000000000","message":"Leaving as it\u0027s unless there are other comments that need to be addressed.","commit_id":"bef5ce26273b05cb455a8429cdbc60de180ee64f"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"221b319db1d5b960fc43f72949ea9911b6584493","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request times out (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"},{"line_number":19,"context_line":"neutron again to create a port. In this case two ports will show"},{"line_number":20,"context_line":"up in the network_cache table (since they have the same instance_id) though"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"AAAAVn%2F%2Fn%2FE%3D","line":17,"updated":"2014-03-05 00:36:20.000000000","message":"why does the request timeout?","commit_id":"bef5ce26273b05cb455a8429cdbc60de180ee64f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6493d494a9f1b51901386c013d1b7ac857f19847","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This problem usually manifests it\u0027s self when nova-compute"},{"line_number":16,"context_line":"calls to neutron to create a port and the request times out (though"},{"line_number":17,"context_line":"the port is actually created in neutron). When this occurs the instance"},{"line_number":18,"context_line":"can be rescheduled on another compute node which it will call out to"},{"line_number":19,"context_line":"neutron again to create a port. In this case two ports will show"},{"line_number":20,"context_line":"up in the network_cache table (since they have the same instance_id) though"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"AAAAVn%2F%2Fn1o%3D","line":17,"in_reply_to":"AAAAVn%2F%2Fn%2FE%3D","updated":"2014-03-05 01:00:38.000000000","message":"could be a number of reasons. Neutron ends up stuck in some deadlock state, neutron takes to long to respond and the python-neutronclient timeout, httplib2 reties internally fixed here - (https://review.openstack.org/#/c/65840/)","commit_id":"bef5ce26273b05cb455a8429cdbc60de180ee64f"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"051545c717467fee50c2b53c88a32dac4c61b6c9","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                            port_client, instance, network_id,"},{"line_number":330,"context_line":"                            port_req_body, fixed_ips.get(network_id),"},{"line_number":331,"context_line":"                            security_group_ids, available_macs, dhcp_opts))"},{"line_number":332,"context_line":"                    ports_in_requested_net_order.append(created_port_ids[-1])"},{"line_number":333,"context_line":"            except Exception:"},{"line_number":334,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":335,"context_line":"                    for port_id in touched_port_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tXM%3D","line":332,"updated":"2013-12-06 21:38:04.000000000","message":"This looks really clumsy to me.  Why not just get the return value form _create_port into a variable and then append it to both lists.  It would be a lot more obvious in the code","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3674d8773ca076f9971d9d9460c4786fbda43034","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                            port_client, instance, network_id,"},{"line_number":330,"context_line":"                            port_req_body, fixed_ips.get(network_id),"},{"line_number":331,"context_line":"                            security_group_ids, available_macs, dhcp_opts))"},{"line_number":332,"context_line":"                    ports_in_requested_net_order.append(created_port_ids[-1])"},{"line_number":333,"context_line":"            except Exception:"},{"line_number":334,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":335,"context_line":"                    for port_id in touched_port_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tIE%3D","line":332,"in_reply_to":"AAAATn%2F9tXM%3D","updated":"2013-12-06 22:20:40.000000000","message":"Sure I can do that.","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"051545c717467fee50c2b53c88a32dac4c61b6c9","unresolved":false,"context_lines":[{"line_number":992,"context_line":"                       \u0027device_id\u0027: instance[\u0027uuid\u0027], }"},{"line_number":993,"context_line":"        client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":994,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":995,"context_line":"        updated_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":996,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tTk%3D","line":995,"updated":"2013-12-06 21:38:04.000000000","message":"I\u0027m finding the naming in here makes this very confusing to follow:\n\nupdated_ports seems to be a list of port objects, but its not clear in what sense they are updated\n\nports seems to be just a list of ids - at least that\u0027s how it seems to be used","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3674d8773ca076f9971d9d9460c4786fbda43034","unresolved":false,"context_lines":[{"line_number":992,"context_line":"                       \u0027device_id\u0027: instance[\u0027uuid\u0027], }"},{"line_number":993,"context_line":"        client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":994,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":995,"context_line":"        updated_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":996,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":997,"context_line":""},{"line_number":998,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tHs%3D","line":995,"in_reply_to":"AAAATn%2F9tTk%3D","updated":"2013-12-06 22:20:40.000000000","message":"updated_ports are the latest port values from neutron. \n\nright ports is a list of ports being attached to the instance.","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"051545c717467fee50c2b53c88a32dac4c61b6c9","unresolved":false,"context_lines":[{"line_number":1021,"context_line":"            ports \u003d [iface[\u0027id\u0027] for iface in ifaces] + ports"},{"line_number":1022,"context_line":"        for port in ports:"},{"line_number":1023,"context_line":"            for updated_port in updated_ports:"},{"line_number":1024,"context_line":"                if port \u003d\u003d updated_port[\u0027id\u0027]:"},{"line_number":1025,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client, updated_port)"},{"line_number":1026,"context_line":"                    subnets \u003d self._nw_info_get_subnets(context, updated_port,"},{"line_number":1027,"context_line":"                                                        network_IPs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tWI%3D","line":1024,"updated":"2013-12-06 21:38:04.000000000","message":"Can you not do something like \n\n   if updated_port \u003d updated_ports.get(port):\n\ninstead of looping through updated_ports each time ?","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3674d8773ca076f9971d9d9460c4786fbda43034","unresolved":false,"context_lines":[{"line_number":1021,"context_line":"            ports \u003d [iface[\u0027id\u0027] for iface in ifaces] + ports"},{"line_number":1022,"context_line":"        for port in ports:"},{"line_number":1023,"context_line":"            for updated_port in updated_ports:"},{"line_number":1024,"context_line":"                if port \u003d\u003d updated_port[\u0027id\u0027]:"},{"line_number":1025,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client, updated_port)"},{"line_number":1026,"context_line":"                    subnets \u003d self._nw_info_get_subnets(context, updated_port,"},{"line_number":1027,"context_line":"                                                        network_IPs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9tHQ%3D","line":1024,"in_reply_to":"AAAATn%2F9tWI%3D","updated":"2013-12-06 22:20:40.000000000","message":"nope, updated_ports is a list of port dicts() (the return from neutron port-list)","commit_id":"7f542f8e466c693400d481f49e1bed2dfab94a19"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"00b965c01945382f326dea21e5ea09f892dbcee3","unresolved":false,"context_lines":[{"line_number":998,"context_line":"        client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":999,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":"        # contains the updated list of neutron ports"},{"line_number":1002,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":1003,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1004,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9LfU%3D","line":1001,"updated":"2013-12-15 16:31:10.000000000","message":"Don\u0027t really understand what this comment is staying - updated in what sense ?","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3494d26e4c8e163afc0330b0f3d40ef34fe2299f","unresolved":false,"context_lines":[{"line_number":998,"context_line":"        client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":999,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":1000,"context_line":""},{"line_number":1001,"context_line":"        # contains the updated list of neutron ports"},{"line_number":1002,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":1003,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1004,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9GlQ%3D","line":1001,"in_reply_to":"AAAATn%2F9LfU%3D","updated":"2013-12-16 23:47:59.000000000","message":"If one updates the ip address on a port in neutron the old ip_address on the port will be displayed in nova. So this is the updated list of ports that contains the new updated value.","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"00b965c01945382f326dea21e5ea09f892dbcee3","unresolved":false,"context_lines":[{"line_number":1008,"context_line":"        else:"},{"line_number":1009,"context_line":"            ifaces \u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]"},{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        # This code path is only done when refreshing the network_cache"},{"line_number":1012,"context_line":"        if port_ids is None:"},{"line_number":1013,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces]"},{"line_number":1014,"context_line":"            networks \u003d self._get_available_networks(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9Lfg%3D","line":1011,"updated":"2013-12-15 16:31:10.000000000","message":"if feels like there is a lot of logic in here to detect where we\u0027ve been called from by looking for a null value to port_ids and network_ids.\n\nI think it would be clearer if that logic was separated out - i.e. those two paths call other methods first that extracts the port_ids from the cache as needed and then passes that into this common method, so that this code is always called with a list of port ids.","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3494d26e4c8e163afc0330b0f3d40ef34fe2299f","unresolved":false,"context_lines":[{"line_number":1008,"context_line":"        else:"},{"line_number":1009,"context_line":"            ifaces \u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]"},{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        # This code path is only done when refreshing the network_cache"},{"line_number":1012,"context_line":"        if port_ids is None:"},{"line_number":1013,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces]"},{"line_number":1014,"context_line":"            networks \u003d self._get_available_networks(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9GjU%3D","line":1011,"in_reply_to":"AAAATn%2F9Lfg%3D","updated":"2013-12-16 23:47:59.000000000","message":"I agree. I\u0027ll do that.","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"00b965c01945382f326dea21e5ea09f892dbcee3","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"                for iface in ifaces]"},{"line_number":1026,"context_line":""},{"line_number":1027,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":1028,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":"        for port_id in port_ids:"},{"line_number":1031,"context_line":"            for current_neutron_port in current_neutron_ports:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9LfI%3D","line":1028,"updated":"2013-12-15 16:31:10.000000000","message":"Does it matter that in the case of networks we add to the end of the list, but for posts we add to the start of the list ?","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3494d26e4c8e163afc0330b0f3d40ef34fe2299f","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"                for iface in ifaces]"},{"line_number":1026,"context_line":""},{"line_number":1027,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":1028,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":"        for port_id in port_ids:"},{"line_number":1031,"context_line":"            for current_neutron_port in current_neutron_ports:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F9Gjw%3D","line":1028,"in_reply_to":"AAAATn%2F9LfI%3D","updated":"2013-12-16 23:47:59.000000000","message":"Nope, the order of networks doesn\u0027t matter. In _nw_info_build_network() it searchers networks for port[\u0027network_id\u0027] to extract the network name.","commit_id":"29f84e856c032f441822ad948e0591fd541b8bd0"},{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"baf7db20815927858d32289926e91d4f3844639d","unresolved":false,"context_lines":[{"line_number":339,"context_line":""},{"line_number":340,"context_line":"                    for port_id in created_port_ids:"},{"line_number":341,"context_line":"                        try:"},{"line_number":342,"context_line":"                            neutron.delete_port(port_id)"},{"line_number":343,"context_line":"                        except Exception:"},{"line_number":344,"context_line":"                            msg \u003d _(\"Failed to delete port %s\")"},{"line_number":345,"context_line":"                            LOG.exception(msg, port_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B6mI%3D","line":342,"updated":"2014-01-20 19:41:15.000000000","message":"While not specific to this review, it occurs to me that a bulk delete would be fantastic here (e.g. delete_ports()). Making handling of exceptional scenarios as \"simple\" as possible would be a \"good thing\".","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e94022a07a0f3040fe1887396437c7415a3700b6","unresolved":false,"context_lines":[{"line_number":339,"context_line":""},{"line_number":340,"context_line":"                    for port_id in created_port_ids:"},{"line_number":341,"context_line":"                        try:"},{"line_number":342,"context_line":"                            neutron.delete_port(port_id)"},{"line_number":343,"context_line":"                        except Exception:"},{"line_number":344,"context_line":"                            msg \u003d _(\"Failed to delete port %s\")"},{"line_number":345,"context_line":"                            LOG.exception(msg, port_id)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B6QA%3D","line":342,"in_reply_to":"AAAAUH%2F%2B6mI%3D","updated":"2014-01-20 23:15:09.000000000","message":"Neutron doesn\u0027t provide a bulk delete as far as i know.","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"135105b3c31cc3edcbdf60d40d519e0b53c834f2","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"                          the network cache. Otherwise this is the list of"},{"line_number":1037,"context_line":"                          networks being attached to the instance. This value"},{"line_number":1038,"context_line":"                          is only used so we can return the human readable"},{"line_number":1039,"context_line":"                          network name rather than uuid."},{"line_number":1040,"context_line":"        :param port_ids - value is None when we are just perodically updating"},{"line_number":1041,"context_line":"                       the network cache. Otherwise it is a list of port ids"},{"line_number":1042,"context_line":"                       just created that should be attached to the instance"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FW7Q%3D","line":1039,"updated":"2014-01-14 17:20:37.000000000","message":"I think it would be clearer to say something like \"if this is None then the value will be populated from the existing value in the network cache\" - i.e describe how this value is used within this method rather that document assumptions about which callers will pass which values.","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e94022a07a0f3040fe1887396437c7415a3700b6","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"                          the network cache. Otherwise this is the list of"},{"line_number":1037,"context_line":"                          networks being attached to the instance. This value"},{"line_number":1038,"context_line":"                          is only used so we can return the human readable"},{"line_number":1039,"context_line":"                          network name rather than uuid."},{"line_number":1040,"context_line":"        :param port_ids - value is None when we are just perodically updating"},{"line_number":1041,"context_line":"                       the network cache. Otherwise it is a list of port ids"},{"line_number":1042,"context_line":"                       just created that should be attached to the instance"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B6Ps%3D","line":1039,"in_reply_to":"AAAAUH%2F%2FW7Q%3D","updated":"2014-01-20 23:15:09.000000000","message":"Makes sense I agree.","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"135105b3c31cc3edcbdf60d40d519e0b53c834f2","unresolved":false,"context_lines":[{"line_number":1038,"context_line":"                          is only used so we can return the human readable"},{"line_number":1039,"context_line":"                          network name rather than uuid."},{"line_number":1040,"context_line":"        :param port_ids - value is None when we are just perodically updating"},{"line_number":1041,"context_line":"                       the network cache. Otherwise it is a list of port ids"},{"line_number":1042,"context_line":"                       just created that should be attached to the instance"},{"line_number":1043,"context_line":"                       in their given order."},{"line_number":1044,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FW7A%3D","line":1041,"updated":"2014-01-14 17:20:37.000000000","message":"As above","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e94022a07a0f3040fe1887396437c7415a3700b6","unresolved":false,"context_lines":[{"line_number":1038,"context_line":"                          is only used so we can return the human readable"},{"line_number":1039,"context_line":"                          network name rather than uuid."},{"line_number":1040,"context_line":"        :param port_ids - value is None when we are just perodically updating"},{"line_number":1041,"context_line":"                       the network cache. Otherwise it is a list of port ids"},{"line_number":1042,"context_line":"                       just created that should be attached to the instance"},{"line_number":1043,"context_line":"                       in their given order."},{"line_number":1044,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B6PI%3D","line":1041,"in_reply_to":"AAAAUH%2F%2FW7A%3D","updated":"2014-01-20 23:15:09.000000000","message":"Done","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"51119e88e0f509e6559877325aa73475cc748f5f","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1055,"context_line":""},{"line_number":1056,"context_line":"        for port_id in port_ids:"},{"line_number":1057,"context_line":"            for current_neutron_port in current_neutron_ports:"},{"line_number":1058,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1059,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1060,"context_line":"                                                        current_neutron_port)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FXAM%3D","line":1057,"updated":"2014-01-14 17:26:09.000000000","message":"This is a minor performance issue but this logic would be much faster as a single loop checking existence in a set.\n\n    port_ids \u003d set(port_ids)\n    for current_neutron_port in current_neutron_ports:\n        if current_neutron_port[\u0027id\u0027] in port_ids:\n            ...\n            (remove the break)\n\nYou could even make _gather_port_ids return a set instead of a list.","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e94022a07a0f3040fe1887396437c7415a3700b6","unresolved":false,"context_lines":[{"line_number":1054,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1055,"context_line":""},{"line_number":1056,"context_line":"        for port_id in port_ids:"},{"line_number":1057,"context_line":"            for current_neutron_port in current_neutron_ports:"},{"line_number":1058,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1059,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1060,"context_line":"                                                        current_neutron_port)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B6Ok%3D","line":1057,"in_reply_to":"AAAAUH%2F%2FXAM%3D","updated":"2014-01-20 23:15:09.000000000","message":"Done but left port_ids as a list as it is already storing a unique list of uuid\u0027s.","commit_id":"1ca9e46a66f357a8a602fe99dda59e69da3d744d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d79ea428270a63ef78023bd74a011ab9fb43f0bf","unresolved":false,"context_lines":[{"line_number":454,"context_line":"                                                 port_ids)"},{"line_number":455,"context_line":"        return network_model.NetworkInfo.hydrate(nw_info)"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks,"},{"line_number":458,"context_line":"                                   port_ids):"},{"line_number":459,"context_line":"        \"\"\"Return an instances complete list of port_ids and networks.\"\"\""},{"line_number":460,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B4Eg%3D","line":457,"updated":"2014-01-21 07:13:54.000000000","message":"is it worthwhile setting networks\u003dNone and port_ids\u003dNone here?\nthere seems to be a case in line 469 when the networks ignored","commit_id":"5576a386d1fa7ce77c251bf6d36f6e0db5854812"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e7371386af9a3da7083aa863ede1b1ac3a9dbf0f","unresolved":false,"context_lines":[{"line_number":454,"context_line":"                                                 port_ids)"},{"line_number":455,"context_line":"        return network_model.NetworkInfo.hydrate(nw_info)"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks,"},{"line_number":458,"context_line":"                                   port_ids):"},{"line_number":459,"context_line":"        \"\"\"Return an instances complete list of port_ids and networks.\"\"\""},{"line_number":460,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B1xQ%3D","line":457,"in_reply_to":"AAAAUH%2F%2B4Eg%3D","updated":"2014-01-21 15:01:54.000000000","message":"Good idea. Sure","commit_id":"5576a386d1fa7ce77c251bf6d36f6e0db5854812"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d79ea428270a63ef78023bd74a011ab9fb43f0bf","unresolved":false,"context_lines":[{"line_number":475,"context_line":"            # Since networks does not contain the existing networks on the"},{"line_number":476,"context_line":"            # instance we use the values from the cache."},{"line_number":477,"context_line":"            networks \u003d networks + ["},{"line_number":478,"context_line":"                dict(id\u003diface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":479,"context_line":"                     name\u003diface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":480,"context_line":"                     tenant_id\u003diface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027])"},{"line_number":481,"context_line":"                for iface in ifaces]"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B4Es%3D","line":478,"updated":"2014-01-21 07:13:54.000000000","message":"consider using {} instead of dict.","commit_id":"5576a386d1fa7ce77c251bf6d36f6e0db5854812"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e7371386af9a3da7083aa863ede1b1ac3a9dbf0f","unresolved":false,"context_lines":[{"line_number":475,"context_line":"            # Since networks does not contain the existing networks on the"},{"line_number":476,"context_line":"            # instance we use the values from the cache."},{"line_number":477,"context_line":"            networks \u003d networks + ["},{"line_number":478,"context_line":"                dict(id\u003diface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":479,"context_line":"                     name\u003diface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":480,"context_line":"                     tenant_id\u003diface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027])"},{"line_number":481,"context_line":"                for iface in ifaces]"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B1xI%3D","line":478,"in_reply_to":"AAAAUH%2F%2B4Es%3D","updated":"2014-01-21 15:01:54.000000000","message":"Done","commit_id":"5576a386d1fa7ce77c251bf6d36f6e0db5854812"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b89426cd0716b7615b704e957f1c122d1d62f572","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"            net_ids \u003d [n[\u0027id\u0027] for n in networks]"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"        ports \u003d [port for port in ports if port[\u0027network_id\u0027] in net_ids]"},{"line_number":1030,"context_line":"        _ensure_requested_network_ordering(lambda x: x[\u0027network_id\u0027],"},{"line_number":1031,"context_line":"                                           ports, net_ids)"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"        for port in ports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2BNUQ%3D","side":"PARENT","line":1030,"updated":"2014-01-29 02:27:45.000000000","message":"Does this ordering need to still happen in the new code?","commit_id":"23a0bea232b42df3c26425d7164c779c82fa7a77"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2712e74a2866ab7ad00d44e30fc66a3ab2b22cc1","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"            net_ids \u003d [n[\u0027id\u0027] for n in networks]"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"        ports \u003d [port for port in ports if port[\u0027network_id\u0027] in net_ids]"},{"line_number":1030,"context_line":"        _ensure_requested_network_ordering(lambda x: x[\u0027network_id\u0027],"},{"line_number":1031,"context_line":"                                           ports, net_ids)"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"        for port in ports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F92Mc%3D","side":"PARENT","line":1030,"in_reply_to":"AAAAUH%2F%2BNUQ%3D","updated":"2014-02-03 11:19:22.000000000","message":"nope because the ports are now being passed in in the right order directly rather than sorting on the network order later.","commit_id":"23a0bea232b42df3c26425d7164c779c82fa7a77"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b89426cd0716b7615b704e957f1c122d1d62f572","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        touched_port_ids \u003d []"},{"line_number":286,"context_line":"        created_port_ids \u003d []"},{"line_number":287,"context_line":"        ports_in_requested_order \u003d []"},{"line_number":288,"context_line":"        for network in nets:"},{"line_number":289,"context_line":"            # If security groups are requested on an instance then the"},{"line_number":290,"context_line":"            # network must has a subnet associated with it. Some plugins"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2BNWE%3D","line":287,"updated":"2014-01-29 02:27:45.000000000","message":"Does this need to be a list?  Looking at the code in this method that uses it, it\u0027s always just a single ID, right?","commit_id":"704b1426e580c123714689cce19a5e6a4f8f8b5a"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2712e74a2866ab7ad00d44e30fc66a3ab2b22cc1","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        touched_port_ids \u003d []"},{"line_number":286,"context_line":"        created_port_ids \u003d []"},{"line_number":287,"context_line":"        ports_in_requested_order \u003d []"},{"line_number":288,"context_line":"        for network in nets:"},{"line_number":289,"context_line":"            # If security groups are requested on an instance then the"},{"line_number":290,"context_line":"            # network must has a subnet associated with it. Some plugins"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F92Nw%3D","line":287,"in_reply_to":"AAAAUH%2F%2BNWE%3D","updated":"2014-02-03 11:19:22.000000000","message":"Hi Matt, This is only a single id if the instance is only on one network. If you have multiple networks you\u0027ll have multiple ids in here (due to the for loop below looping on nets).","commit_id":"704b1426e580c123714689cce19a5e6a4f8f8b5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a26c055d7c8c083640e374aad1184f622969e85a","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        touched_port_ids \u003d []"},{"line_number":286,"context_line":"        created_port_ids \u003d []"},{"line_number":287,"context_line":"        ports_in_requested_order \u003d []"},{"line_number":288,"context_line":"        for network in nets:"},{"line_number":289,"context_line":"            # If security groups are requested on an instance then the"},{"line_number":290,"context_line":"            # network must has a subnet associated with it. Some plugins"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F906w%3D","line":287,"in_reply_to":"AAAAUH%2F92Nw%3D","updated":"2014-02-03 15:41:54.000000000","message":"Oh right, the for loop, I must have not expanded the unchanged lines.  I\u0027ll echo Phil\u0027s comments on how we really need to break up some of this code, it\u0027s getting monolithic.  That\u0027s for another refactor later though.","commit_id":"704b1426e580c123714689cce19a5e6a4f8f8b5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b89426cd0716b7615b704e957f1c122d1d62f572","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"    def _build_network_info_model(self, context, instance, networks\u003dNone,"},{"line_number":1031,"context_line":"                                  port_ids\u003dNone):"},{"line_number":1032,"context_line":"        \"\"\"Return list of ordered VIFs attached to instance."},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        :param instance - instance we are returning network info for."},{"line_number":1035,"context_line":"        :param networks - List of networks attached to instance. If value is"},{"line_number":1036,"context_line":"                          None this value will be populated from the existing"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F%2BNU0%3D","line":1033,"updated":"2014-01-29 02:27:45.000000000","message":"Might as well also document the context parameter here.","commit_id":"704b1426e580c123714689cce19a5e6a4f8f8b5a"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2712e74a2866ab7ad00d44e30fc66a3ab2b22cc1","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"    def _build_network_info_model(self, context, instance, networks\u003dNone,"},{"line_number":1031,"context_line":"                                  port_ids\u003dNone):"},{"line_number":1032,"context_line":"        \"\"\"Return list of ordered VIFs attached to instance."},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        :param instance - instance we are returning network info for."},{"line_number":1035,"context_line":"        :param networks - List of networks attached to instance. If value is"},{"line_number":1036,"context_line":"                          None this value will be populated from the existing"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUH%2F92No%3D","line":1033,"in_reply_to":"AAAAUH%2F%2BNU0%3D","updated":"2014-02-03 11:19:22.000000000","message":"Done","commit_id":"704b1426e580c123714689cce19a5e6a4f8f8b5a"},{"author":{"_account_id":7500,"name":"Peter Feiner","email":"peter@gridcentric.ca","username":"peter"},"change_message_id":"be27b20ff29dc9fb3ef4ba7d5c78abb5ef26e538","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        # this only affects the attach case, not the original use for this"},{"line_number":354,"context_line":"        # method."},{"line_number":355,"context_line":"        return network_model.NetworkInfo([port for port in nw_info"},{"line_number":356,"context_line":"                                          if port[\u0027id\u0027] in created_port_ids +"},{"line_number":357,"context_line":"                                                           touched_port_ids])"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def _refresh_neutron_extensions_cache(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F901k%3D","line":356,"updated":"2014-02-03 15:52:45.000000000","message":"I believe this filter is no longer necessary since \n \n set(ports_in_requested_order) \u003d\u003d set(created_port_ids + touched_port_ids)","commit_id":"809bb59b95fa4f6b78cbebe7d9b08d6a0ecb264f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d94f44ee97c832e0befb50ff71656538a23760e7","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        # this only affects the attach case, not the original use for this"},{"line_number":354,"context_line":"        # method."},{"line_number":355,"context_line":"        return network_model.NetworkInfo([port for port in nw_info"},{"line_number":356,"context_line":"                                          if port[\u0027id\u0027] in created_port_ids +"},{"line_number":357,"context_line":"                                                           touched_port_ids])"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"    def _refresh_neutron_extensions_cache(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2FoWc%3D","line":356,"in_reply_to":"AAAAUH%2F901k%3D","updated":"2014-02-11 21:36:46.000000000","message":"right - though i rather leave this as it is as ports_in_requested_order line warps here.","commit_id":"809bb59b95fa4f6b78cbebe7d9b08d6a0ecb264f"},{"author":{"_account_id":7500,"name":"Peter Feiner","email":"peter@gridcentric.ca","username":"peter"},"change_message_id":"be27b20ff29dc9fb3ef4ba7d5c78abb5ef26e538","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks\u003dNone,"},{"line_number":464,"context_line":"                                      port_ids\u003dNone):"},{"line_number":465,"context_line":"        \"\"\"Return an instances complete list of port_ids and networks.\"\"\""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"},{"line_number":468,"context_line":"        if isinstance(instance[\u0027info_cache\u0027][\u0027network_info\u0027], six.text_type):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F90%2Fo%3D","line":465,"updated":"2014-02-03 15:52:45.000000000","message":"spelling: instance\u0027s","commit_id":"809bb59b95fa4f6b78cbebe7d9b08d6a0ecb264f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d94f44ee97c832e0befb50ff71656538a23760e7","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks\u003dNone,"},{"line_number":464,"context_line":"                                      port_ids\u003dNone):"},{"line_number":465,"context_line":"        \"\"\"Return an instances complete list of port_ids and networks.\"\"\""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"},{"line_number":468,"context_line":"        if isinstance(instance[\u0027info_cache\u0027][\u0027network_info\u0027], six.text_type):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9wZ4%3D","line":465,"in_reply_to":"AAAAUH%2F90%2Fo%3D","updated":"2014-02-11 21:36:46.000000000","message":"Done","commit_id":"809bb59b95fa4f6b78cbebe7d9b08d6a0ecb264f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9b18c5b68bd8518af522eb4f8bd942ea047b8a0f","unresolved":false,"context_lines":[{"line_number":461,"context_line":"        return network_model.NetworkInfo.hydrate(nw_info)"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks\u003dNone,"},{"line_number":464,"context_line":"                                      port_ids\u003dNone):"},{"line_number":465,"context_line":"        \"\"\"Return an instance\u0027s complete list of port_ids and networks.\"\"\""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FcOY%3D","line":464,"updated":"2014-02-13 07:23:26.000000000","message":"can you please pass the neutron client as a parameter here - this can be passed to _get_available_networks - it will save a call to get the client. please see line 1060 where this is first read","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8343a5f3820d1d53e93d1b23e00c8ff2a908fdb0","unresolved":false,"context_lines":[{"line_number":461,"context_line":"        return network_model.NetworkInfo.hydrate(nw_info)"},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    def _gather_port_ids_and_networks(self, context, instance, networks\u003dNone,"},{"line_number":464,"context_line":"                                      port_ids\u003dNone):"},{"line_number":465,"context_line":"        \"\"\"Return an instance\u0027s complete list of port_ids and networks.\"\"\""},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"        # Unfortunately, this is sometimes in unicode and sometimes not"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FWiE%3D","line":464,"in_reply_to":"AAAAUX%2F%2FcOY%3D","updated":"2014-02-13 19:36:49.000000000","message":"I think this should be done in a follow up patch as _get_available_networks() is called in many places and not just here.","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9b18c5b68bd8518af522eb4f8bd942ea047b8a0f","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        if port_ids is None:"},{"line_number":475,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces]"},{"line_number":476,"context_line":"            net_ids \u003d [iface[\u0027network\u0027][\u0027id\u0027] for iface in ifaces]"},{"line_number":477,"context_line":"            networks \u003d self._get_available_networks(context,"},{"line_number":478,"context_line":"                                                    instance[\u0027project_id\u0027],"},{"line_number":479,"context_line":"                                                    net_ids)"},{"line_number":480,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FcPw%3D","line":477,"updated":"2014-02-13 07:23:26.000000000","message":"could there be a case here where there are networks passed as a parameter? in this case we should append this to the existing networks.","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8343a5f3820d1d53e93d1b23e00c8ff2a908fdb0","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        if port_ids is None:"},{"line_number":475,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces]"},{"line_number":476,"context_line":"            net_ids \u003d [iface[\u0027network\u0027][\u0027id\u0027] for iface in ifaces]"},{"line_number":477,"context_line":"            networks \u003d self._get_available_networks(context,"},{"line_number":478,"context_line":"                                                    instance[\u0027project_id\u0027],"},{"line_number":479,"context_line":"                                                    net_ids)"},{"line_number":480,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FWhk%3D","line":477,"in_reply_to":"AAAAUX%2F%2FcPw%3D","updated":"2014-02-13 19:36:49.000000000","message":"Nope, ports and networks will either both be None or both be a list of the networks and port_ids being attached to an instance.","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9b18c5b68bd8518af522eb4f8bd942ea047b8a0f","unresolved":false,"context_lines":[{"line_number":476,"context_line":"            net_ids \u003d [iface[\u0027network\u0027][\u0027id\u0027] for iface in ifaces]"},{"line_number":477,"context_line":"            networks \u003d self._get_available_networks(context,"},{"line_number":478,"context_line":"                                                    instance[\u0027project_id\u0027],"},{"line_number":479,"context_line":"                                                    net_ids)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"        # an interface was added/removed from instance."},{"line_number":482,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FcN8%3D","line":479,"updated":"2014-02-13 07:23:26.000000000","message":"following the comment on line 464 you pass pass the neutron client as a param here","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8343a5f3820d1d53e93d1b23e00c8ff2a908fdb0","unresolved":false,"context_lines":[{"line_number":476,"context_line":"            net_ids \u003d [iface[\u0027network\u0027][\u0027id\u0027] for iface in ifaces]"},{"line_number":477,"context_line":"            networks \u003d self._get_available_networks(context,"},{"line_number":478,"context_line":"                                                    instance[\u0027project_id\u0027],"},{"line_number":479,"context_line":"                                                    net_ids)"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":"        # an interface was added/removed from instance."},{"line_number":482,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUX%2F%2FWhc%3D","line":479,"in_reply_to":"AAAAUX%2F%2FcN8%3D","updated":"2014-02-13 19:36:49.000000000","message":"ditto as comment before.","commit_id":"207b00f00ba2646e5ed926a36602ce37cf5638cd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda8359e467f5ff47274fc4472e095c9b4debbe4","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                            port_req_body, fixed_ips.get(network_id),"},{"line_number":321,"context_line":"                            security_group_ids, available_macs, dhcp_opts)"},{"line_number":322,"context_line":"                    created_port_ids.append(created_port)"},{"line_number":323,"context_line":"                    ports_in_requested_order.append(created_port)"},{"line_number":324,"context_line":"            except Exception:"},{"line_number":325,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":326,"context_line":"                    for port_id in touched_port_ids:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2B0oI%3D","line":323,"updated":"2014-02-18 20:07:28.000000000","message":"Isn\u0027t \"created_ports\" going to end up the same as \"ports_in_requested_order\" ?\n\nISTR adding that specifically for the purpose of getting a list of the ports we created, and in the order we created them for use by attach_interface().","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                            port_req_body, fixed_ips.get(network_id),"},{"line_number":321,"context_line":"                            security_group_ids, available_macs, dhcp_opts)"},{"line_number":322,"context_line":"                    created_port_ids.append(created_port)"},{"line_number":323,"context_line":"                    ports_in_requested_order.append(created_port)"},{"line_number":324,"context_line":"            except Exception:"},{"line_number":325,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":326,"context_line":"                    for port_id in touched_port_ids:"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2BzPM%3D","line":323,"in_reply_to":"AAAAUX%2F%2B0oI%3D","updated":"2014-02-19 00:15:32.000000000","message":"unfortunately,  ports_in_requested_order won\u0027t be the same thing as created_ports as it will be missing ports that are passed in via --nic port-id\u003d i.e touched_ports.","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda8359e467f5ff47274fc4472e095c9b4debbe4","unresolved":false,"context_lines":[{"line_number":482,"context_line":"        else:"},{"line_number":483,"context_line":"            # Since networks does not contain the existing networks on the"},{"line_number":484,"context_line":"            # instance we use the values from the cache."},{"line_number":485,"context_line":"            networks \u003d networks + ["},{"line_number":486,"context_line":"                {\u0027id\u0027: iface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":487,"context_line":"                 \u0027name\u0027: iface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":488,"context_line":"                 \u0027tenant_id\u0027: iface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027]}"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2B0kc%3D","line":485,"updated":"2014-02-18 20:07:28.000000000","message":"I don\u0027t understand why we\u0027re doing this. If we\u0027re iterating over the whole list of interfaces, shouldn\u0027t we be building the full list of networks? Why do we add it to the list of networks we were passed? Further, networks can be None here, in the caller, etc, so this seems a little dangerous and fragile if later someone comes along and thinks they can call it with networks\u003dNone.","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":482,"context_line":"        else:"},{"line_number":483,"context_line":"            # Since networks does not contain the existing networks on the"},{"line_number":484,"context_line":"            # instance we use the values from the cache."},{"line_number":485,"context_line":"            networks \u003d networks + ["},{"line_number":486,"context_line":"                {\u0027id\u0027: iface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":487,"context_line":"                 \u0027name\u0027: iface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":488,"context_line":"                 \u0027tenant_id\u0027: iface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027]}"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2BzNs%3D","line":485,"in_reply_to":"AAAAUX%2F%2B0kc%3D","updated":"2014-02-19 00:15:32.000000000","message":"The method allocate_for_instance() will be called when hot-plugging a single nic to an instance. In this case the networks param will only include the networks currently being attached to the instance (and not the networks the instance is  already attached to).   Because of this we add the networks that the instance is already attached to so they are not removed from the info_cache (since all the ifaces on an instance is stored in one blob there and we need to rewrite that blob each time we add a nic).\n\nCurrently this method is only called with both port_ids and networks set to None or containing data. I\u0027ll fix though as that\u0027s a good point!","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda8359e467f5ff47274fc4472e095c9b4debbe4","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"        :param instance - instance we are returning network info for."},{"line_number":1050,"context_line":"        :param networks - List of networks attached to instance. If value is"},{"line_number":1051,"context_line":"                          None this value will be populated from the existing"},{"line_number":1052,"context_line":"                          cached value."},{"line_number":1053,"context_line":"        :param port_ids - List of port_ids that are attached to the instance"},{"line_number":1054,"context_line":"                          in order of attachment. If value is None this value"},{"line_number":1055,"context_line":"                          will be populated from the existing cached value."}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2B0kE%3D","line":1052,"updated":"2014-02-18 20:07:28.000000000","message":"This docstring makes it sound like networks is either None or the \"list of [all?] networks attached to the instance.\" If that\u0027s the case, I don\u0027t understand why we\u0027re adding to this list ever (see comment above).","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"        :param instance - instance we are returning network info for."},{"line_number":1050,"context_line":"        :param networks - List of networks attached to instance. If value is"},{"line_number":1051,"context_line":"                          None this value will be populated from the existing"},{"line_number":1052,"context_line":"                          cached value."},{"line_number":1053,"context_line":"        :param port_ids - List of port_ids that are attached to the instance"},{"line_number":1054,"context_line":"                          in order of attachment. If value is None this value"},{"line_number":1055,"context_line":"                          will be populated from the existing cached value."}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2BzKU%3D","line":1052,"in_reply_to":"AAAAUX%2F%2B0kE%3D","updated":"2014-02-19 00:15:32.000000000","message":"Sorry this should say: List of networks being attached to an instance.","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda8359e467f5ff47274fc4472e095c9b4debbe4","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"                          cached value."},{"line_number":1053,"context_line":"        :param port_ids - List of port_ids that are attached to the instance"},{"line_number":1054,"context_line":"                          in order of attachment. If value is None this value"},{"line_number":1055,"context_line":"                          will be populated from the existing cached value."},{"line_number":1056,"context_line":"        \"\"\""},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        search_opts \u003d {\u0027tenant_id\u0027: instance[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2B0j0%3D","line":1055,"updated":"2014-02-18 20:07:28.000000000","message":"Should this be \"list of port_ids that were _just_ attached to the instance\" ? Otherwise, why are we adding the missing interfaces to the cache above?","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"                          cached value."},{"line_number":1053,"context_line":"        :param port_ids - List of port_ids that are attached to the instance"},{"line_number":1054,"context_line":"                          in order of attachment. If value is None this value"},{"line_number":1055,"context_line":"                          will be populated from the existing cached value."},{"line_number":1056,"context_line":"        \"\"\""},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        search_opts \u003d {\u0027tenant_id\u0027: instance[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2BzKQ%3D","line":1055,"in_reply_to":"AAAAUX%2F%2B0j0%3D","updated":"2014-02-19 00:15:32.000000000","message":"right __just__ attached, i fixed the doc string.","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eda8359e467f5ff47274fc4472e095c9b4debbe4","unresolved":false,"context_lines":[{"line_number":1066,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1067,"context_line":""},{"line_number":1068,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1069,"context_line":"            if current_neutron_port[\u0027id\u0027] in port_ids:"},{"line_number":1070,"context_line":"                network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1071,"context_line":"                                                    current_neutron_port)"},{"line_number":1072,"context_line":"                subnets \u003d self._nw_info_get_subnets(context,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2B0ig%3D","line":1069,"updated":"2014-02-18 20:07:28.000000000","message":"So, I think that this is trying to merge neutron\u0027s state of the world with what nova thinks it is based on the info_cache, is that right?\n\nI guess I kindof fundamentally think that\u0027s not the right approach because if someone looks at neutron, it will show ports assigned to instances that nova knows nothing about, right? I\u0027m not really suggesting this, but why not just delete them right here and now if we find them?","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"60b017563589a6cd6f378f3dbba8a7cb8f4ceb3a","unresolved":false,"context_lines":[{"line_number":1066,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1067,"context_line":""},{"line_number":1068,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1069,"context_line":"            if current_neutron_port[\u0027id\u0027] in port_ids:"},{"line_number":1070,"context_line":"                network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1071,"context_line":"                                                    current_neutron_port)"},{"line_number":1072,"context_line":"                subnets \u003d self._nw_info_get_subnets(context,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUX%2F%2BzJU%3D","line":1069,"in_reply_to":"AAAAUX%2F%2B0ig%3D","updated":"2014-02-19 00:15:32.000000000","message":"Right, these ports are deleted in a later patch. This patch just makes sure that those ports don\u0027t enter the cache as they were before.","commit_id":"914ddc41798ccf233d70420c3af37445088a00c5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"66c5985fe0e1f75e575a27ba2fa757eccc235a58","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                {\u0027id\u0027: iface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":493,"context_line":"                 \u0027name\u0027: iface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":494,"context_line":"                 \u0027tenant_id\u0027: iface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027]}"},{"line_number":495,"context_line":"                for iface in ifaces]"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":498,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FUCE%3D","line":495,"updated":"2014-03-06 22:07:34.000000000","message":"This concerns me, because it doesn\u0027t seem like it\u0027s clear that the behavior is always correct. If some networks were passed in, plus all the vifs, it seems like we\u0027d get more than one copy of some networks in this list. Don\u0027t we need to iterate the list of all networks here and only add the ones we don\u0027t already have?\n\nAlternately, if this should never be called with both arguments, or something like that, can we check that at the top and log/raise an error if it happens?\n\nI think one of the problems that got introduced when we first got interface_attach() was that some of these methods were called with differing variations of the arguments than were expected and we ended up with issues.","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7ea4c58353eaf264feb54b262d15fea262176ae0","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                {\u0027id\u0027: iface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":493,"context_line":"                 \u0027name\u0027: iface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":494,"context_line":"                 \u0027tenant_id\u0027: iface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027]}"},{"line_number":495,"context_line":"                for iface in ifaces]"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":498,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FS2M%3D","line":495,"in_reply_to":"AAAAVn%2F%2FTAk%3D","updated":"2014-03-07 00:33:53.000000000","message":"I think the check needs to be at the top of *this* method, right? And yes, that would make me feel much better :)","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e867db2c07e8829363779cee0630b025766ac268","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                {\u0027id\u0027: iface[\u0027network\u0027][\u0027id\u0027],"},{"line_number":493,"context_line":"                 \u0027name\u0027: iface[\u0027network\u0027][\u0027label\u0027],"},{"line_number":494,"context_line":"                 \u0027tenant_id\u0027: iface[\u0027network\u0027][\u0027meta\u0027][\u0027tenant_id\u0027]}"},{"line_number":495,"context_line":"                for iface in ifaces]"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":498,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FTAk%3D","line":495,"in_reply_to":"AAAAVn%2F%2FUCE%3D","updated":"2014-03-07 00:27:00.000000000","message":"This method will only be called with either networks and port_ids (booting a vm or adding an iface)  or networks\u003dNone/port_ids\u003dNone (refreshing the cache)\n\nIn the else statement here (adding an interface) networks/and port_ids only contain those being added to an instance. Because of this we fetch the previous networks from the info_cache so we don\u0027t have to query neutron for them.  The doc string on  _build_network_info_model() where this method is called tries to explain this. \n\nI can add a check at the top of _build_network_info_model (the only method that calls this) to say : if  ((networks and not ports) or (not networks and ports)): raise Error if you like?  Hopefully this explaining helps :/","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"66c5985fe0e1f75e575a27ba2fa757eccc235a58","unresolved":false,"context_lines":[{"line_number":495,"context_line":"                for iface in ifaces]"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":498,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"        return networks, port_ids"},{"line_number":501,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FUEM%3D","line":498,"updated":"2014-03-06 22:07:34.000000000","message":"I think you could do port_ids +\u003d [ ... ] here","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e867db2c07e8829363779cee0630b025766ac268","unresolved":false,"context_lines":[{"line_number":495,"context_line":"                for iface in ifaces]"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"            # Include existing interfaces so they are not removed from the db."},{"line_number":498,"context_line":"            port_ids \u003d [iface[\u0027id\u0027] for iface in ifaces] + port_ids"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"        return networks, port_ids"},{"line_number":501,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FS%2Fk%3D","line":498,"in_reply_to":"AAAAVn%2F%2FUEM%3D","updated":"2014-03-07 00:27:00.000000000","message":"Actually no. This would change the order here. I want the ifaces from the cache to come first (since they are already attached to the instance) then the ones being attached to come second.","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"66c5985fe0e1f75e575a27ba2fa757eccc235a58","unresolved":false,"context_lines":[{"line_number":1079,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1080,"context_line":""},{"line_number":1081,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1082,"context_line":"            if current_neutron_port[\u0027id\u0027] in port_ids:"},{"line_number":1083,"context_line":"                network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1084,"context_line":"                                                    current_neutron_port)"},{"line_number":1085,"context_line":"                subnets \u003d self._nw_info_get_subnets(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FT%2FM%3D","line":1082,"updated":"2014-03-06 22:07:34.000000000","message":"Just to be clear, this prevents us from adding a port from the neutron side, right? Not sure if that is ever done, but I just want to make sure it\u0027s not expected to work.","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e867db2c07e8829363779cee0630b025766ac268","unresolved":false,"context_lines":[{"line_number":1079,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1080,"context_line":""},{"line_number":1081,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1082,"context_line":"            if current_neutron_port[\u0027id\u0027] in port_ids:"},{"line_number":1083,"context_line":"                network_IPs \u003d self._nw_info_get_ips(client,"},{"line_number":1084,"context_line":"                                                    current_neutron_port)"},{"line_number":1085,"context_line":"                subnets \u003d self._nw_info_get_subnets(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2FS%2FA%3D","line":1082,"in_reply_to":"AAAAVn%2F%2FT%2FM%3D","updated":"2014-03-07 00:27:00.000000000","message":"Yup 100% correct. Previously if one did:: neutron port-create --device_id\u003d\u003cinstance_uuid\u003e it would eventually show up in the cache. This solves that.  \n\nWe need to tell nova that we want a port attached so neutron can\u0027t do that.","commit_id":"c28df10b5b449b4ab4127891fa9f83b2e1a62696"}]}
