)]}'
{"neutron/agent/rpc.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"528a5c67a87846af870ecc5bf4d63ec92b76b875","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                context, port_id\u003dresource_id, host\u003dhost_with_activation)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            payload \u003d {rtype: {\u0027id\u0027: resource_id},"},{"line_number":219,"context_line":"                       \u0027%s_id\u0027 % rtype: resource_id}"},{"line_number":220,"context_line":"            getattr(self._legacy_interface, method)(context, **payload)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _get_method_host(self, rtype, event, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_956ad218","line":219,"updated":"2018-06-20 11:12:30.000000000","message":"why host is not included in this payload anymore?","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8a4f5c0a22e0bb6e80d6664f66f9deaf85da0b7a","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                context, port_id\u003dresource_id, host\u003dhost_with_activation)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            payload \u003d {rtype: {\u0027id\u0027: resource_id},"},{"line_number":219,"context_line":"                       \u0027%s_id\u0027 % rtype: resource_id}"},{"line_number":220,"context_line":"            getattr(self._legacy_interface, method)(context, **payload)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _get_method_host(self, rtype, event, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_3d438ab2","line":219,"in_reply_to":"5f7c97a3_0e8d3fd3","updated":"2018-06-21 12:11:49.000000000","message":"ok, thx.","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"846217ed2db76c9aa241ee951c3b64abcba26bb5","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                context, port_id\u003dresource_id, host\u003dhost_with_activation)"},{"line_number":217,"context_line":"        else:"},{"line_number":218,"context_line":"            payload \u003d {rtype: {\u0027id\u0027: resource_id},"},{"line_number":219,"context_line":"                       \u0027%s_id\u0027 % rtype: resource_id}"},{"line_number":220,"context_line":"            getattr(self._legacy_interface, method)(context, **payload)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _get_method_host(self, rtype, event, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_0e8d3fd3","line":219,"in_reply_to":"5f7c97a3_956ad218","updated":"2018-06-21 03:21:38.000000000","message":"I introduced host in the payload here: https://review.openstack.org/#/c/567461/2/neutron/agent/rpc.py@210. At that point in time, it made sense to reuse L220 below to call the binding_deactivate method also. But now, we have to call binding_deactivate and binding_activate with different hosts, which is done in L213-216. The host argument doesn\u0027t make sense anymore in the payload to the call in L220","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"528a5c67a87846af870ecc5bf4d63ec92b76b875","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            LOG.debug(\"Device %s has no active binding in this host\","},{"line_number":294,"context_line":"                      port_obj)"},{"line_number":295,"context_line":"            return {\u0027device\u0027: device,"},{"line_number":296,"context_line":"                    \u0027no_active_binding\u0027: True}"},{"line_number":297,"context_line":"        net \u003d self.remote_resource_cache.get_resource_by_id("},{"line_number":298,"context_line":"            resources.NETWORK, port_obj.network_id)"},{"line_number":299,"context_line":"        net_qos_policy_id \u003d net.qos_policy_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_d5384aef","line":296,"range":{"start_line":296,"start_character":20,"end_line":296,"end_character":39},"updated":"2018-06-20 11:12:30.000000000","message":"maybe this could be defined as constant somewhere as it is used also in different files?","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"846217ed2db76c9aa241ee951c3b64abcba26bb5","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            LOG.debug(\"Device %s has no active binding in this host\","},{"line_number":294,"context_line":"                      port_obj)"},{"line_number":295,"context_line":"            return {\u0027device\u0027: device,"},{"line_number":296,"context_line":"                    \u0027no_active_binding\u0027: True}"},{"line_number":297,"context_line":"        net \u003d self.remote_resource_cache.get_resource_by_id("},{"line_number":298,"context_line":"            resources.NETWORK, port_obj.network_id)"},{"line_number":299,"context_line":"        net_qos_policy_id \u003d net.qos_policy_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_19302be9","line":296,"range":{"start_line":296,"start_character":20,"end_line":296,"end_character":39},"in_reply_to":"5f7c97a3_d5384aef","updated":"2018-06-21 03:21:38.000000000","message":"Done","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"952df238e5f085b0414a5a0b99a509d4dd596c83","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            return"},{"line_number":210,"context_line":"        # If there is a binding deactivation, we must also notify the"},{"line_number":211,"context_line":"        # corresponding activation"},{"line_number":212,"context_line":"        if method \u003d\u003d \u0027binding_deactivate\u0027:"},{"line_number":213,"context_line":"            self._legacy_interface.binding_deactivate("},{"line_number":214,"context_line":"                context, port_id\u003dresource_id, host\u003dhost_with_deactivation)"},{"line_number":215,"context_line":"            self._legacy_interface.binding_activate("}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_d4d37162","line":212,"range":{"start_line":212,"start_character":21,"end_line":212,"end_character":41},"updated":"2018-07-16 10:25:39.000000000","message":"shouldn\u0027t You define it somewhere as constant?","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0d520247376f0456a9ce3192018cf29acb27bda7","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            return"},{"line_number":210,"context_line":"        # If there is a binding deactivation, we must also notify the"},{"line_number":211,"context_line":"        # corresponding activation"},{"line_number":212,"context_line":"        if method \u003d\u003d \u0027binding_deactivate\u0027:"},{"line_number":213,"context_line":"            self._legacy_interface.binding_deactivate("},{"line_number":214,"context_line":"                context, port_id\u003dresource_id, host\u003dhost_with_deactivation)"},{"line_number":215,"context_line":"            self._legacy_interface.binding_activate("}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_915702ca","line":212,"range":{"start_line":212,"start_character":21,"end_line":212,"end_character":41},"in_reply_to":"5f7c97a3_d4d37162","updated":"2018-07-18 16:58:37.000000000","message":"Done","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"27751938984a115fe368896c2115d3412d27a685","unresolved":false,"context_lines":[{"line_number":1598,"context_line":"                    # Port was added to the bridge, but its binding in this"},{"line_number":1599,"context_line":"                    # agent hasn\u0027t been activated yet. It will be treated as"},{"line_number":1600,"context_line":"                    # added when binding is activated"},{"line_number":1601,"context_line":"                    LOG.debug(\"Device %s has no active binding in host\","},{"line_number":1602,"context_line":"                              device)"},{"line_number":1603,"context_line":"                else:"},{"line_number":1604,"context_line":"                    LOG.warning("}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_7766df53","line":1601,"updated":"2018-06-12 23:05:46.000000000","message":"Consider adding device to skipped_devices or adding a \u0027no_active_binding\u0027 section to port_info so it can be used in L1723","commit_id":"af0d61ad819c6e270b98e17d779011ebe240b663"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"528a5c67a87846af870ecc5bf4d63ec92b76b875","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            return"},{"line_number":425,"context_line":"        port_id \u003d kwargs.get(\u0027port_id\u0027)"},{"line_number":426,"context_line":"        self.deactivated_bindings.add(port_id)"},{"line_number":427,"context_line":"        LOG.debug(\"mlavalle binding_deactivate message processed for port \""},{"line_number":428,"context_line":"                  \"%s\", port_id)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    def binding_activate(self, context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_55575a27","line":427,"range":{"start_line":427,"start_character":19,"end_line":427,"end_character":27},"updated":"2018-06-20 11:12:30.000000000","message":"I think that You forgot to remove/change it :)","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"846217ed2db76c9aa241ee951c3b64abcba26bb5","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            return"},{"line_number":425,"context_line":"        port_id \u003d kwargs.get(\u0027port_id\u0027)"},{"line_number":426,"context_line":"        self.deactivated_bindings.add(port_id)"},{"line_number":427,"context_line":"        LOG.debug(\"mlavalle binding_deactivate message processed for port \""},{"line_number":428,"context_line":"                  \"%s\", port_id)"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"    def binding_activate(self, context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_88c6279c","line":427,"range":{"start_line":427,"start_character":19,"end_line":427,"end_character":27},"in_reply_to":"5f7c97a3_55575a27","updated":"2018-06-21 03:21:38.000000000","message":"Done","commit_id":"d1707a5331fb3c51a8bb56c951aa576270d4e592"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"3052ed3dbe8eb1f98660aafe492ccfd6a87b6fd6","unresolved":false,"context_lines":[{"line_number":1596,"context_line":"                    # Port was added to the bridge, but its binding in this"},{"line_number":1597,"context_line":"                    # agent hasn\u0027t been activated yet. It will be treated as"},{"line_number":1598,"context_line":"                    # added when binding is activated"},{"line_number":1599,"context_line":"                    binding_no_activated_devices.add(device)"},{"line_number":1600,"context_line":"                    LOG.debug(\"Device %s has no active binding in host\","},{"line_number":1601,"context_line":"                              device)"},{"line_number":1602,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_23cf0d8c","line":1599,"range":{"start_line":1599,"start_character":0,"end_line":1599,"end_character":60},"updated":"2018-07-16 07:55:59.000000000","message":"Treat the activated as added. But I have a question need to be clear here, if we just create a port binding, not activate. We process it as a updated one, and the rpc \"port update\" will be sent out by ml2 plugin. Is that correct? Then the first loop, agent will prepare the necessary port resources, such as port add into the linux bridge/ovs-bridge. The next(second) loop, we collect them from server and escape from the existing port holded by agent. As a single loop, I found it may not possible to do 2 steps. Please fell free to correct. :)","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0d520247376f0456a9ce3192018cf29acb27bda7","unresolved":false,"context_lines":[{"line_number":1596,"context_line":"                    # Port was added to the bridge, but its binding in this"},{"line_number":1597,"context_line":"                    # agent hasn\u0027t been activated yet. It will be treated as"},{"line_number":1598,"context_line":"                    # added when binding is activated"},{"line_number":1599,"context_line":"                    binding_no_activated_devices.add(device)"},{"line_number":1600,"context_line":"                    LOG.debug(\"Device %s has no active binding in host\","},{"line_number":1601,"context_line":"                              device)"},{"line_number":1602,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_f1bd16b2","line":1599,"range":{"start_line":1599,"start_character":0,"end_line":1599,"end_character":60},"in_reply_to":"5f7c97a3_23cf0d8c","updated":"2018-07-18 16:58:37.000000000","message":"This is to handle the case where the vif has been added to br-int by Nova but the binding is inactive for that host. We want the agent not to wire the vif until the binding is activated","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"dacce961fceb23bbb8e8a55daf48ccb95f1ca3bb","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"                self._update_port_network(details[\u0027port_id\u0027],"},{"line_number":1576,"context_line":"                                          details[\u0027network_id\u0027])"},{"line_number":1577,"context_line":"                self.ext_manager.handle_port(self.context, details)"},{"line_number":1578,"context_line":"            else:"},{"line_number":1579,"context_line":"                LOG.warning("},{"line_number":1580,"context_line":"                    \"Device %s not defined on plugin or binding failed\","},{"line_number":1581,"context_line":"                    device)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_b5ffdbff","side":"PARENT","line":1578,"updated":"2019-01-23 20:14:43.000000000","message":"Before this change:\n\nif not \u0027port_id\u0027 in details\n\nmeant that the port or its binding wasn\u0027t found in the neutron server through the RPC call in L1537 above. As a consequence, even though the agent has found a corresponding VIF connected to br-int, we are going to set it up as a dead port, because we don\u0027t know anything about it and we don\u0027t want to create a security risk. By setting the port as dead, we prevent it from being able to listen to traffic in br-int","commit_id":"0694bebd6de3934528492aadb78e3048dd5a07ea"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8f3b87c6186aa0bd53a37a962ef06916ef6bdef6","unresolved":false,"context_lines":[{"line_number":1591,"context_line":"                self._update_port_network(details[\u0027port_id\u0027],"},{"line_number":1592,"context_line":"                                          details[\u0027network_id\u0027])"},{"line_number":1593,"context_line":"                self.ext_manager.handle_port(self.context, details)"},{"line_number":1594,"context_line":"            else:"},{"line_number":1595,"context_line":"                if c_const.NO_ACTIVE_BINDING in details:"},{"line_number":1596,"context_line":"                    # Port was added to the bridge, but its binding in this"},{"line_number":1597,"context_line":"                    # agent hasn\u0027t been activated yet. It will be treated as"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_7541730b","line":1594,"updated":"2019-01-23 20:18:54.000000000","message":"\u003c------ Please see at my comment on the left side of the screen","commit_id":"5c3bf124966a310cbc6c8ffad5ab30b144d9d7aa"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"dacce961fceb23bbb8e8a55daf48ccb95f1ca3bb","unresolved":false,"context_lines":[{"line_number":1592,"context_line":"                                          details[\u0027network_id\u0027])"},{"line_number":1593,"context_line":"                self.ext_manager.handle_port(self.context, details)"},{"line_number":1594,"context_line":"            else:"},{"line_number":1595,"context_line":"                if c_const.NO_ACTIVE_BINDING in details:"},{"line_number":1596,"context_line":"                    # Port was added to the bridge, but its binding in this"},{"line_number":1597,"context_line":"                    # agent hasn\u0027t been activated yet. It will be treated as"},{"line_number":1598,"context_line":"                    # added when binding is activated"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_155fc70e","line":1595,"updated":"2019-01-23 20:14:43.000000000","message":"After this change, we have a new case. We found the port and its binding in the neutron server through the call in L1553 above, but:\n\n1) not \u0027port_id\u0027 in details and\n2) c_const.NO_ACTIVE_BINDING in details\n\nso we know the active binding is not in this host: https://github.com/openstack/neutron/blob/master/neutron/agent/rpc.py#L297:L303. The instance that uses this port is most likely being migrated and is in step 2 as described in this commit message: https://review.openstack.org/#/c/574058/15//COMMIT_MSG. In the near future (step 3 of the previously mentioned commit message) a binding will be activated in this host. But until that happens, we also have to set up the port in this host as dead, because, again, we don\u0027t want to create a security risk. When the binding is activated, the VIF / port will be correctly re-wired by the agent because it will be treated as a newly added VIF / port. Please see L429-433 and L479-483 above....","commit_id":"5c3bf124966a310cbc6c8ffad5ab30b144d9d7aa"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"dacce961fceb23bbb8e8a55daf48ccb95f1ca3bb","unresolved":false,"context_lines":[{"line_number":1600,"context_line":"                    LOG.debug(\"Device %s has no active binding in host\","},{"line_number":1601,"context_line":"                              device)"},{"line_number":1602,"context_line":"                else:"},{"line_number":1603,"context_line":"                    LOG.warning("},{"line_number":1604,"context_line":"                        \"Device %s not defined on plugin or binding failed\","},{"line_number":1605,"context_line":"                        device)"},{"line_number":1606,"context_line":"                if (port and port.ofport !\u003d -1):"}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_b5e91b1b","line":1603,"updated":"2019-01-23 20:14:43.000000000","message":".... but we still have the old case, where the port wasn\u0027t found in the neutron server. We still have to set this port as dead","commit_id":"5c3bf124966a310cbc6c8ffad5ab30b144d9d7aa"}],"neutron/tests/unit/agent/test_rpc.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"952df238e5f085b0414a5a0b99a509d4dd596c83","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self._segment_id \u003d uuidutils.generate_uuid()"},{"line_number":185,"context_line":"        self._segment \u003d network.NetworkSegment(id\u003dself._segment_id,"},{"line_number":186,"context_line":"                                               network_id\u003dself._network_id,"},{"line_number":187,"context_line":"                                               network_type\u003d\u0027flat\u0027)"},{"line_number":188,"context_line":"        self._port_id \u003d uuidutils.generate_uuid()"},{"line_number":189,"context_line":"        self._network \u003d network.Network(id\u003dself._network_id,"},{"line_number":190,"context_line":"                                        segments\u003d[self._segment])"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_14dc8943","line":187,"range":{"start_line":187,"start_character":60,"end_line":187,"end_character":66},"updated":"2018-07-16 10:25:39.000000000","message":"nit: there is constant for this in neutron_lib.constants: https://github.com/openstack/neutron-lib/blob/master/neutron_lib/constants.py#L284","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0d520247376f0456a9ce3192018cf29acb27bda7","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self._segment_id \u003d uuidutils.generate_uuid()"},{"line_number":185,"context_line":"        self._segment \u003d network.NetworkSegment(id\u003dself._segment_id,"},{"line_number":186,"context_line":"                                               network_id\u003dself._network_id,"},{"line_number":187,"context_line":"                                               network_type\u003d\u0027flat\u0027)"},{"line_number":188,"context_line":"        self._port_id \u003d uuidutils.generate_uuid()"},{"line_number":189,"context_line":"        self._network \u003d network.Network(id\u003dself._network_id,"},{"line_number":190,"context_line":"                                        segments\u003d[self._segment])"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f7c97a3_d1bd7ad7","line":187,"range":{"start_line":187,"start_character":60,"end_line":187,"end_character":66},"in_reply_to":"5f7c97a3_14dc8943","updated":"2018-07-18 16:58:37.000000000","message":"Done","commit_id":"e7de6ef3f21a9e33fd9ff6880868f8cefd01128a"}]}
