)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"e69e9bf00c828c7b9419cd81c7f36306cf936eb7","unresolved":false,"context_lines":[{"line_number":6856,"context_line":"                    # Check to see if the port ID was provided as the tag."},{"line_number":6857,"context_line":"                    # Neutron did not start providing this for this event until"},{"line_number":6858,"context_line":"                    # the Pike release."},{"line_number":6859,"context_line":"                    if event.tag is not None:"},{"line_number":6860,"context_line":"                        # Just try to refresh the cache for this one port. In"},{"line_number":6861,"context_line":"                        # this case something about the port was updated, or"},{"line_number":6862,"context_line":"                        # it was associated/disassociated to/from a floating"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_35dd5514","line":6859,"range":{"start_line":6859,"start_character":20,"end_line":6859,"end_character":45},"updated":"2017-05-18 23:39:17.000000000","message":"do we even need the conditional?   Maybe just explain that event.tag is allowed to be None and indicates that no port has been specified.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"924ccb413ff8b9ea37dec0b68940520285ffcc81","unresolved":false,"context_lines":[{"line_number":6856,"context_line":"                    # Check to see if the port ID was provided as the tag."},{"line_number":6857,"context_line":"                    # Neutron did not start providing this for this event until"},{"line_number":6858,"context_line":"                    # the Pike release."},{"line_number":6859,"context_line":"                    if event.tag is not None:"},{"line_number":6860,"context_line":"                        # Just try to refresh the cache for this one port. In"},{"line_number":6861,"context_line":"                        # this case something about the port was updated, or"},{"line_number":6862,"context_line":"                        # it was associated/disassociated to/from a floating"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_8bcaa417","line":6859,"range":{"start_line":6859,"start_character":20,"end_line":6859,"end_character":45},"in_reply_to":"ff0f0b1f_35dd5514","updated":"2017-05-19 19:00:12.000000000","message":"The event tag, when specified, is the port ID for the network-changed event and is used to signal to the refresh build how to handle this. Originally I thought about just passing this in via the port_ids kwarg but it turns out that\u0027s got a specific meaning in the build that rebuilds the nw info cache, and is required to also pass in the list of networks for those ports - which means it\u0027s for the case that you\u0027re going through allocate_for_instance (either via server create or attaching a vif to an existing instance). So rather than monkey with those semantics, I just passed in a new kwarg to flag the changes.\n\nLong-term it would probably behoove us to split that build method in the neutronv2 api code apart so it\u0027s more targeted to different use cases and we won\u0027t get so confused about what all of the different kwargs mean.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7f097ae0f0bdc9f4772c3767e06734a3f2d78afd","unresolved":false,"context_lines":[{"line_number":6856,"context_line":"                    # Check to see if the port ID was provided as the tag."},{"line_number":6857,"context_line":"                    # Neutron did not start providing this for this event until"},{"line_number":6858,"context_line":"                    # the Pike release."},{"line_number":6859,"context_line":"                    if event.tag is not None:"},{"line_number":6860,"context_line":"                        # Just try to refresh the cache for this one port. In"},{"line_number":6861,"context_line":"                        # this case something about the port was updated, or"},{"line_number":6862,"context_line":"                        # it was associated/disassociated to/from a floating"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_24d2a2d3","line":6859,"range":{"start_line":6859,"start_character":20,"end_line":6859,"end_character":45},"in_reply_to":"ff0f0b1f_61352f46","updated":"2017-05-19 22:43:45.000000000","message":"Oh yeah good point, that does simplify things.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"e4fe458f2fbee61f796dcfac8023411b022c2389","unresolved":false,"context_lines":[{"line_number":6856,"context_line":"                    # Check to see if the port ID was provided as the tag."},{"line_number":6857,"context_line":"                    # Neutron did not start providing this for this event until"},{"line_number":6858,"context_line":"                    # the Pike release."},{"line_number":6859,"context_line":"                    if event.tag is not None:"},{"line_number":6860,"context_line":"                        # Just try to refresh the cache for this one port. In"},{"line_number":6861,"context_line":"                        # this case something about the port was updated, or"},{"line_number":6862,"context_line":"                        # it was associated/disassociated to/from a floating"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_61352f46","line":6859,"range":{"start_line":6859,"start_character":20,"end_line":6859,"end_character":45},"in_reply_to":"ff0f0b1f_8bcaa417","updated":"2017-05-19 19:46:59.000000000","message":"What I mean is that I think we can just unconditionally call self.network_api.get_instance_nw_info(context, instance, refresh_vif_id\u003devent.tag)\n\nIf event.tag is None, then we will go down the \"rebuild everything\" path.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"136aba397b45dc0160ea0655565830f530b4947a","unresolved":false,"context_lines":[{"line_number":6861,"context_line":"                        # this case something about the port was updated, or"},{"line_number":6862,"context_line":"                        # it was associated/disassociated to/from a floating"},{"line_number":6863,"context_line":"                        # IP."},{"line_number":6864,"context_line":"                        self.network_api.get_instance_nw_info("},{"line_number":6865,"context_line":"                            context, instance, refresh_vif_id\u003devent.tag)"},{"line_number":6866,"context_line":"                    else:"},{"line_number":6867,"context_line":"                        self.network_api.get_instance_nw_info("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_bf24a6c7","line":6864,"updated":"2017-05-18 22:05:00.000000000","message":"Log this case at debug level.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ef36084d2c3ea9300807fb1d199e5d848d731913","unresolved":false,"context_lines":[{"line_number":6853,"context_line":"                      instance\u003dinstance)"},{"line_number":6854,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6855,"context_line":"                try:"},{"line_number":6856,"context_line":"                    LOG.debug(\u0027Refreshing instance network info cache due to \u0027"},{"line_number":6857,"context_line":"                              \u0027event %s.\u0027, event.key, instance\u003dinstance)"},{"line_number":6858,"context_line":"                    self.network_api.get_instance_nw_info("},{"line_number":6859,"context_line":"                        context, instance, refresh_vif_id\u003devent.tag)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_f4f691f9","line":6856,"updated":"2017-05-20 22:45:16.000000000","message":"Weird, I don\u0027t actually see this show up in any n-cpu logs for single-node or multi-node live migration jobs...","commit_id":"4cf62148e0d9d05fdd6f95f6ec76c257a9b78fc9"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"0068a43eb895d83c2a3c8767a4dd8043107ac36a","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":1278,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone,"},{"line_number":1279,"context_line":"                              preexisting_port_ids\u003dNone,"},{"line_number":1280,"context_line":"                              refresh_vif_id\u003dNone, **kwargs):"},{"line_number":1281,"context_line":"        # NOTE(danms): This is an inner method intended to be called"},{"line_number":1282,"context_line":"        # by other code that updates instance nwinfo. It *must* be"},{"line_number":1283,"context_line":"        # called with the refresh_cache-%(instance_uuid) lock held!"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_d504d97d","line":1280,"range":{"start_line":1280,"start_character":30,"end_line":1280,"end_character":44},"updated":"2017-05-18 23:43:34.000000000","message":"is there a reason for the mix of \"vif_id\" and \"port_id\"?  Can we unify on one term or are they actually separate things?","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"924ccb413ff8b9ea37dec0b68940520285ffcc81","unresolved":false,"context_lines":[{"line_number":1277,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":1278,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone,"},{"line_number":1279,"context_line":"                              preexisting_port_ids\u003dNone,"},{"line_number":1280,"context_line":"                              refresh_vif_id\u003dNone, **kwargs):"},{"line_number":1281,"context_line":"        # NOTE(danms): This is an inner method intended to be called"},{"line_number":1282,"context_line":"        # by other code that updates instance nwinfo. It *must* be"},{"line_number":1283,"context_line":"        # called with the refresh_cache-%(instance_uuid) lock held!"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_0bffb434","line":1280,"range":{"start_line":1280,"start_character":30,"end_line":1280,"end_character":44},"in_reply_to":"ff0f0b1f_d504d97d","updated":"2017-05-19 19:00:12.000000000","message":"It could be port_id, it just seemed weird to have a single port_id when we have a port_ids kwarg, but as noted in my reply in the compute manager code, port_ids has a different meaning and tightly couples it to allocate_for_instance flows.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ecb926c88a7cdf81e2cb937efbc83bdf5e5930b2","unresolved":false,"context_lines":[{"line_number":2194,"context_line":"        return [vif[\u0027id\u0027] for vif in net_info"},{"line_number":2195,"context_line":"                if vif.get(\u0027preserve_on_delete\u0027)]"},{"line_number":2196,"context_line":""},{"line_number":2197,"context_line":"    def _build_vif_model(self, context, client, current_neutron_port,"},{"line_number":2198,"context_line":"                         networks, preexisting_port_ids):"},{"line_number":2199,"context_line":"        vif_active \u003d False"},{"line_number":2200,"context_line":"        if (current_neutron_port[\u0027admin_state_up\u0027] is False"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_282e3ea5","line":2197,"updated":"2017-05-18 03:34:24.000000000","message":"This refactor would all be pulled out into a separate change before this one, if it\u0027s something we\u0027re going to do.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"2f1f98e66aeb9aa303f8644eeafc3d5a0abb08f7","unresolved":false,"context_lines":[{"line_number":2264,"context_line":"        else:"},{"line_number":2265,"context_line":"            client \u003d admin_client"},{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":2268,"context_line":""},{"line_number":2269,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":2270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_b03bb3cf","line":2267,"range":{"start_line":2267,"start_character":15,"end_line":2267,"end_character":32},"updated":"2017-05-19 00:11:17.000000000","message":"could we optimize this if we\u0027re passed a non-None refresh_vif_id?","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"82f8c0ac86f8d65d1991913466e158501f1f7107","unresolved":false,"context_lines":[{"line_number":2264,"context_line":"        else:"},{"line_number":2265,"context_line":"            client \u003d admin_client"},{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":2268,"context_line":""},{"line_number":2269,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":2270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_d131860d","line":2267,"range":{"start_line":2267,"start_character":15,"end_line":2267,"end_character":32},"in_reply_to":"ff0f0b1f_b03bb3cf","updated":"2017-05-19 05:44:17.000000000","message":"It seems to work if I do something like this:\n\n        if refresh_vif_id is not None:\n            current_neutron_ports \u003d []\n            try:\n                data \u003d client.show_port(refresh_vif_id)\n                port_info \u003d data.get(\u0027port\u0027)\n                if port_info is not None:\n                    current_neutron_ports.append(port_info)\n            except neutron_client_exc.PortNotFoundClient:\n                pass\n        else:\n            data \u003d client.list_ports(**search_opts)\n            current_neutron_ports \u003d data.get(\u0027ports\u0027, [])","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"924ccb413ff8b9ea37dec0b68940520285ffcc81","unresolved":false,"context_lines":[{"line_number":2264,"context_line":"        else:"},{"line_number":2265,"context_line":"            client \u003d admin_client"},{"line_number":2266,"context_line":""},{"line_number":2267,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":2268,"context_line":""},{"line_number":2269,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":2270,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_cba65c54","line":2267,"range":{"start_line":2267,"start_character":15,"end_line":2267,"end_character":32},"in_reply_to":"ff0f0b1f_d131860d","updated":"2017-05-19 19:00:12.000000000","message":"I suppose that could work, yeah. If the port is no longer associated with the instance, then it shouldn\u0027t come back (note that I think in your proposal we\u0027d still want to filter on tenant_id and device_id, as just showing the port doesn\u0027t mean it\u0027s no longer associated to the instance we care about).\n\nThings get a little messy though later if we don\u0027t already have a nw info cache (L2321) and then we fall through to do the full rebuild, we\u0027d have to go back and get the entire list of ports again. Not hard, it\u0027s just more if/else conditional spaghetti.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"136aba397b45dc0160ea0655565830f530b4947a","unresolved":false,"context_lines":[{"line_number":2283,"context_line":"        # information for that VIF in the existing cache rather than try to"},{"line_number":2284,"context_line":"        # rebuild the entire thing."},{"line_number":2285,"context_line":"        if refresh_vif_id is not None:"},{"line_number":2286,"context_line":"            # This port is no longer associated with the instance, so simply"},{"line_number":2287,"context_line":"            # remove it from the nw_info cache."},{"line_number":2288,"context_line":"            nw_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2289,"context_line":"            if nw_info:"},{"line_number":2290,"context_line":"                current_neutron_port \u003d current_neutron_port_map.get("}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_ff3a1ee5","line":2287,"range":{"start_line":2286,"start_character":12,"end_line":2287,"end_character":47},"updated":"2017-05-18 22:05:00.000000000","message":"This needs to move.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"136aba397b45dc0160ea0655565830f530b4947a","unresolved":false,"context_lines":[{"line_number":2301,"context_line":"                    for index, vif in enumerate(nw_info):"},{"line_number":2302,"context_line":"                        if vif[\u0027id\u0027] \u003d\u003d refresh_vif_id:"},{"line_number":2303,"context_line":"                            # Update the existing entry."},{"line_number":2304,"context_line":"                            nw_info[index] \u003d vif"},{"line_number":2305,"context_line":"                            break"},{"line_number":2306,"context_line":"                    else:"},{"line_number":2307,"context_line":"                        # If it wasn\u0027t in the existing cache, add it."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_bf0dc63f","line":2304,"updated":"2017-05-18 22:05:00.000000000","message":"Could log this at debug.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"136aba397b45dc0160ea0655565830f530b4947a","unresolved":false,"context_lines":[{"line_number":2304,"context_line":"                            nw_info[index] \u003d vif"},{"line_number":2305,"context_line":"                            break"},{"line_number":2306,"context_line":"                    else:"},{"line_number":2307,"context_line":"                        # If it wasn\u0027t in the existing cache, add it."},{"line_number":2308,"context_line":"                        nw_info.append(vif)"},{"line_number":2309,"context_line":"                else:"},{"line_number":2310,"context_line":"                    # Find the VIF in the existing cache and remove it."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_df187a82","line":2307,"updated":"2017-05-18 22:05:00.000000000","message":"Could log this at debug. This case shouldn\u0027t actually happen since when we have a new port associated with an instance via allocate_for_instance or allocate_port_for_instance it should have already been refreshed and put into the cache.","commit_id":"636f930cc148c3977b63123f4cfb992d57278229"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"44ca7254e1f1091919d4ed5be9403dd3304e4380","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"                        context, instance.project_id,"},{"line_number":2320,"context_line":"                        [current_neutron_port[\u0027network_id\u0027]], client)"},{"line_number":2321,"context_line":"                    # Build the VIF model given the latest port information."},{"line_number":2322,"context_line":"                    vif \u003d self._build_vif_model("},{"line_number":2323,"context_line":"                        context, client, current_neutron_port, networks,"},{"line_number":2324,"context_line":"                        preexisting_port_ids)"},{"line_number":2325,"context_line":"                    for index, vif in enumerate(nw_info):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_c809bf31","line":2322,"range":{"start_line":2322,"start_character":20,"end_line":2322,"end_character":23},"updated":"2017-06-13 18:23:44.000000000","message":"should be \"updated_vif\" or similar since \"vif\" is used as when indexing the for loop below","commit_id":"a7d4219fcf465e1568af00f9a54010ccdddc81da"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"146d03cdd5c4a1b08a2d731eafb1658ec1a5f64e","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"                        context, instance.project_id,"},{"line_number":2320,"context_line":"                        [current_neutron_port[\u0027network_id\u0027]], client)"},{"line_number":2321,"context_line":"                    # Build the VIF model given the latest port information."},{"line_number":2322,"context_line":"                    vif \u003d self._build_vif_model("},{"line_number":2323,"context_line":"                        context, client, current_neutron_port, networks,"},{"line_number":2324,"context_line":"                        preexisting_port_ids)"},{"line_number":2325,"context_line":"                    for index, vif in enumerate(nw_info):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_16eeb887","line":2322,"range":{"start_line":2322,"start_character":20,"end_line":2322,"end_character":23},"in_reply_to":"7f231b9d_c809bf31","updated":"2017-06-13 19:21:05.000000000","message":"Nice catch.","commit_id":"a7d4219fcf465e1568af00f9a54010ccdddc81da"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"44ca7254e1f1091919d4ed5be9403dd3304e4380","unresolved":false,"context_lines":[{"line_number":2325,"context_line":"                    for index, vif in enumerate(nw_info):"},{"line_number":2326,"context_line":"                        if vif[\u0027id\u0027] \u003d\u003d refresh_vif_id:"},{"line_number":2327,"context_line":"                            # Update the existing entry."},{"line_number":2328,"context_line":"                            nw_info[index] \u003d vif"},{"line_number":2329,"context_line":"                            LOG.debug(\u0027Updated VIF entry in instance network \u0027"},{"line_number":2330,"context_line":"                                      \u0027info cache for port %s.\u0027,"},{"line_number":2331,"context_line":"                                      refresh_vif_id, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_6b006502","line":2328,"range":{"start_line":2328,"start_character":45,"end_line":2328,"end_character":48},"updated":"2017-06-13 18:23:44.000000000","message":"should be \"updated_vif\" or similar","commit_id":"a7d4219fcf465e1568af00f9a54010ccdddc81da"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"44ca7254e1f1091919d4ed5be9403dd3304e4380","unresolved":false,"context_lines":[{"line_number":2332,"context_line":"                            break"},{"line_number":2333,"context_line":"                    else:"},{"line_number":2334,"context_line":"                        # If it wasn\u0027t in the existing cache, add it."},{"line_number":2335,"context_line":"                        nw_info.append(vif)"},{"line_number":2336,"context_line":"                        LOG.debug(\u0027Added VIF to instance network info cache \u0027"},{"line_number":2337,"context_line":"                                  \u0027for port %s.\u0027, refresh_vif_id,"},{"line_number":2338,"context_line":"                                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_ab1d5d67","line":2335,"range":{"start_line":2335,"start_character":39,"end_line":2335,"end_character":42},"updated":"2017-06-13 18:23:44.000000000","message":"should be \"updated_vif\" or similar","commit_id":"a7d4219fcf465e1568af00f9a54010ccdddc81da"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7f3b9a0d101ac00e835f980eba8a8e647e6d891a","unresolved":false,"context_lines":[{"line_number":2309,"context_line":"        # rebuild the entire thing."},{"line_number":2310,"context_line":"        if refresh_vif_id is not None:"},{"line_number":2311,"context_line":"            # TODO(mriedem): Consider pulling this out into it\u0027s own method."},{"line_number":2312,"context_line":"            nw_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2313,"context_line":"            if nw_info:"},{"line_number":2314,"context_line":"                current_neutron_port \u003d current_neutron_port_map.get("},{"line_number":2315,"context_line":"                    refresh_vif_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_f1004b04","line":2312,"updated":"2017-10-27 01:23:50.000000000","message":"We\u0027re getting here but this is blowing up:\n\nhttp://logs.openstack.org/87/465787/4/check/legacy-tempest-dsvm-multinode-live-migration/ab41947/logs/subnode-2/screen-n-cpu.txt.gz#_Oct_26_23_44_15_455428","commit_id":"849a1d5126063e0828df149b2f1a475e3e510d7c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db599d69078789eee7e0c0b530aba635886f6a58","unresolved":false,"context_lines":[{"line_number":2364,"context_line":"                        if vif[\u0027id\u0027] \u003d\u003d refresh_vif_id:"},{"line_number":2365,"context_line":"                            # Update the existing entry."},{"line_number":2366,"context_line":"                            nw_info[index] \u003d refreshed_vif"},{"line_number":2367,"context_line":"                            LOG.debug(\u0027Updated VIF entry in instance network \u0027"},{"line_number":2368,"context_line":"                                      \u0027info cache for port %s.\u0027,"},{"line_number":2369,"context_line":"                                      refresh_vif_id, instance\u003dinstance)"},{"line_number":2370,"context_line":"                            break"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_28ac2a9d","line":2367,"updated":"2017-10-27 13:25:04.000000000","message":"http://logs.openstack.org/87/465787/6/check/legacy-tempest-dsvm-multinode-live-migration/5b008e5/logs/screen-n-cpu.txt.gz#_Oct_27_04_35_58_575887","commit_id":"7a0381fe90c96dd42a59c57c1cd24ae2850cb088"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db599d69078789eee7e0c0b530aba635886f6a58","unresolved":false,"context_lines":[{"line_number":2371,"context_line":"                    else:"},{"line_number":2372,"context_line":"                        # If it wasn\u0027t in the existing cache, add it."},{"line_number":2373,"context_line":"                        nw_info.append(refreshed_vif)"},{"line_number":2374,"context_line":"                        LOG.debug(\u0027Added VIF to instance network info cache \u0027"},{"line_number":2375,"context_line":"                                  \u0027for port %s.\u0027, refresh_vif_id,"},{"line_number":2376,"context_line":"                                  instance\u003dinstance)"},{"line_number":2377,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_e8917253","line":2374,"updated":"2017-10-27 13:25:04.000000000","message":"Not seeing this in the live migration CI job run, but that\u0027s a good thing as this shouldn\u0027t happen.","commit_id":"7a0381fe90c96dd42a59c57c1cd24ae2850cb088"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"db599d69078789eee7e0c0b530aba635886f6a58","unresolved":false,"context_lines":[{"line_number":2379,"context_line":"                    # simply remove it from the nw_info cache."},{"line_number":2380,"context_line":"                    for index, vif in enumerate(nw_info):"},{"line_number":2381,"context_line":"                        if vif[\u0027id\u0027] \u003d\u003d refresh_vif_id:"},{"line_number":2382,"context_line":"                            LOG.info(\u0027Port %s from network info_cache is no \u0027"},{"line_number":2383,"context_line":"                                     \u0027longer associated with instance in \u0027"},{"line_number":2384,"context_line":"                                     \u0027Neutron. Removing from network \u0027"},{"line_number":2385,"context_line":"                                     \u0027info_cache.\u0027, refresh_vif_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f4b6375_a897fa44","line":2382,"updated":"2017-10-27 13:25:04.000000000","message":"Not seeing this either, which is a good thing, means we\u0027re cleaning up properly.","commit_id":"7a0381fe90c96dd42a59c57c1cd24ae2850cb088"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"73f0c8ad98b59d186e94c2f218990ed4fe8887ee","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"                   {\u0027port_id\u0027: port_id, \u0027reason\u0027: exc})"},{"line_number":1375,"context_line":"            raise exception.NovaException(message\u003dmsg)"},{"line_number":1376,"context_line":""},{"line_number":1377,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":1378,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone,"},{"line_number":1379,"context_line":"                              preexisting_port_ids\u003dNone,"},{"line_number":1380,"context_line":"                              refresh_vif_id\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_4e7aee23","line":1377,"range":{"start_line":1377,"start_character":8,"end_line":1377,"end_character":29},"updated":"2018-06-01 12:57:03.000000000","message":"note to self: We don\u0027t need to modify \u0027get_instance_nw_info\u0027 in base_api.py because that takes a kwargs argument and the nova-net version of this function ignores that argument","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"61b5d8261b501eefb4c46d2b97d52be89520ae8f","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"                return nw_info"},{"line_number":2452,"context_line":"            # else there is no existing cache and we need to build it"},{"line_number":2453,"context_line":""},{"line_number":2454,"context_line":"        nw_info_refresh \u003d networks is None and port_ids is None"},{"line_number":2455,"context_line":"        networks, port_ids \u003d self._gather_port_ids_and_networks("},{"line_number":2456,"context_line":"                context, instance, networks, port_ids, client)"},{"line_number":2457,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":2458,"context_line":""},{"line_number":2459,"context_line":"        for port_id in port_ids:"},{"line_number":2460,"context_line":"            current_neutron_port \u003d current_neutron_port_map.get(port_id)"},{"line_number":2461,"context_line":"            if current_neutron_port:"},{"line_number":2462,"context_line":"                vif \u003d self._build_vif_model("},{"line_number":2463,"context_line":"                    context, client, current_neutron_port, networks,"},{"line_number":2464,"context_line":"                    preexisting_port_ids)"},{"line_number":2465,"context_line":"                nw_info.append(vif)"},{"line_number":2466,"context_line":"            elif nw_info_refresh:"},{"line_number":2467,"context_line":"                LOG.info(\u0027Port %s from network info_cache is no \u0027"},{"line_number":2468,"context_line":"                         \u0027longer associated with instance in Neutron. \u0027"},{"line_number":2469,"context_line":"                         \u0027Removing from network info_cache.\u0027, port_id,"},{"line_number":2470,"context_line":"                         instance\u003dinstance)"},{"line_number":2471,"context_line":""},{"line_number":2472,"context_line":"        return nw_info"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"    def _get_subnets_from_port(self, context, port, client\u003dNone):"},{"line_number":2475,"context_line":"        \"\"\"Return the subnets for a given port.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_12811590","line":2472,"range":{"start_line":2454,"start_character":7,"end_line":2472,"end_character":22},"updated":"2018-01-26 20:56:31.000000000","message":"you are not wrapping this in an else clause  for \"if refresh_vif_id is not None:\"\nbecause nw_info on line 2413 could be none and therefore we could would have to build it from scratch.\n\ni guess that makes sense though i proably would have inverted the order of the ifs. e.g. checek if tis in the cache then branch on if refresh_vif_id is not none.\n\nthis works however and im not sure the inversion would save any work so its only a minor nit regarding this was unintuitive to me on first reading so proably not worth changing.","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"73f0c8ad98b59d186e94c2f218990ed4fe8887ee","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"                return nw_info"},{"line_number":2452,"context_line":"            # else there is no existing cache and we need to build it"},{"line_number":2453,"context_line":""},{"line_number":2454,"context_line":"        nw_info_refresh \u003d networks is None and port_ids is None"},{"line_number":2455,"context_line":"        networks, port_ids \u003d self._gather_port_ids_and_networks("},{"line_number":2456,"context_line":"                context, instance, networks, port_ids, client)"},{"line_number":2457,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":2458,"context_line":""},{"line_number":2459,"context_line":"        for port_id in port_ids:"},{"line_number":2460,"context_line":"            current_neutron_port \u003d current_neutron_port_map.get(port_id)"},{"line_number":2461,"context_line":"            if current_neutron_port:"},{"line_number":2462,"context_line":"                vif \u003d self._build_vif_model("},{"line_number":2463,"context_line":"                    context, client, current_neutron_port, networks,"},{"line_number":2464,"context_line":"                    preexisting_port_ids)"},{"line_number":2465,"context_line":"                nw_info.append(vif)"},{"line_number":2466,"context_line":"            elif nw_info_refresh:"},{"line_number":2467,"context_line":"                LOG.info(\u0027Port %s from network info_cache is no \u0027"},{"line_number":2468,"context_line":"                         \u0027longer associated with instance in Neutron. \u0027"},{"line_number":2469,"context_line":"                         \u0027Removing from network info_cache.\u0027, port_id,"},{"line_number":2470,"context_line":"                         instance\u003dinstance)"},{"line_number":2471,"context_line":""},{"line_number":2472,"context_line":"        return nw_info"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"    def _get_subnets_from_port(self, context, port, client\u003dNone):"},{"line_number":2475,"context_line":"        \"\"\"Return the subnets for a given port.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_aeb942cc","line":2472,"range":{"start_line":2454,"start_character":7,"end_line":2472,"end_character":22},"in_reply_to":"5f7c97a3_c4e963b7","updated":"2018-06-01 12:57:03.000000000","message":"I find this kind of pattern pretty intuitive, personally :) Agree that it could do with being split out if/when we figure out a clean way to do so though","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"781f2434b5a1f52a82b4f3c06522898d448bfcf9","unresolved":false,"context_lines":[{"line_number":2451,"context_line":"                return nw_info"},{"line_number":2452,"context_line":"            # else there is no existing cache and we need to build it"},{"line_number":2453,"context_line":""},{"line_number":2454,"context_line":"        nw_info_refresh \u003d networks is None and port_ids is None"},{"line_number":2455,"context_line":"        networks, port_ids \u003d self._gather_port_ids_and_networks("},{"line_number":2456,"context_line":"                context, instance, networks, port_ids, client)"},{"line_number":2457,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":2458,"context_line":""},{"line_number":2459,"context_line":"        for port_id in port_ids:"},{"line_number":2460,"context_line":"            current_neutron_port \u003d current_neutron_port_map.get(port_id)"},{"line_number":2461,"context_line":"            if current_neutron_port:"},{"line_number":2462,"context_line":"                vif \u003d self._build_vif_model("},{"line_number":2463,"context_line":"                    context, client, current_neutron_port, networks,"},{"line_number":2464,"context_line":"                    preexisting_port_ids)"},{"line_number":2465,"context_line":"                nw_info.append(vif)"},{"line_number":2466,"context_line":"            elif nw_info_refresh:"},{"line_number":2467,"context_line":"                LOG.info(\u0027Port %s from network info_cache is no \u0027"},{"line_number":2468,"context_line":"                         \u0027longer associated with instance in Neutron. \u0027"},{"line_number":2469,"context_line":"                         \u0027Removing from network info_cache.\u0027, port_id,"},{"line_number":2470,"context_line":"                         instance\u003dinstance)"},{"line_number":2471,"context_line":""},{"line_number":2472,"context_line":"        return nw_info"},{"line_number":2473,"context_line":""},{"line_number":2474,"context_line":"    def _get_subnets_from_port(self, context, port, client\u003dNone):"},{"line_number":2475,"context_line":"        \"\"\"Return the subnets for a given port.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_c4e963b7","line":2472,"range":{"start_line":2454,"start_character":7,"end_line":2472,"end_character":22},"in_reply_to":"5f93b717_12811590","updated":"2018-05-10 14:13:20.000000000","message":"It\u0027s also why I have a TODO on 2411 to consider pulling the method out, but the messy part about that is the method would have to raise an exception or return some kind of sentinel to adjust the flow control for the rest of this method, i.e. does this method return what\u0027s returned from the separate method, or continue down this path?","commit_id":"537f480927293755bd6365068c1abd0c80951bad"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"61b5d8261b501eefb4c46d2b97d52be89520ae8f","unresolved":false,"context_lines":[{"line_number":6328,"context_line":"        self.api \u003d neutronapi.API()"},{"line_number":6329,"context_line":"        self.context \u003d context.RequestContext(uuids.user_id, uuids.project_id)"},{"line_number":6330,"context_line":"        self.instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":6331,"context_line":"        client_mock \u003d mock.patch(\u0027nova.network.neutronv2.api.get_client\u0027)"},{"line_number":6332,"context_line":"        self.client \u003d client_mock.start().return_value"},{"line_number":6333,"context_line":"        self.addCleanup(client_mock.stop)"},{"line_number":6334,"context_line":"        # This is a no-db set of tests and we don\u0027t care about refreshing the"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_92144550","line":6331,"range":{"start_line":6331,"start_character":8,"end_line":6331,"end_character":73},"updated":"2018-01-26 20:56:31.000000000","message":"minor nit but elsewhere in the file we use the decorator form of creating mocks so it might be preferable to also use it for these new tests for consistency","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b5a8bd08eda69a81f37c96ed130e7c0116f483d0","unresolved":false,"context_lines":[{"line_number":6328,"context_line":"        self.api \u003d neutronapi.API()"},{"line_number":6329,"context_line":"        self.context \u003d context.RequestContext(uuids.user_id, uuids.project_id)"},{"line_number":6330,"context_line":"        self.instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":6331,"context_line":"        client_mock \u003d mock.patch(\u0027nova.network.neutronv2.api.get_client\u0027)"},{"line_number":6332,"context_line":"        self.client \u003d client_mock.start().return_value"},{"line_number":6333,"context_line":"        self.addCleanup(client_mock.stop)"},{"line_number":6334,"context_line":"        # This is a no-db set of tests and we don\u0027t care about refreshing the"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_287cdeb3","line":6331,"range":{"start_line":6331,"start_character":8,"end_line":6331,"end_character":73},"in_reply_to":"5f93b717_92144550","updated":"2018-01-26 22:42:09.000000000","message":"With this I don\u0027t have to duplicate a bunch of decorators.","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"61b5d8261b501eefb4c46d2b97d52be89520ae8f","unresolved":false,"context_lines":[{"line_number":6366,"context_line":"        self.client.list_ports.return_value \u003d {"},{"line_number":6367,"context_line":"            \u0027ports\u0027: [self._get_fake_port(uuids.old_port),"},{"line_number":6368,"context_line":"                      self._get_fake_port(uuids.new_port)]}"},{"line_number":6369,"context_line":"        with test.nested("},{"line_number":6370,"context_line":"            mock.patch.object(self.api, \u0027_get_available_networks\u0027,"},{"line_number":6371,"context_line":"                              return_value\u003d[{\u0027id\u0027: uuids.network_id}]),"},{"line_number":6372,"context_line":"            mock.patch.object(self.api, \u0027_build_vif_model\u0027,"},{"line_number":6373,"context_line":"                              return_value\u003dmodel.VIF(uuids.new_port)),"},{"line_number":6374,"context_line":"            # We should not get as far as calling _gather_port_ids_and_networks"},{"line_number":6375,"context_line":"            mock.patch.object(self.api, \u0027_gather_port_ids_and_networks\u0027,"},{"line_number":6376,"context_line":"                              new_callable\u003dmock.NonCallableMock)"},{"line_number":6377,"context_line":"        ) as ("},{"line_number":6378,"context_line":"            get_nets, build_vif, gather_ports"},{"line_number":6379,"context_line":"        ):"},{"line_number":6380,"context_line":"            nwinfo \u003d self.api._get_instance_nw_info("}],"source_content_type":"text/x-python","patch_set":7,"id":"5f93b717_ad5a4027","line":6377,"range":{"start_line":6369,"start_character":7,"end_line":6377,"end_character":14},"updated":"2018-01-26 20:56:31.000000000","message":"same regarding the use of with test.nested.\n\ntest.nested had to be modifed to be python2/3 compatible\nthe decorator form is implcitly python2/3 compatible\nso i prefer to use it when we can so we dont have to \npropagte  this if https://github.com/openstack/nova/blob/master/nova/test.py#L78-L84\n\ninto all new libs/projects we create\n\nagain its a minor nit. nova already supports this usecase via test.nested but in the long run i would hope we can phase this out in favour of using the decorators.","commit_id":"537f480927293755bd6365068c1abd0c80951bad"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"73f0c8ad98b59d186e94c2f218990ed4fe8887ee","unresolved":false,"context_lines":[{"line_number":6366,"context_line":"        self.client.list_ports.return_value \u003d {"},{"line_number":6367,"context_line":"            \u0027ports\u0027: [self._get_fake_port(uuids.old_port),"},{"line_number":6368,"context_line":"                      self._get_fake_port(uuids.new_port)]}"},{"line_number":6369,"context_line":"        with test.nested("},{"line_number":6370,"context_line":"            mock.patch.object(self.api, \u0027_get_available_networks\u0027,"},{"line_number":6371,"context_line":"                              return_value\u003d[{\u0027id\u0027: uuids.network_id}]),"},{"line_number":6372,"context_line":"            mock.patch.object(self.api, \u0027_build_vif_model\u0027,"},{"line_number":6373,"context_line":"                              return_value\u003dmodel.VIF(uuids.new_port)),"},{"line_number":6374,"context_line":"            # We should not get as far as calling _gather_port_ids_and_networks"},{"line_number":6375,"context_line":"            mock.patch.object(self.api, \u0027_gather_port_ids_and_networks\u0027,"},{"line_number":6376,"context_line":"                              new_callable\u003dmock.NonCallableMock)"},{"line_number":6377,"context_line":"        ) as ("},{"line_number":6378,"context_line":"            get_nets, build_vif, gather_ports"},{"line_number":6379,"context_line":"        ):"},{"line_number":6380,"context_line":"            nwinfo \u003d self.api._get_instance_nw_info("}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_0e70763f","line":6377,"range":{"start_line":6369,"start_character":7,"end_line":6377,"end_character":14},"in_reply_to":"5f93b717_ad5a4027","updated":"2018-06-01 12:57:03.000000000","message":"I would generally agree but, alas, we need to use this because we need access to \u0027self.api\u0027, which is only available within the scope of the function","commit_id":"537f480927293755bd6365068c1abd0c80951bad"}]}
