)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"996cf1e917d4488b3718f41aac7589c696965f2c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"because we don\u0027t know where the active router is."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This is why the proposed change would only create the necessary tunnel"},{"line_number":14,"context_line":"but no FDB entry to the router itself."},{"line_number":15,"context_line":"It\u0027s expected that the underlying switching fabric would do plain old"},{"line_number":16,"context_line":"learning switch logic for unknown traffic in order to work."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a961159_a611a5f9","line":14,"updated":"2015-01-16 16:10:38.000000000","message":"ok let\u0027s keep on implementing the patch this way, even if this will result in having a solution which is not compatible with LB. This can be addressed by a later patch for a dedicated bug.\n\nAFAIK, this is how DVR port are treated, by only sending FLOODING fdb entries.\nSO I think that some factorization is needed here.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":11,"context_line":"because we don\u0027t know where the active router is."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This is why the proposed change would only create the necessary tunnel"},{"line_number":14,"context_line":"but no FDB entry to the router itself."},{"line_number":15,"context_line":"It\u0027s expected that the underlying switching fabric would do plain old"},{"line_number":16,"context_line":"learning switch logic for unknown traffic in order to work."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a961159_9fa3c342","line":14,"in_reply_to":"3a961159_7e372bfe","updated":"2015-01-20 10:13:50.000000000","message":"By factorization, I mean that the port should be bound with the DVR binding table.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"fa403e37753e12689121d2ef5464ec24cb12f728","unresolved":false,"context_lines":[{"line_number":11,"context_line":"because we don\u0027t know where the active router is."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This is why the proposed change would only create the necessary tunnel"},{"line_number":14,"context_line":"but no FDB entry to the router itself."},{"line_number":15,"context_line":"It\u0027s expected that the underlying switching fabric would do plain old"},{"line_number":16,"context_line":"learning switch logic for unknown traffic in order to work."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3a961159_7e372bfe","line":14,"in_reply_to":"3a961159_a611a5f9","updated":"2015-01-18 09:07:54.000000000","message":"Yes it makes more sense to split up the bug since this fix won\u0027t fit LB.\n\nIndeed it is similar to DVR but different in the way it\u0027s deduced since we don\u0027t have a dedicated bindings table.\n\nCan you please explain what you mean by \"I think that some factorization is needed here.\"?","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"}],"neutron/api/rpc/handlers/l3_rpc.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1759a4c219c0c858e21d866305734d960ee008ac","unresolved":false,"context_lines":[{"line_number":131,"context_line":"             portbindings.VIF_TYPE_BINDING_FAILED)):"},{"line_number":132,"context_line":"            # All ports, including ports created for SNAT\u0027ing for"},{"line_number":133,"context_line":"            # DVR are handled here"},{"line_number":134,"context_line":"            try:"},{"line_number":135,"context_line":"                # Ports owned by non-HA routers are bound again if they\u0027re"},{"line_number":136,"context_line":"                # already bound but the router moved to another host."},{"line_number":137,"context_line":"                if not distributed_port:"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_37871911","line":134,"updated":"2015-06-14 19:05:52.000000000","message":"The try/except is too wide now. It needs to surround only update_port invocations but it\u0027s also surrounding get_active_host_for_ha_router now. There\u0027s zero harm in this as get_active_host_for_ha_router cannot presently raise a PortNotFound exception, but I think you\u0027ll agree this still smells a bit.","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"c04771b2ced797541887fd3bfdba01f36493269e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"             portbindings.VIF_TYPE_BINDING_FAILED)):"},{"line_number":132,"context_line":"            # All ports, including ports created for SNAT\u0027ing for"},{"line_number":133,"context_line":"            # DVR are handled here"},{"line_number":134,"context_line":"            try:"},{"line_number":135,"context_line":"                # Ports owned by non-HA routers are bound again if they\u0027re"},{"line_number":136,"context_line":"                # already bound but the router moved to another host."},{"line_number":137,"context_line":"                if not distributed_port:"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_f968b4bc","line":134,"in_reply_to":"fa32b979_37871911","updated":"2015-06-15 11:25:45.000000000","message":"+1","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"30363584c969ea810693fececc172f5fe89da86b","unresolved":false,"context_lines":[{"line_number":131,"context_line":"             portbindings.VIF_TYPE_BINDING_FAILED)):"},{"line_number":132,"context_line":"            # All ports, including ports created for SNAT\u0027ing for"},{"line_number":133,"context_line":"            # DVR are handled here"},{"line_number":134,"context_line":"            try:"},{"line_number":135,"context_line":"                # Ports owned by non-HA routers are bound again if they\u0027re"},{"line_number":136,"context_line":"                # already bound but the router moved to another host."},{"line_number":137,"context_line":"                if not distributed_port:"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_51a82277","line":134,"in_reply_to":"fa32b979_37871911","updated":"2015-07-16 12:13:11.000000000","message":"Done","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fddb2a1caf34563f601fa850cd3c29f1810bc405","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                              router[\u0027id\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _ensure_host_set_on_port(self, context, host, port, router_id\u003dNone,"},{"line_number":125,"context_line":"                                 distributed_port\u003dFalse):"},{"line_number":126,"context_line":"        if (port and host is not None and"},{"line_number":127,"context_line":"            (port.get(\u0027device_owner\u0027) !\u003d"},{"line_number":128,"context_line":"             constants.DEVICE_OWNER_DVR_INTERFACE and"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba3cc151_32472379","line":125,"updated":"2015-07-10 13:21:45.000000000","message":"nit: distributed can be confusing, dvr is also distributed. ha_port ?","commit_id":"225e984ef42f2c3250a68d879ff0ff5badb60066"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fddb2a1caf34563f601fa850cd3c29f1810bc405","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                            host \u003d active_host"},{"line_number":152,"context_line":"                        # If there is currently no active router instance (For"},{"line_number":153,"context_line":"                        # example it\u0027s a new router), the host that requested"},{"line_number":154,"context_line":"                        # the routers (Essentially a random host) will do. The"},{"line_number":155,"context_line":"                        # port binding will be corrected when an active is"},{"line_number":156,"context_line":"                        # elected."},{"line_number":157,"context_line":"                        self.plugin.update_port("}],"source_content_type":"text/x-python","patch_set":24,"id":"ba3cc151_12a3ff01","line":154,"updated":"2015-07-10 13:21:45.000000000","message":"I know the method is called \"_ensure_host_set_on_port\" I was just wondering what problem arises if the port is left unbound","commit_id":"225e984ef42f2c3250a68d879ff0ff5badb60066"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"90924fb725275fec44ab735f8ab26fe5d40ef9ce","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                    context, host,"},{"line_number":109,"context_line":"                    router.get(\u0027gw_port\u0027),"},{"line_number":110,"context_line":"                    router[\u0027id\u0027],"},{"line_number":111,"context_line":"                    distributed_port\u003drouter.get(\u0027ha\u0027))"},{"line_number":112,"context_line":"            for interface in router.get(constants.INTERFACE_KEY, []):"},{"line_number":113,"context_line":"                self._ensure_host_set_on_port("},{"line_number":114,"context_line":"                    context,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a50d1a3_eeb68b89","line":111,"updated":"2015-07-21 01:28:53.000000000","message":"distributed_port to ha_router_port","commit_id":"54bdb48b163fd71642c42a1acb02225036311d95"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"6b182df269306814a5122d467de09b34b57ff1b8","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                    context, host,"},{"line_number":109,"context_line":"                    router.get(\u0027gw_port\u0027),"},{"line_number":110,"context_line":"                    router[\u0027id\u0027],"},{"line_number":111,"context_line":"                    distributed_port\u003drouter.get(\u0027ha\u0027))"},{"line_number":112,"context_line":"            for interface in router.get(constants.INTERFACE_KEY, []):"},{"line_number":113,"context_line":"                self._ensure_host_set_on_port("},{"line_number":114,"context_line":"                    context,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a50d1a3_1c0ef18b","line":111,"in_reply_to":"3a50d1a3_eeb68b89","updated":"2015-07-23 12:15:30.000000000","message":"Done","commit_id":"54bdb48b163fd71642c42a1acb02225036311d95"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"90924fb725275fec44ab735f8ab26fe5d40ef9ce","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                              router[\u0027id\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _ensure_host_set_on_port(self, context, host, port, router_id\u003dNone,"},{"line_number":125,"context_line":"                                 distributed_port\u003dFalse):"},{"line_number":126,"context_line":"        if (port and host is not None and"},{"line_number":127,"context_line":"            (port.get(\u0027device_owner\u0027) !\u003d"},{"line_number":128,"context_line":"             constants.DEVICE_OWNER_DVR_INTERFACE and"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a50d1a3_2e1313ba","line":125,"updated":"2015-07-21 01:28:53.000000000","message":"maybe, we should change distributed_port to ha_router_port?\n\nand are u sure we need these code for ha router?\nI think https://review.openstack.org/#/c/141114/26/neutron/db/l3_hamode_db.py will make sure the host is set correctly. And sync_router is just for normal router. The right host is all managed on keepalived\u0027s state change notification management.","commit_id":"54bdb48b163fd71642c42a1acb02225036311d95"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"6b182df269306814a5122d467de09b34b57ff1b8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                              router[\u0027id\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _ensure_host_set_on_port(self, context, host, port, router_id\u003dNone,"},{"line_number":125,"context_line":"                                 distributed_port\u003dFalse):"},{"line_number":126,"context_line":"        if (port and host is not None and"},{"line_number":127,"context_line":"            (port.get(\u0027device_owner\u0027) !\u003d"},{"line_number":128,"context_line":"             constants.DEVICE_OWNER_DVR_INTERFACE and"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a50d1a3_fc58e58b","line":125,"in_reply_to":"3a50d1a3_2e1313ba","updated":"2015-07-23 12:15:30.000000000","message":"Done\n\nYes that code is handling the failover case and this is for new router port which is being bound, needs to be bound to the correct router.","commit_id":"54bdb48b163fd71642c42a1acb02225036311d95"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"61e5d80f460836b023f6c9a53d7ffbf5fa30d7b0","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                                              router[\u0027id\u0027])"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def _ensure_host_set_on_port(self, context, host, port, router_id\u003dNone,"},{"line_number":125,"context_line":"                                 ha_router_port\u003dFalse):"},{"line_number":126,"context_line":"        if (port and host is not None and"},{"line_number":127,"context_line":"            (port.get(\u0027device_owner\u0027) !\u003d"},{"line_number":128,"context_line":"             constants.DEVICE_OWNER_DVR_INTERFACE and"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_fc0d1338","line":125,"updated":"2015-08-03 20:52:28.000000000","message":"IMO it is bad to add a boolean to a method to choose between two different method behaviors.  Ideally, this should be two or more simpler methods.","commit_id":"91d3a0219a43a2c06ea4043cc9eeb518815df391"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"61e5d80f460836b023f6c9a53d7ffbf5fa30d7b0","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            if not ha_router_port:"},{"line_number":136,"context_line":"                # All ports, including ports created for SNAT\u0027ing for"},{"line_number":137,"context_line":"                # DVR are handled here"},{"line_number":138,"context_line":"                try:"},{"line_number":139,"context_line":"                    self.plugin.update_port("},{"line_number":140,"context_line":"                        context,"},{"line_number":141,"context_line":"                        port[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_81558c1e","line":138,"updated":"2015-08-03 20:52:28.000000000","message":"I notice 9 lines of code repeated starting on L162.","commit_id":"91d3a0219a43a2c06ea4043cc9eeb518815df391"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"61e5d80f460836b023f6c9a53d7ffbf5fa30d7b0","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                        self.l3plugin.get_active_host_for_ha_router("},{"line_number":154,"context_line":"                            context, router_id))"},{"line_number":155,"context_line":"                    if active_host:"},{"line_number":156,"context_line":"                        host \u003d active_host"},{"line_number":157,"context_line":"                    # If there is currently no active router instance (For"},{"line_number":158,"context_line":"                    # example it\u0027s a new router), the host that requested"},{"line_number":159,"context_line":"                    # the routers (Essentially a random host) will do. The"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_1cd0ff52","line":156,"updated":"2015-08-03 20:52:28.000000000","message":"I\u0027m not sure how I feel about reassigning the method argument like this.","commit_id":"91d3a0219a43a2c06ea4043cc9eeb518815df391"}],"neutron/common/constants.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"61e5d80f460836b023f6c9a53d7ffbf5fa30d7b0","unresolved":false,"context_lines":[{"line_number":65,"context_line":"HA_PORT_NAME \u003d \u0027HA port tenant %s\u0027"},{"line_number":66,"context_line":"MINIMUM_AGENTS_FOR_HA \u003d 2"},{"line_number":67,"context_line":"HA_ROUTER_STATE_ACTIVE \u003d \u0027active\u0027"},{"line_number":68,"context_line":"HA_ROUTER_STATE_STANDBY \u003d \u0027standby\u0027"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"IPv4 \u003d \u0027IPv4\u0027"},{"line_number":71,"context_line":"IPv6 \u003d \u0027IPv6\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"1a4dcd0f_1c8f9f24","line":68,"updated":"2015-08-03 20:52:28.000000000","message":"Introducing these constants is kind of orthogonal to the rest.","commit_id":"91d3a0219a43a2c06ea4043cc9eeb518815df391"}],"neutron/db/l3_hamode_db.py":[{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"6a68170407266197de2503ebfa5911520d713f9e","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        self._update_router_port_bindings(context, states, host)"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    def _update_router_port_bindings(self, context, states, host):"},{"line_number":501,"context_line":"        print \u0027STATE UPDATE\u0027, states, host"},{"line_number":502,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":503,"context_line":"        device_filter \u003d {\u0027device_id\u0027: states.keys(),"},{"line_number":504,"context_line":"                         \u0027device_owner\u0027:"}],"source_content_type":"text/x-python","patch_set":11,"id":"baa041b7_6c6fddc5","line":501,"updated":"2015-04-05 14:07:20.000000000","message":"please remove print","commit_id":"3c80ff53d3d4018d3380327c4932c397471331c2"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"9493834da5e42b0d31fca5badd9fa476b2f3011f","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        self._update_router_port_bindings(context, states, host)"},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"    def _update_router_port_bindings(self, context, states, host):"},{"line_number":501,"context_line":"        print \u0027STATE UPDATE\u0027, states, host"},{"line_number":502,"context_line":"        admin_ctx \u003d context.elevated()"},{"line_number":503,"context_line":"        device_filter \u003d {\u0027device_id\u0027: states.keys(),"},{"line_number":504,"context_line":"                         \u0027device_owner\u0027:"}],"source_content_type":"text/x-python","patch_set":11,"id":"baa041b7_8dd45820","line":501,"in_reply_to":"baa041b7_6c6fddc5","updated":"2015-04-06 07:48:34.000000000","message":"Done","commit_id":"3c80ff53d3d4018d3380327c4932c397471331c2"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"6a68170407266197de2503ebfa5911520d713f9e","unresolved":false,"context_lines":[{"line_number":504,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":505,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_INTF]}"},{"line_number":506,"context_line":"        ports \u003d self._core_plugin.get_ports(admin_ctx, filters\u003ddevice_filter)"},{"line_number":507,"context_line":"        print ports"},{"line_number":508,"context_line":"        active_ports \u003d (port for port in ports"},{"line_number":509,"context_line":"                        if states[port[\u0027device_id\u0027]] \u003d\u003d \u0027active\u0027)"},{"line_number":510,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"baa041b7_ac75e598","line":507,"updated":"2015-04-05 14:07:20.000000000","message":"please remove print","commit_id":"3c80ff53d3d4018d3380327c4932c397471331c2"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"9493834da5e42b0d31fca5badd9fa476b2f3011f","unresolved":false,"context_lines":[{"line_number":504,"context_line":"                         \u0027device_owner\u0027:"},{"line_number":505,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_INTF]}"},{"line_number":506,"context_line":"        ports \u003d self._core_plugin.get_ports(admin_ctx, filters\u003ddevice_filter)"},{"line_number":507,"context_line":"        print ports"},{"line_number":508,"context_line":"        active_ports \u003d (port for port in ports"},{"line_number":509,"context_line":"                        if states[port[\u0027device_id\u0027]] \u003d\u003d \u0027active\u0027)"},{"line_number":510,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"baa041b7_6dd7d423","line":507,"in_reply_to":"baa041b7_ac75e598","updated":"2015-04-06 07:48:34.000000000","message":"Done","commit_id":"3c80ff53d3d4018d3380327c4932c397471331c2"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"c04771b2ced797541887fd3bfdba01f36493269e","unresolved":false,"context_lines":[{"line_number":454,"context_line":"        # if an interface is added to a router, its binding might be wrong"},{"line_number":455,"context_line":"        # and l2pop would not work correctly."},{"line_number":456,"context_line":"        return next("},{"line_number":457,"context_line":"            (agent.host for agent, state in bindings if state \u003d\u003d \u0027active\u0027),"},{"line_number":458,"context_line":"            None)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_b9beacfd","line":457,"updated":"2015-06-15 11:25:45.000000000","message":"it is better to use \u0027constants.NET_STATUS_ACTIVE\u0027","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"30363584c969ea810693fececc172f5fe89da86b","unresolved":false,"context_lines":[{"line_number":454,"context_line":"        # if an interface is added to a router, its binding might be wrong"},{"line_number":455,"context_line":"        # and l2pop would not work correctly."},{"line_number":456,"context_line":"        return next("},{"line_number":457,"context_line":"            (agent.host for agent, state in bindings if state \u003d\u003d \u0027active\u0027),"},{"line_number":458,"context_line":"            None)"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_f1758f31","line":457,"in_reply_to":"fa32b979_b9beacfd","updated":"2015-07-16 12:13:11.000000000","message":"Done","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"c04771b2ced797541887fd3bfdba01f36493269e","unresolved":false,"context_lines":[{"line_number":517,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_INTF]}"},{"line_number":518,"context_line":"        ports \u003d self._core_plugin.get_ports(admin_ctx, filters\u003ddevice_filter)"},{"line_number":519,"context_line":"        active_ports \u003d (port for port in ports"},{"line_number":520,"context_line":"                        if states[port[\u0027device_id\u0027]] \u003d\u003d \u0027active\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        for port in active_ports:"},{"line_number":523,"context_line":"            port[portbindings.HOST_ID] \u003d host"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_99ee4821","line":520,"updated":"2015-06-15 11:25:45.000000000","message":"it is better to use \u0027constants.NET_STATUS_ACTIVE\u0027","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"30363584c969ea810693fececc172f5fe89da86b","unresolved":false,"context_lines":[{"line_number":517,"context_line":"                         [constants.DEVICE_OWNER_ROUTER_INTF]}"},{"line_number":518,"context_line":"        ports \u003d self._core_plugin.get_ports(admin_ctx, filters\u003ddevice_filter)"},{"line_number":519,"context_line":"        active_ports \u003d (port for port in ports"},{"line_number":520,"context_line":"                        if states[port[\u0027device_id\u0027]] \u003d\u003d \u0027active\u0027)"},{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        for port in active_ports:"},{"line_number":523,"context_line":"            port[portbindings.HOST_ID] \u003d host"}],"source_content_type":"text/x-python","patch_set":18,"id":"fa32b979_b192a74a","line":520,"in_reply_to":"fa32b979_99ee4821","updated":"2015-07-16 12:13:11.000000000","message":"Done","commit_id":"e26299e7131fd42c30b0dd89542b840db9b5ce2c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"fddb2a1caf34563f601fa850cd3c29f1810bc405","unresolved":false,"context_lines":[{"line_number":447,"context_line":"    def get_active_host_for_ha_router(self, context, router_id):"},{"line_number":448,"context_line":"        bindings \u003d self.get_l3_bindings_hosting_router_with_ha_states("},{"line_number":449,"context_line":"            context, router_id)"},{"line_number":450,"context_line":"        # TODO(amuller): In case we have two or more actives, this method"},{"line_number":451,"context_line":"        # needs to return the last agent to become active. This requires"},{"line_number":452,"context_line":"        # timestamps for state changes. Otherwise, if a host goes down"},{"line_number":453,"context_line":"        # and another takes over, we\u0027ll have two actives. In this case,"}],"source_content_type":"text/x-python","patch_set":24,"id":"ba3cc151_bc71cc46","line":450,"updated":"2015-07-10 13:21:45.000000000","message":"file a bug for this?","commit_id":"225e984ef42f2c3250a68d879ff0ff5badb60066"}],"neutron/plugins/ml2/drivers/l2pop/db.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"62438fbc4c680837cd639db91a85c8b09bc4a80e","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            return query"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_nonrouter_network_ports(self, session, network_id):"},{"line_number":77,"context_line":"        query \u003d self.get_network_ports(session, network_id)"},{"line_number":78,"context_line":"        return query.filter(models_v2.Port.device_owner !\u003d"},{"line_number":79,"context_line":"                            const.DEVICE_OWNER_DVR_INTERFACE,"},{"line_number":80,"context_line":"                            models_v2.Port.device_owner !\u003d"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_5dcf2029","line":77,"updated":"2014-12-11 21:21:01.000000000","message":"It should be possible to write:\n\ndevice_owner not in (dvr, router interfaces)\n\nI don\u0027t remember the syntax off the top of my head but it\u0027s something like:\n\n~models_v2.Port.device_owner.in_([const1, const2])","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"62438fbc4c680837cd639db91a85c8b09bc4a80e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                            const.DEVICE_OWNER_DVR_INTERFACE,"},{"line_number":80,"context_line":"                            models_v2.Port.device_owner !\u003d"},{"line_number":81,"context_line":"                            const.DEVICE_OWNER_ROUTER_INTF)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_router_network_ports(self, session, network_id):"},{"line_number":84,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":85,"context_line":"            routers_query \u003d session.query(l3_db.Router)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_5de640b1","line":82,"updated":"2014-12-11 21:21:01.000000000","message":"So uhh, these two methods are nearly identical. I don\u0027t know why you used an outer join here but an inner join in the bottom method?\n\nIn any case, both don\u0027t belong here. The L3 service plugin should be able to give you a list of routers filtered by the HA attribute. You can move this type of logic to the L3 HA DB mixin, then call it here by getting an instance of the L3 router service plugin.","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"8c1c250c616031cdb97698ae80da6a972bc2d6e5","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                            const.DEVICE_OWNER_DVR_INTERFACE,"},{"line_number":80,"context_line":"                            models_v2.Port.device_owner !\u003d"},{"line_number":81,"context_line":"                            const.DEVICE_OWNER_ROUTER_INTF)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_router_network_ports(self, session, network_id):"},{"line_number":84,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":85,"context_line":"            routers_query \u003d session.query(l3_db.Router)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_3ad401bc","line":82,"in_reply_to":"3a961159_5de640b1","updated":"2014-12-12 14:11:05.000000000","message":"+1","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"0cb1df4b6f52c249bd16e07980550d679f80b92a","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                            const.DEVICE_OWNER_DVR_INTERFACE,"},{"line_number":80,"context_line":"                            models_v2.Port.device_owner !\u003d"},{"line_number":81,"context_line":"                            const.DEVICE_OWNER_ROUTER_INTF)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_router_network_ports(self, session, network_id):"},{"line_number":84,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":85,"context_line":"            routers_query \u003d session.query(l3_db.Router)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_e5df950a","line":82,"in_reply_to":"3a961159_5de640b1","updated":"2015-01-04 09:53:57.000000000","message":"+1","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"d5bd28111811230896558483ed7cc597444ddecc","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                            models_v2.Port.device_owner !\u003d"},{"line_number":81,"context_line":"                            const.DEVICE_OWNER_ROUTER_INTF)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_router_network_ports(self, session, network_id):"},{"line_number":84,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":85,"context_line":"            routers_query \u003d session.query(l3_db.Router)"},{"line_number":86,"context_line":"            routers_query \u003d routers_query.outerjoin("}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_2d5b22f7","line":83,"updated":"2014-12-19 07:21:29.000000000","message":"should this method be get_nonharouter_network_ports? Also I think this method can be merged with get_nonrouter_network_ports since the ports are treated in the same way in mech_driver.py.","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":12683,"name":"KaiLin","email":"linkai3@huawei.com","username":"LinKai"},"change_message_id":"36b20b18a0ea71a6a2b0e95c416bf8c82c798ddc","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                            models_v2.Port.device_id.in_("},{"line_number":97,"context_line":"                                r.id for r in routers_query))"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def get_harouter_network_ports(self, session, network_id):"},{"line_number":100,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":101,"context_line":"            routers_query \u003d session.query(l3_db.Router)"},{"line_number":102,"context_line":"            routers_query \u003d routers_query.join("}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_057ca171","line":99,"updated":"2015-01-04 08:26:22.000000000","message":"I think the codes of get_harouter_network_ports and get_router_network_ports are essentially the same, so we can put them together and distinguish by RouterExtraAttributes.ha","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def get_nondvr_network_ports(self, session, network_id):"},{"line_number":74,"context_line":"        query \u003d self.get_network_ports(session, network_id)"},{"line_number":75,"context_line":"        return query.filter(models_v2.Port.device_owner !\u003d"},{"line_number":76,"context_line":"                            const.DEVICE_OWNER_DVR_INTERFACE)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def get_router_network_ports(self, session, network_id):"},{"line_number":79,"context_line":"        query \u003d self.get_network_ports(session, network_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_ffa127f8","line":76,"updated":"2015-01-20 10:13:50.000000000","message":"get_nondvr_nonha_networks_ports()\n    query \u003d get_nondvr_network_ports()\n    return (get_nondvr_network_ports() - get_ha_network_ports())","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        query \u003d self.get_network_ports(session, network_id)"},{"line_number":80,"context_line":"        return query.filter(models_v2.Port.device_owner \u003d\u003d"},{"line_number":81,"context_line":"                            const.DEVICE_OWNER_ROUTER_INTF)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def get_dvr_network_ports(self, session, network_id):"},{"line_number":84,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":85,"context_line":"            query \u003d session.query(ml2_models.DVRPortBinding,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_d1456d15","line":82,"updated":"2015-01-20 10:13:50.000000000","message":"get_router_ha_network_ports()\nif router_ha_enabled:\n    return get_router_network_port()","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"}],"neutron/plugins/ml2/drivers/l2pop/mech_driver.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"62438fbc4c680837cd639db91a85c8b09bc4a80e","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            if add_fdb_entries:"},{"line_number":262,"context_line":"                agent_ports +\u003d self._get_port_fdb_entries(binding.port)"},{"line_number":263,"context_line":"            ports[ip] \u003d agent_ports"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _port_fdb_needed(self, port, session, network_id):"},{"line_number":266,"context_line":"        device_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":267,"context_line":"        if device_owner \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_4006571e","line":264,"updated":"2014-12-11 21:21:01.000000000","message":"New unit, new test... Quick and dirty!","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":12683,"name":"KaiLin","email":"linkai3@huawei.com","username":"LinKai"},"change_message_id":"36b20b18a0ea71a6a2b0e95c416bf8c82c798ddc","unresolved":false,"context_lines":[{"line_number":261,"context_line":"            if add_fdb_entries:"},{"line_number":262,"context_line":"                agent_ports +\u003d self._get_port_fdb_entries(binding.port)"},{"line_number":263,"context_line":"            ports[ip] \u003d agent_ports"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def _port_fdb_needed(self, port, session, network_id):"},{"line_number":266,"context_line":"        device_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":267,"context_line":"        if device_owner \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_85e6d142","line":264,"in_reply_to":"3a961159_4006571e","updated":"2015-01-04 08:26:22.000000000","message":"+1","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"62438fbc4c680837cd639db91a85c8b09bc4a80e","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        device_owner \u003d port[\u0027device_owner\u0027]"},{"line_number":267,"context_line":"        if device_owner \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":268,"context_line":"            return False"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"        if device_owner \u003d\u003d const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":271,"context_line":"            harouter_network_ports \u003d ("},{"line_number":272,"context_line":"                self.get_harouter_network_ports(session, network_id))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_7d477c77","line":269,"updated":"2014-12-11 21:21:01.000000000","message":"Note that once you call get_harouter_network_ports here, _update_port_up calls it at least once, but up to twice. You can call it once then pass it to this method.","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"0cb1df4b6f52c249bd16e07980550d679f80b92a","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        if device_owner \u003d\u003d const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":271,"context_line":"            harouter_network_ports \u003d ("},{"line_number":272,"context_line":"                self.get_harouter_network_ports(session, network_id))"},{"line_number":273,"context_line":"            return port[\u0027id\u0027] not in [p.id for p in harouter_network_ports]"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        return True"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_851fb1b6","line":273,"updated":"2015-01-04 09:53:57.000000000","message":"prefer to use ( ) instead of [ ] as this saves creating a list:\n in (p.id for p in ... )","commit_id":"6d979da3688c11b47aeeeb44db638135c96cc7c2"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"5ff82254df5e1e0907824f3e14b31e57511f679c","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            self.get_dvr_network_ports(session, network_id).all())"},{"line_number":192,"context_line":"        fdb_network_ports \u003d ("},{"line_number":193,"context_line":"            self.get_nondvr_network_ports(session, network_id).all())"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        ports_to_remove, agents_to_tunnel \u003d ("},{"line_number":196,"context_line":"            self._process_harouter_ports(l3plugin, context, session,"},{"line_number":197,"context_line":"                                         [binding.port for binding, _"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_a1150f3e","line":194,"updated":"2015-01-08 09:42:26.000000000","message":"a comment would be usefull here to explain what you\u0027re doing with the code below.\n\nAFAIU you\u0027re removing fdb entries for ha router ports. So that only tunnels are created to router ha port, and learning get used to resolve mac address.\n\nThis seems very complicated. I would prefer that a db method would be used to have ports that are multi-bound and ports that are single-bound. here is the move that I propose : \n-get_nondvr_network_ports()-\u003eget_single_bound_ports()\n-get_dvr_network_ports()-\u003eget_multi_bound_ports()\n\nget_multi_bound_ports() will return both dvr and ha router ports.\n\nOnce multi binding will be fully available in ML2, get_multi_bound_ports will be the only method to modify, and even moved into ML2.db since it can be useful for other MDs.","commit_id":"e6d39154e89982a4a622e15b21cc884bcc32ea50"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a9d2e1226c7a3da9fd5b5b6a5b1b6852ae966060","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            self.get_dvr_network_ports(session, network_id).all())"},{"line_number":192,"context_line":"        fdb_network_ports \u003d ("},{"line_number":193,"context_line":"            self.get_nondvr_network_ports(session, network_id).all())"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        ports_to_remove, agents_to_tunnel \u003d ("},{"line_number":196,"context_line":"            self._process_harouter_ports(l3plugin, context, session,"},{"line_number":197,"context_line":"                                         [binding.port for binding, _"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_0a12b0fc","line":194,"in_reply_to":"3a961159_a1150f3e","updated":"2015-01-15 11:54:58.000000000","message":"Added a comment.\n\nI don\u0027t agree that it\u0027s necessary to change the DB method names, the way you use them is reflected in the variable names used so perhaps those need clarification?\n\nOnce and if multi bound ports will be available then this code of course will need to be adjusted but since it\u0027s not available yet and not very clear how it would be done, I prefer not to make any changes that aren\u0027t certain.","commit_id":"e6d39154e89982a4a622e15b21cc884bcc32ea50"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"5ff82254df5e1e0907824f3e14b31e57511f679c","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def _get_agents_for_ha_router_port(self, l3plugin, plugin_context, session,"},{"line_number":258,"context_line":"                                       port):"},{"line_number":259,"context_line":"        agents_hosting_router \u003d l3plugin.list_l3_agents_hosting_router("},{"line_number":260,"context_line":"            plugin_context, port[\u0027device_id\u0027])[\u0027agents\u0027]"},{"line_number":261,"context_line":"        return [self.get_agent_by_host(session, agent[\u0027host\u0027])"},{"line_number":262,"context_line":"                for agent in agents_hosting_router]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_413b8bd0","line":259,"updated":"2015-01-08 09:42:26.000000000","message":"Once multi-binding of PORT will be available in ML2, this method won\u0027t be usefull. You will be able to have each agent that bound the router HA port, without asking the l3plugin.\nHopefully, this feature will be available in k2.\nPlease add a REVISIT comment.","commit_id":"e6d39154e89982a4a622e15b21cc884bcc32ea50"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a9d2e1226c7a3da9fd5b5b6a5b1b6852ae966060","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def _get_agents_for_ha_router_port(self, l3plugin, plugin_context, session,"},{"line_number":258,"context_line":"                                       port):"},{"line_number":259,"context_line":"        agents_hosting_router \u003d l3plugin.list_l3_agents_hosting_router("},{"line_number":260,"context_line":"            plugin_context, port[\u0027device_id\u0027])[\u0027agents\u0027]"},{"line_number":261,"context_line":"        return [self.get_agent_by_host(session, agent[\u0027host\u0027])"},{"line_number":262,"context_line":"                for agent in agents_hosting_router]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_6ad89452","line":259,"in_reply_to":"3a961159_413b8bd0","updated":"2015-01-15 11:54:58.000000000","message":"Done","commit_id":"e6d39154e89982a4a622e15b21cc884bcc32ea50"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"949e36019c8039714beb1813349178b2f6769f11","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _create_agent_fdb(self, l3plugin, context, session, agent_host,"},{"line_number":185,"context_line":"                          segment, network_id):"},{"line_number":186,"context_line":"        agent_fdb_entries \u003d {network_id:"},{"line_number":187,"context_line":"                             {\u0027segment_id\u0027: segment[\u0027segmentation_id\u0027],"},{"line_number":188,"context_line":"                              \u0027network_type\u0027: segment[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_9df48bf3","line":185,"updated":"2015-01-22 14:03:18.000000000","message":"Not sure that we should change the signature of this method by adding the l3plugin since it should disappear when we will have the multi-bound","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"49f1bbeaa841b9d2dfad8e090dd4919a5ecedb49","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _create_agent_fdb(self, l3plugin, context, session, agent_host,"},{"line_number":185,"context_line":"                          segment, network_id):"},{"line_number":186,"context_line":"        agent_fdb_entries \u003d {network_id:"},{"line_number":187,"context_line":"                             {\u0027segment_id\u0027: segment[\u0027segmentation_id\u0027],"},{"line_number":188,"context_line":"                              \u0027network_type\u0027: segment[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_bc49fbb8","line":185,"in_reply_to":"1a930d6b_9df48bf3","updated":"2015-01-26 12:00:52.000000000","message":"Why not? It\u0027s an internal method..\n\nWhen we have multi-bound port we can revisit this whole are and improve it.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                              \u0027network_type\u0027: segment[\u0027network_type\u0027],"},{"line_number":189,"context_line":"                              \u0027ports\u0027: {}}}"},{"line_number":190,"context_line":"        tunnel_network_ports \u003d ("},{"line_number":191,"context_line":"            self.get_dvr_network_ports(session, network_id).all())"},{"line_number":192,"context_line":"        fdb_network_ports \u003d ("},{"line_number":193,"context_line":"            self.get_nondvr_network_ports(session, network_id).all())"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_f1b98916","line":191,"updated":"2015-01-20 10:13:50.000000000","message":"adding get_ha_network_ports call here","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            self.get_dvr_network_ports(session, network_id).all())"},{"line_number":192,"context_line":"        fdb_network_ports \u003d ("},{"line_number":193,"context_line":"            self.get_nondvr_network_ports(session, network_id).all())"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        # For HA router ports we don\u0027t want to create FDB to the port and would"},{"line_number":196,"context_line":"        # only like a flow to flood the agents where the HA port is bound."},{"line_number":197,"context_line":"        # This is so to enable the lowest failover time possible - the data"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_11b53518","line":194,"updated":"2015-01-20 10:13:50.000000000","message":"call get_nondvr_nonha_network_ports() instead of get_nondvr_network_ports(), and move the logic of port removal in db.py","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"949e36019c8039714beb1813349178b2f6769f11","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                                          in fdb_network_ports]))"},{"line_number":204,"context_line":"        tunnel_network_ports +\u003d [(None, agent) for agent in agents_to_tunnel]"},{"line_number":205,"context_line":"        fdb_network_ports \u003d [network_port for network_port in fdb_network_ports"},{"line_number":206,"context_line":"                             if network_port[0].port not in ports_to_remove]"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        ports \u003d agent_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":209,"context_line":"        ports.update(self._get_tunnels("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_bd24e7af","line":206,"updated":"2015-01-22 14:03:18.000000000","message":"Maybe you could move all the HA related lines into a specific HA method","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"49f1bbeaa841b9d2dfad8e090dd4919a5ecedb49","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                                          in fdb_network_ports]))"},{"line_number":204,"context_line":"        tunnel_network_ports +\u003d [(None, agent) for agent in agents_to_tunnel]"},{"line_number":205,"context_line":"        fdb_network_ports \u003d [network_port for network_port in fdb_network_ports"},{"line_number":206,"context_line":"                             if network_port[0].port not in ports_to_remove]"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        ports \u003d agent_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":209,"context_line":"        ports.update(self._get_tunnels("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_dcc96727","line":206,"in_reply_to":"1a930d6b_bd24e7af","updated":"2015-01-26 12:00:52.000000000","message":"Not sure what you mean, it\u0027s already handled by _process_harouter_ports..","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"f1ee0d2387daf6901b0ccdc849e4d15001476103","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                                          in fdb_network_ports]))"},{"line_number":204,"context_line":"        tunnel_network_ports +\u003d [(None, agent) for agent in agents_to_tunnel]"},{"line_number":205,"context_line":"        fdb_network_ports \u003d [network_port for network_port in fdb_network_ports"},{"line_number":206,"context_line":"                             if network_port[0].port not in ports_to_remove]"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"        ports \u003d agent_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":209,"context_line":"        ports.update(self._get_tunnels("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa81d914_3c97ff91","line":206,"in_reply_to":"1a930d6b_dcc96727","updated":"2015-02-03 13:43:08.000000000","message":"I think what sylvain meant is in line with the methods I proposed in this review, to populated the fdb dict : 1.add dvr network ports 2.add HA network port 3.add fdb network ports;\n\nthis way, the code will be much more readable : instead of calling \nget_nondvr_network_ports(), you\u0027ll call get_nondvr_nonha_network_ports() which will get the l3plugin from the manager. this way You won\u0027t have to modify the signature of _create_agent_fdb()","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        return agents"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def _get_agent_network_active_port_count(self, l3plugin, plugin_context,"},{"line_number":238,"context_line":"                                             session, agent_host, port):"},{"line_number":239,"context_line":"        network_id \u003d port[\u0027network_id\u0027]"},{"line_number":240,"context_line":"        l2plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":241,"context_line":"        router_ports \u003d l2plugin.get_ports("}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_9f6f4360","line":238,"updated":"2015-01-20 10:13:50.000000000","message":"I think this should be moved directly to db.py too. Why didn\u0027t you directly modify db/get_agent_network_active_port_count()?","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"49f1bbeaa841b9d2dfad8e090dd4919a5ecedb49","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        return agents"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def _get_agent_network_active_port_count(self, l3plugin, plugin_context,"},{"line_number":238,"context_line":"                                             session, agent_host, port):"},{"line_number":239,"context_line":"        network_id \u003d port[\u0027network_id\u0027]"},{"line_number":240,"context_line":"        l2plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":241,"context_line":"        router_ports \u003d l2plugin.get_ports("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_1cd04fc8","line":238,"in_reply_to":"3a961159_9f6f4360","updated":"2015-01-26 12:00:52.000000000","message":"Same reasoning as I wrote in the general comments - until we have mutli-bound ports I don\u0027t want to put non-DB code in the DB module.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"949e36019c8039714beb1813349178b2f6769f11","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            self._process_harouter_ports(l3plugin, plugin_context,"},{"line_number":248,"context_line":"                                         session, router_ports))"},{"line_number":249,"context_line":"        ha_ports_count \u003d sum([1 for agent in agents_to_tunnel"},{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_ddf8d37e","line":250,"updated":"2015-01-22 14:03:18.000000000","message":"same as before, would be better to have a specific HA method in order to get HA port count, so\n\nreturn (self.get_agent_network_active_port_count(session, agent_host,\t251\n\t\t\tnetwork_id) + \n            self.get_agent_network_active_ha_port(count.....","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"49f1bbeaa841b9d2dfad8e090dd4919a5ecedb49","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            self._process_harouter_ports(l3plugin, plugin_context,"},{"line_number":248,"context_line":"                                         session, router_ports))"},{"line_number":249,"context_line":"        ha_ports_count \u003d sum([1 for agent in agents_to_tunnel"},{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_fcce232d","line":250,"in_reply_to":"1a930d6b_ddf8d37e","updated":"2015-01-26 12:00:52.000000000","message":"I believe this would be repetitive and error prone, instead of calling this one method.\n\nIf you prefer I can change the name of this method to indicate that it also counts HA ports.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"f1ee0d2387daf6901b0ccdc849e4d15001476103","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            self._process_harouter_ports(l3plugin, plugin_context,"},{"line_number":248,"context_line":"                                         session, router_ports))"},{"line_number":249,"context_line":"        ha_ports_count \u003d sum([1 for agent in agents_to_tunnel"},{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa81d914_fc59e7fe","line":250,"in_reply_to":"1a930d6b_fcce232d","updated":"2015-02-03 13:43:08.000000000","message":"I also agree with sylvain here, a dedicated method that count the ha port should be used and the signature shouldn\u0027t be changed. this new method will get the l3plugin from the manager.","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":6697,"name":"Sandhya Dasu","email":"sandhya.openinfra@gmail.com","username":"sadasu"},"change_message_id":"f1540d5f8182f0130614543d317323bc1bcff501","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def _is_ha_router_port(self, l3plugin, plugin_context, port):"},{"line_number":256,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_ROUTER_INTF:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_80efbf86","line":253,"updated":"2015-01-22 16:25:04.000000000","message":"Agree with the previous comment about this method belonging in db.py and the current port calculation would result in double counting. Is there a unit-test to check for this?","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def _is_ha_router_port(self, l3plugin, plugin_context, port):"},{"line_number":256,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_ROUTER_INTF:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_ffb047ff","line":253,"updated":"2015-01-20 10:13:50.000000000","message":"This might result in having the HA port counted twice : one in ha_port_count, and one in get_agent_network_active_port_count(). Am I missing something?","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"49f1bbeaa841b9d2dfad8e090dd4919a5ecedb49","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def _is_ha_router_port(self, l3plugin, plugin_context, port):"},{"line_number":256,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_ROUTER_INTF:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_e7285088","line":253,"in_reply_to":"1a930d6b_80efbf86","updated":"2015-01-26 12:00:52.000000000","message":"You seem to be missing the filtering of current port done on line #245 so I don\u0027t see why you think it will be counted twice..\n\nAnyhow I added a unit test for this","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"f1ee0d2387daf6901b0ccdc849e4d15001476103","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":251,"context_line":"        return (self.get_agent_network_active_port_count(session, agent_host,"},{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def _is_ha_router_port(self, l3plugin, plugin_context, port):"},{"line_number":256,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_ROUTER_INTF:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa81d914_0259f035","line":253,"in_reply_to":"1a930d6b_e7285088","updated":"2015-02-03 13:43:08.000000000","message":"ok, but our comments show that your code is very hard to read!","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                                                         network_id) +"},{"line_number":253,"context_line":"                ha_ports_count)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def _is_ha_router_port(self, l3plugin, plugin_context, port):"},{"line_number":256,"context_line":"        if port[\u0027device_owner\u0027] !\u003d const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":257,"context_line":"            return False"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_ffcda731","line":255,"updated":"2015-01-20 10:13:50.000000000","message":"this should be moved to db.py too","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"a315cf3a469219cb127a7972a49c4a0f200ff656","unresolved":false,"context_lines":[{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    # REVISIT(mkolesni): Once ML2 supports multiple-bound ports"},{"line_number":263,"context_line":"    def _get_agents_for_ha_router_port(self, l3plugin, plugin_context, session,"},{"line_number":264,"context_line":"                                       port):"},{"line_number":265,"context_line":"        agents_hosting_router \u003d l3plugin.list_l3_agents_hosting_router("},{"line_number":266,"context_line":"            plugin_context, port[\u0027device_id\u0027])[\u0027agents\u0027]"},{"line_number":267,"context_line":"        return [self.get_agent_by_host(session, agent[\u0027host\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_1fd353d6","line":264,"updated":"2015-01-20 10:13:50.000000000","message":"itto","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"949e36019c8039714beb1813349178b2f6769f11","unresolved":false,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        session \u003d db_api.get_session()"},{"line_number":296,"context_line":"        agent_active_ports \u003d self._get_agent_network_active_port_count("},{"line_number":297,"context_line":"            l3plugin, plugin_context, session, agent_host, port)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        other_fdb_entries \u003d {network_id:"},{"line_number":300,"context_line":"                             {\u0027segment_id\u0027: segment[\u0027segmentation_id\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_fd84afb2","line":297,"updated":"2015-01-22 14:03:18.000000000","message":"same as before, not sure that we should change the signature of this method","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"949e36019c8039714beb1813349178b2f6769f11","unresolved":false,"context_lines":[{"line_number":306,"context_line":"                self.get_agent_uptime(agent) \u003c cfg.CONF.l2pop.agent_boot_time):"},{"line_number":307,"context_line":"            # First port activated on current agent in this network,"},{"line_number":308,"context_line":"            # we have to provide it with the whole list of fdb entries"},{"line_number":309,"context_line":"            agent_fdb_entries \u003d self._create_agent_fdb(l3plugin,"},{"line_number":310,"context_line":"                                                       plugin_context,"},{"line_number":311,"context_line":"                                                       session,"},{"line_number":312,"context_line":"                                                       agent.host,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a930d6b_3da63754","line":309,"updated":"2015-01-22 14:03:18.000000000","message":"ditto","commit_id":"c26b85efe543996c14177af3363b091d21978ad3"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def _fixed_ips_changed(self, context, orig, port, diff_ips):"},{"line_number":70,"context_line":"        orig_ips, port_ips \u003d diff_ips"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_cc647624","line":72,"updated":"2015-02-03 14:57:40.000000000","message":"maybe you could use self.l3plugin moving this line to the contructor","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def _fixed_ips_changed(self, context, orig, port, diff_ips):"},{"line_number":70,"context_line":"        orig_ips, port_ips \u003d diff_ips"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_d4244fb1","line":72,"in_reply_to":"da86d52c_072004ab","updated":"2015-02-19 11:21:52.000000000","message":"Done","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def _fixed_ips_changed(self, context, orig, port, diff_ips):"},{"line_number":70,"context_line":"        orig_ips, port_ips \u003d diff_ips"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_744c8377","line":72,"in_reply_to":"da86d52c_cc647624","updated":"2015-02-19 11:21:52.000000000","message":"Done, Moved l3plugin to a property","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"a6ca2091dad18abe70356d591a0c19d36cc9add9","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    def _fixed_ips_changed(self, context, orig, port, diff_ips):"},{"line_number":70,"context_line":"        orig_ips, port_ips \u003d diff_ips"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_072004ab","line":72,"in_reply_to":"da86d52c_cc647624","updated":"2015-02-04 09:19:05.000000000","message":"you should check that we have a l3plugin loaded, maybe checking that the ha extension is implemented as well","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"},{"line_number":76,"context_line":"            return"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_4f3b18d1","line":74,"updated":"2015-02-03 14:57:40.000000000","message":"You could also move this one into the method using the plugin_context, could be better for the readability","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":73,"context_line":"            plugin_constants.L3_ROUTER_NAT]"},{"line_number":74,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":75,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"},{"line_number":76,"context_line":"            return"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_b47b5b7a","line":74,"in_reply_to":"da86d52c_4f3b18d1","updated":"2015-02-19 11:21:52.000000000","message":"Done","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _create_agent_fdb(self, l3plugin, context, session, agent_host,"},{"line_number":185,"context_line":"                          segment, network_id):"},{"line_number":186,"context_line":"        agent_fdb_entries \u003d {network_id:"},{"line_number":187,"context_line":"                             {\u0027segment_id\u0027: segment[\u0027segmentation_id\u0027],"},{"line_number":188,"context_line":"                              \u0027network_type\u0027: segment[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_2f7344b2","line":185,"updated":"2015-02-03 14:57:40.000000000","message":"using self.l3plugin no need to have it here","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        return agent, agent_host, agent_ip, segment, fdb_entries"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def _create_agent_fdb(self, l3plugin, context, session, agent_host,"},{"line_number":185,"context_line":"                          segment, network_id):"},{"line_number":186,"context_line":"        agent_fdb_entries \u003d {network_id:"},{"line_number":187,"context_line":"                             {\u0027segment_id\u0027: segment[\u0027segmentation_id\u0027],"},{"line_number":188,"context_line":"                              \u0027network_type\u0027: segment[\u0027network_type\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_b456fb04","line":185,"in_reply_to":"da86d52c_2f7344b2","updated":"2015-02-19 11:21:52.000000000","message":"Done","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        return agents"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _get_agent_network_active_port_count(self, l3plugin, plugin_context,"},{"line_number":237,"context_line":"                                             session, agent_host, port):"},{"line_number":238,"context_line":"        network_id \u003d port[\u0027network_id\u0027]"},{"line_number":239,"context_line":"        l2plugin \u003d manager.NeutronManager.get_plugin()"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_6f47fc1d","line":236,"updated":"2015-02-03 14:57:40.000000000","message":"I would prefer to have a specific method for the ha port, so that we would have:\ndef _get_agent_network_active_port_count(self, context, session, agent_host, port):\n   return (self.get_agent_network_active_port_count(session, agent_host, network_id) +\n               (self.get_agent_network_active_ha_port_count(....","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        return agents"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _get_agent_network_active_port_count(self, l3plugin, plugin_context,"},{"line_number":237,"context_line":"                                             session, agent_host, port):"},{"line_number":238,"context_line":"        network_id \u003d port[\u0027network_id\u0027]"},{"line_number":239,"context_line":"        l2plugin \u003d manager.NeutronManager.get_plugin()"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_f43f93b3","line":236,"in_reply_to":"da86d52c_6f47fc1d","updated":"2015-02-19 11:21:52.000000000","message":"Done","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":290,"context_line":"                       plugin_constants.L3_ROUTER_NAT]"},{"line_number":291,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":292,"context_line":"        network_id \u003d port[\u0027network_id\u0027]"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        session \u003d db_api.get_session()"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_4ff9587f","line":291,"updated":"2015-02-03 14:57:40.000000000","message":"according to a preview comment, no need here","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":306,"context_line":"            # First port activated on current agent in this network,"},{"line_number":307,"context_line":"            # we have to provide it with the whole list of fdb entries"},{"line_number":308,"context_line":"            agent_fdb_entries \u003d self._create_agent_fdb(l3plugin,"},{"line_number":309,"context_line":"                                                       plugin_context,"},{"line_number":310,"context_line":"                                                       session,"},{"line_number":311,"context_line":"                                                       agent.host,"},{"line_number":312,"context_line":"                                                       segment,"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_afee54b2","line":309,"updated":"2015-02-03 14:57:40.000000000","message":"ditto","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"04bb605242059036f63cea0a5654b9ecce041ccb","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":364,"context_line":"                               plugin_constants.L3_ROUTER_NAT]"},{"line_number":365,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":366,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"},{"line_number":367,"context_line":"            if port_removed or not port[\u0027admin_state_up\u0027]:"},{"line_number":368,"context_line":"                agents \u003d self._get_agents_for_ha_router_port("},{"line_number":369,"context_line":"                    l3plugin, plugin_context, session, port)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_0f85a0cf","line":366,"updated":"2015-02-03 14:57:40.000000000","message":"suggestion: move the following ha related lines into a specific ha method, will be better for the readability.","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"39d1590f5e856f220c3e85c57723b7fec4740baa","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        l3plugin \u003d manager.NeutronManager.get_service_plugins()["},{"line_number":364,"context_line":"                               plugin_constants.L3_ROUTER_NAT]"},{"line_number":365,"context_line":"        plugin_context \u003d context._plugin_context"},{"line_number":366,"context_line":"        if self._is_ha_router_port(l3plugin, plugin_context, port):"},{"line_number":367,"context_line":"            if port_removed or not port[\u0027admin_state_up\u0027]:"},{"line_number":368,"context_line":"                agents \u003d self._get_agents_for_ha_router_port("},{"line_number":369,"context_line":"                    l3plugin, plugin_context, session, port)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_c0f93b4f","line":366,"in_reply_to":"da86d52c_0f85a0cf","updated":"2015-02-19 11:21:52.000000000","message":"Done","commit_id":"e8d30966a894fd5c3b136f2494305b3de7c61619"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":248,"context_line":"                                             agent_host, port):"},{"line_number":249,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":250,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":251,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_c2f9b1c9","line":248,"updated":"2015-02-23 16:57:52.000000000","message":"After testing your code : \n\nwhen this method is called when a compute port gets up on a host that hosts a \nrouter interface, it will return 3 instead of 2 : the router interface in counted twice : one time during get_agent_network_active_port_count(), and one time during : _get_agent_network_ha_interface_port_count().\n\nit should return 2 instead.","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":248,"context_line":"                                             agent_host, port):"},{"line_number":249,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":250,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":251,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_08ecaec6","line":248,"in_reply_to":"ba7be1f8_c2f9b1c9","updated":"2015-02-25 13:54:44.000000000","message":"Basically it\u0027s not really a problem since this value is used to determine if it\u0027s the first/last vm on a node or not, so any value other than 0/1 is not interesting..\n\nI\u0027m not sure how to make it accurate though since there is no good way to alter the \"general count\" method to ignore HA router interfaces.\n\nDo you have a suggestion what to do here?\n\nI could change so that any number other than 0/1 is irrelevant in which case these values do get calculated correctly even in the presence of a distributed port.\n\nI could also leave a REVISIT here..","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                              \u0027ports\u0027: {agent_ip: []}}}"},{"line_number":321,"context_line":"        other_fdb_ports \u003d other_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        if agent_active_ports \u003d\u003d 1 or ("},{"line_number":324,"context_line":"                self.get_agent_uptime(agent) \u003c cfg.CONF.l2pop.agent_boot_time):"},{"line_number":325,"context_line":"            # First port activated on current agent in this network,"},{"line_number":326,"context_line":"            # we have to provide it with the whole list of fdb entries"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_e2779539","line":323,"updated":"2015-02-23 16:57:52.000000000","message":"when a compute port goes up on a host that hosts a ha router interface, agent_active_ports will be equal to 2.\n\nThis results in not sending cast message with fdb entries of other ports of the net to the new compute port. This port will have to rely on learning to communicate with other compute ports.","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"0973df8c4f2a44f1dbd47f2eb57b064a1a49e611","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                              \u0027ports\u0027: {agent_ip: []}}}"},{"line_number":321,"context_line":"        other_fdb_ports \u003d other_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        if agent_active_ports \u003d\u003d 1 or ("},{"line_number":324,"context_line":"                self.get_agent_uptime(agent) \u003c cfg.CONF.l2pop.agent_boot_time):"},{"line_number":325,"context_line":"            # First port activated on current agent in this network,"},{"line_number":326,"context_line":"            # we have to provide it with the whole list of fdb entries"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_77b81ae6","line":323,"in_reply_to":"ba7be1f8_1bccef69","updated":"2015-02-26 22:14:36.000000000","message":"you\u0027re right thanks for the reminder :)","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                              \u0027ports\u0027: {agent_ip: []}}}"},{"line_number":321,"context_line":"        other_fdb_ports \u003d other_fdb_entries[network_id][\u0027ports\u0027]"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"        if agent_active_ports \u003d\u003d 1 or ("},{"line_number":324,"context_line":"                self.get_agent_uptime(agent) \u003c cfg.CONF.l2pop.agent_boot_time):"},{"line_number":325,"context_line":"            # First port activated on current agent in this network,"},{"line_number":326,"context_line":"            # we have to provide it with the whole list of fdb entries"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_1bccef69","line":323,"in_reply_to":"ba7be1f8_e2779539","updated":"2015-02-25 13:54:44.000000000","message":"That\u0027s the desired behavior since when the HA router port was set up on the node initially, a cast message was sent with all the details at that time.\n\nBy the time the second port on the same network goes up (regardless if it\u0027s a compute port or not) there is no need to send the cast message again.","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"d4a2b55487ca903023ff04be3a160905769858b5","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":248,"context_line":"                                             agent_host, port):"},{"line_number":249,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":250,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":251,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_77481a88","line":248,"updated":"2015-02-26 22:14:21.000000000","message":"what do you think of modifying the name of this method to something like : \n\n_is_agent_hosting_network()\n{\n\nreturn self.get_agent_network_active_port_count()\u003e1 or self._get_agent_network_ha_interface_port()\u003e1;\n\n}","commit_id":"877488108a40d4b7127023ed175211a30b5b4c56"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"65b65647d38b47e767a5387701c568135306a35c","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":248,"context_line":"                                             agent_host, port):"},{"line_number":249,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":250,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":251,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":6,"id":"ba7be1f8_045bc087","line":248,"in_reply_to":"ba7be1f8_77481a88","updated":"2015-03-02 15:33:06.000000000","message":"We need to check for either when it\u0027s the first port on the agent or when it was the last port there.\n\nPlease see if the suggested approach seems satisfactory.\nBasically the count method won\u0027t be called directly and the explicit methods will be used which makes the intentions clearer.","commit_id":"877488108a40d4b7127023ed175211a30b5b4c56"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6f4611fb072757ce1401ce6217aa3f578cb3b349","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _was_last_port_on_agent(self, plugin_context, session, agent_host,"},{"line_number":248,"context_line":"                                port):"},{"line_number":249,"context_line":"        return self._get_agent_network_active_port_count("},{"line_number":250,"context_line":"            plugin_context, session, agent_host, port) \u003d\u003d 0"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_56582832","line":247,"updated":"2015-03-05 16:28:13.000000000","message":"(nit) The following 2 functions look a lot a like. How about you create a third function that accepts an integer and then you can call that with 0/1, removing the code duplication?","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        return agents"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def _was_last_port_on_agent(self, plugin_context, session, agent_host,"},{"line_number":248,"context_line":"                                port):"},{"line_number":249,"context_line":"        return self._get_agent_network_active_port_count("},{"line_number":250,"context_line":"            plugin_context, session, agent_host, port) \u003d\u003d 0"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_f82362ba","line":247,"in_reply_to":"9a80dd14_56582832","updated":"2015-03-09 12:01:06.000000000","message":"Done","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6f4611fb072757ce1401ce6217aa3f578cb3b349","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    # REVISIT(mkolesni): Once distributed ports are properly supported"},{"line_number":258,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":259,"context_line":"                                             agent_host, port):"},{"line_number":260,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":261,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":262,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_d61df867","line":259,"updated":"2015-03-05 16:28:13.000000000","message":"The fact that \u0027_get_agent_network_active_port_count\u0027 has a \u0027_\u0027 prefix suggests that the version without it (\u0027get_agent_network_active_port_count\u0027) uses this version for some inner logic. It\u0027s unusual to see that the hidden function calls upon the API function for calculations.\n\nI would suggest a rename.","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    # REVISIT(mkolesni): Once distributed ports are properly supported"},{"line_number":258,"context_line":"    def _get_agent_network_active_port_count(self, plugin_context, session,"},{"line_number":259,"context_line":"                                             agent_host, port):"},{"line_number":260,"context_line":"        return (self.get_agent_network_active_port_count("},{"line_number":261,"context_line":"                    session, agent_host, port[\u0027network_id\u0027]) +"},{"line_number":262,"context_line":"                self._get_agent_network_ha_interface_port_count("}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_9810a65a","line":259,"in_reply_to":"9a80dd14_d61df867","updated":"2015-03-09 12:01:06.000000000","message":"Done","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6f4611fb072757ce1401ce6217aa3f578cb3b349","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                     \u0027network_id\u0027: [port[\u0027network_id\u0027]]})"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        # Filter out current port since it\u0027s already on the target host so it"},{"line_number":274,"context_line":"        # can\u0027t have any distributed port on the same host."},{"line_number":275,"context_line":"        router_ports \u003d [p for p in router_ports if p[\u0027id\u0027] !\u003d port[\u0027id\u0027]]"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # Sum up all HA ports that are assigned to this agent"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_96caa04d","line":274,"updated":"2015-03-05 16:28:13.000000000","message":"How about:\n\n router_ports \u003d filter(lambda p: p[\u0027id\u0027] !\u003d port[\u0027id\u0027], router_ports)","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                     \u0027network_id\u0027: [port[\u0027network_id\u0027]]})"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        # Filter out current port since it\u0027s already on the target host so it"},{"line_number":274,"context_line":"        # can\u0027t have any distributed port on the same host."},{"line_number":275,"context_line":"        router_ports \u003d [p for p in router_ports if p[\u0027id\u0027] !\u003d port[\u0027id\u0027]]"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        # Sum up all HA ports that are assigned to this agent"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_13f01990","line":274,"in_reply_to":"9a80dd14_96caa04d","updated":"2015-03-09 12:01:06.000000000","message":"This is a matter of taste, I don\u0027t think it\u0027s more readable than the simple list comprehension..","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6f4611fb072757ce1401ce6217aa3f578cb3b349","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        _, agents_to_tunnel \u003d ("},{"line_number":279,"context_line":"            self._process_harouter_ports(plugin_context, session,"},{"line_number":280,"context_line":"                                         router_ports))"},{"line_number":281,"context_line":"        ha_ports_count \u003d sum([1 for agent in agents_to_tunnel"},{"line_number":282,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":283,"context_line":"        return ha_ports_count"},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_b677a43a","line":281,"updated":"2015-03-05 16:28:13.000000000","message":"How about:\n\n ha_ports_counts \u003d len(filter(lambda a: a[\u0027host\u0027] \u003d\u003d agent_host, agents_to_tunnel))","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        _, agents_to_tunnel \u003d ("},{"line_number":279,"context_line":"            self._process_harouter_ports(plugin_context, session,"},{"line_number":280,"context_line":"                                         router_ports))"},{"line_number":281,"context_line":"        ha_ports_count \u003d sum([1 for agent in agents_to_tunnel"},{"line_number":282,"context_line":"                              if agent[\u0027host\u0027] \u003d\u003d agent_host])"},{"line_number":283,"context_line":"        return ha_ports_count"},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_b30f4d87","line":281,"in_reply_to":"9a80dd14_b677a43a","updated":"2015-03-09 12:01:06.000000000","message":"Again a matter of taste but i did change to len","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ad5d41af10f9676722c7bcdee5bf0f9c04704a4f","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    def _process_harouter_ports(self, plugin_context, session, ports):"},{"line_number":302,"context_line":"        agents_to_tunnel \u003d []"},{"line_number":303,"context_line":"        ports_to_remove \u003d []"},{"line_number":304,"context_line":"        for port in ports:"},{"line_number":305,"context_line":"            if (not self._is_ha_router_port(plugin_context, port)):"},{"line_number":306,"context_line":"                continue"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_1ec5f93b","line":304,"updated":"2015-03-06 08:06:19.000000000","message":"suggestion: it will generate a db request per router port, maybe you could use the get_routers with filters to retrieve all the ha routers with only one request.","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    def _process_harouter_ports(self, plugin_context, session, ports):"},{"line_number":302,"context_line":"        agents_to_tunnel \u003d []"},{"line_number":303,"context_line":"        ports_to_remove \u003d []"},{"line_number":304,"context_line":"        for port in ports:"},{"line_number":305,"context_line":"            if (not self._is_ha_router_port(plugin_context, port)):"},{"line_number":306,"context_line":"                continue"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_79a68faf","line":304,"in_reply_to":"9a80dd14_1ec5f93b","updated":"2015-03-09 12:01:06.000000000","message":"We could do that but we don\u0027t know how much this would save without some real benchmarks.\n\nI believe it\u0027s not quite as simple since the ha attribute is in the RouterExtraAttributes class so not sure get_routers could address it in a filter. I also see no example of such filtering anywhere.\n\nEither way I prefer to keep it simple for now and in the future if the need for optimization will arise then devise a more optimized solution.","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ad5d41af10f9676722c7bcdee5bf0f9c04704a4f","unresolved":false,"context_lines":[{"line_number":388,"context_line":"        for agent in agents:"},{"line_number":389,"context_line":"            fdbs_to_remove \u003d self._create_agent_fdbs_to_remove("},{"line_number":390,"context_line":"                plugin_context, session, agent.host, port)"},{"line_number":391,"context_line":"            if len(fdbs_to_remove) \u003e 0:"},{"line_number":392,"context_line":"                ha_agent_ip \u003d self.get_agent_ip(agent)"},{"line_number":393,"context_line":"                ports[ha_agent_ip] \u003d fdbs_to_remove"},{"line_number":394,"context_line":"        return ports"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_7e4ef597","line":391,"updated":"2015-03-06 08:06:19.000000000","message":"nit: if fdbs_to_remove:","commit_id":"59512655246e6de0f03379206720170675b3bdde"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"efb824d6a3f3b71258d77029102fe5e72d265bb6","unresolved":false,"context_lines":[{"line_number":388,"context_line":"        for agent in agents:"},{"line_number":389,"context_line":"            fdbs_to_remove \u003d self._create_agent_fdbs_to_remove("},{"line_number":390,"context_line":"                plugin_context, session, agent.host, port)"},{"line_number":391,"context_line":"            if len(fdbs_to_remove) \u003e 0:"},{"line_number":392,"context_line":"                ha_agent_ip \u003d self.get_agent_ip(agent)"},{"line_number":393,"context_line":"                ports[ha_agent_ip] \u003d fdbs_to_remove"},{"line_number":394,"context_line":"        return ports"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a80dd14_9993435a","line":391,"in_reply_to":"9a80dd14_7e4ef597","updated":"2015-03-09 12:01:06.000000000","message":"Done","commit_id":"59512655246e6de0f03379206720170675b3bdde"}],"neutron/plugins/ml2/rpc.py":[{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"806834859873055ed38713462f508f11faab0213","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        port_id \u003d plugin._device_to_port_id(device)"},{"line_number":206,"context_line":"        if (host and"},{"line_number":207,"context_line":"            not plugin.port_bound_to_host(rpc_context, port_id, host) and"},{"line_number":208,"context_line":"            not self._ha_port_binding_stale(rpc_context, port_id)):"},{"line_number":209,"context_line":"            LOG.debug(\"Device %(device)s not bound to the\""},{"line_number":210,"context_line":"                      \" agent host %(host)s\","},{"line_number":211,"context_line":"                      {\u0027device\u0027: device, \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":14,"id":"9aa53dc9_a08518ae","line":208,"updated":"2015-04-07 18:59:16.000000000","message":"why is there no symmetric check in update_device_down?","commit_id":"116e9ee4afb2c7156b830700d8bee986634fe9a4"}],"neutron/tests/unit/db/test_l3_hamode_db.py":[{"author":{"_account_id":6697,"name":"Sandhya Dasu","email":"sandhya.openinfra@gmail.com","username":"sadasu"},"change_message_id":"b375d1045b3d4691aa7572068c3bf621fe5d04ba","unresolved":false,"context_lines":[{"line_number":538,"context_line":""},{"line_number":539,"context_line":"    def test_update_router_port_bindings_no_ports(self):"},{"line_number":540,"context_line":"        self.plugin._update_router_port_bindings("},{"line_number":541,"context_line":"            self.admin_ctx, {}, self.agent1[\u0027host\u0027])"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _get_first_interface(self, router_id):"},{"line_number":544,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa53dc9_117e2119","line":541,"updated":"2015-04-08 20:42:11.000000000","message":"What is being tested here?","commit_id":"1c3d85b00e2764ffe3dede3b7a0e7a55e713c7e6"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"7439fa93f632c7f93f511e0eb9d986905447c20f","unresolved":false,"context_lines":[{"line_number":538,"context_line":""},{"line_number":539,"context_line":"    def test_update_router_port_bindings_no_ports(self):"},{"line_number":540,"context_line":"        self.plugin._update_router_port_bindings("},{"line_number":541,"context_line":"            self.admin_ctx, {}, self.agent1[\u0027host\u0027])"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"    def _get_first_interface(self, router_id):"},{"line_number":544,"context_line":"        device_filter \u003d {\u0027device_id\u0027: [router_id],"}],"source_content_type":"text/x-python","patch_set":17,"id":"9aa53dc9_d121d9fc","line":541,"in_reply_to":"9aa53dc9_117e2119","updated":"2015-04-08 20:45:43.000000000","message":"That calling the method with no ports runs without raising an exception. It\u0027s testing an edge case.","commit_id":"1c3d85b00e2764ffe3dede3b7a0e7a55e713c7e6"}],"neutron/tests/unit/ml2/drivers/test_l2population.py":[{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":1034,"context_line":""},{"line_number":1035,"context_line":"    def test_fdb_add_called_with_ha_router_port_on_same_host(self):"},{"line_number":1036,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1037,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST + \u0027_2\u0027)"},{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_d7bed4fe","line":1037,"updated":"2015-02-23 16:57:52.000000000","message":"Could you please use L2_NET_AGENT_2.host as an argument of  _create_ha_router_port()? and generalize this usage in all the UT you add?","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":1034,"context_line":""},{"line_number":1035,"context_line":"    def test_fdb_add_called_with_ha_router_port_on_same_host(self):"},{"line_number":1036,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1037,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST + \u0027_2\u0027)"},{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_80b838c9","line":1037,"in_reply_to":"ba7be1f8_d7bed4fe","updated":"2015-02-25 13:54:44.000000000","message":"Done","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST + \u0027_2\u0027)"},{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"},{"line_number":1041,"context_line":"            port \u003d self._create_compute_port(subnet, NET_HOST)"},{"line_number":1042,"context_line":""},{"line_number":1043,"context_line":"            self.mock_cast.reset_mock()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_ab41033b","line":1040,"updated":"2015-02-23 16:57:52.000000000","message":"why do you create 2 ports here?","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST + \u0027_2\u0027)"},{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"},{"line_number":1041,"context_line":"            port \u003d self._create_compute_port(subnet, NET_HOST)"},{"line_number":1042,"context_line":""},{"line_number":1043,"context_line":"            self.mock_cast.reset_mock()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_60534439","line":1040,"in_reply_to":"ba7be1f8_ab41033b","updated":"2015-02-25 13:54:44.000000000","message":"Done","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"},{"line_number":1041,"context_line":"            port \u003d self._create_compute_port(subnet, NET_HOST)"},{"line_number":1042,"context_line":""},{"line_number":1043,"context_line":"            self.mock_cast.reset_mock()"},{"line_number":1044,"context_line":"            self.mock_fanout.reset_mock()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_b7bfa0fb","line":1041,"updated":"2015-02-23 16:57:52.000000000","message":"For ha_router port to be on the same host as the compute port, I think that the compute port should be hosted on NET_HOST_2, am I wrong?","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":1038,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1039,"context_line":""},{"line_number":1040,"context_line":"            self._create_compute_port(subnet, HOST)"},{"line_number":1041,"context_line":"            port \u003d self._create_compute_port(subnet, NET_HOST)"},{"line_number":1042,"context_line":""},{"line_number":1043,"context_line":"            self.mock_cast.reset_mock()"},{"line_number":1044,"context_line":"            self.mock_fanout.reset_mock()"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_0027e8ca","line":1041,"in_reply_to":"ba7be1f8_b7bfa0fb","updated":"2015-02-25 13:54:44.000000000","message":"Done","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def test_fdb_add_called_with_ha_router_port_on_different_host(self):"},{"line_number":1053,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1054,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST)"},{"line_number":1055,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1056,"context_line":""},{"line_number":1057,"context_line":"            port \u003d self._create_compute_port(subnet, HOST)"},{"line_number":1058,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_d74ed4c0","line":1055,"updated":"2015-02-23 16:57:52.000000000","message":"ditto","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def test_fdb_add_called_with_ha_router_port_on_different_host(self):"},{"line_number":1053,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1054,"context_line":"            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST)"},{"line_number":1055,"context_line":"            self._update_port_up(ha_port, HOST)"},{"line_number":1056,"context_line":""},{"line_number":1057,"context_line":"            port \u003d self._create_compute_port(subnet, HOST)"},{"line_number":1058,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_1bdcb972","line":1055,"in_reply_to":"ba7be1f8_d74ed4c0","updated":"2015-02-25 13:54:44.000000000","message":"Done","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"74f1ff37472414a7e017220dfe0b4f3fae31cc46","unresolved":false,"context_lines":[{"line_number":1071,"context_line":"            self._assert_fanout_add(port[\u0027network_id\u0027],"},{"line_number":1072,"context_line":"                                    {\u002720.0.0.1\u0027: FLOODING_FDB +"},{"line_number":1073,"context_line":"                                     self._expect_port_fdbs(port)})"},{"line_number":1074,"context_line":""},{"line_number":1075,"context_line":"    def test_delete_ha_router_port(self):"},{"line_number":1076,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1077,"context_line":"            port \u003d self._create_ha_router_port(subnet, NET_HOST)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_22d7edee","line":1074,"updated":"2015-02-23 16:57:52.000000000","message":"consider this test that should pass if you want to compute port to use ARP responders\n\ndef test_fdb_add_called_with_ha_router_2cpu_ports(self):\n        with self.subnet(network\u003dself._network) as subnet:\n            ha_port \u003d self._create_ha_router_port(subnet, NET_HOST)\n            self._update_port_up(ha_port, NET_HOST)\n\n            port \u003d self._create_compute_port(subnet, NET_HOST)\n            self._update_port_up(port, NET_HOST)\n\n            port2 \u003d self._create_compute_port(subnet, NET_HOST+ \u0027_2\u0027)\n            self.mock_cast.reset_mock()\n            self.mock_fanout.reset_mock()\n            self._update_port_up(port2, NET_HOST + \u0027_2\u0027)\n\n            expected_cast \u003d {port[\u0027network_id\u0027]:\n                             {\u0027ports\u0027:\n                              {\u002730.0.0.1\u0027: FLOODING_FDB +\n                                self._expect_port_fdbs(port)},\n                              \u0027network_type\u0027: \u0027vxlan\u0027,\n                              \u0027segment_id\u0027: 1}}\n            self.mock_cast.assert_called_with(\n                mock.ANY, \u0027add_fdb_entries\u0027, expected_cast, NET_HOST)","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"8d7193b59c8e3021baf19b969ca558951a74e4be","unresolved":false,"context_lines":[{"line_number":1071,"context_line":"            self._assert_fanout_add(port[\u0027network_id\u0027],"},{"line_number":1072,"context_line":"                                    {\u002720.0.0.1\u0027: FLOODING_FDB +"},{"line_number":1073,"context_line":"                                     self._expect_port_fdbs(port)})"},{"line_number":1074,"context_line":""},{"line_number":1075,"context_line":"    def test_delete_ha_router_port(self):"},{"line_number":1076,"context_line":"        with self.subnet(network\u003dself._network) as subnet:"},{"line_number":1077,"context_line":"            port \u003d self._create_ha_router_port(subnet, NET_HOST)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_634c2b9f","line":1074,"in_reply_to":"ba7be1f8_22d7edee","updated":"2015-02-25 13:54:44.000000000","message":"As I explained this is not necessary since port2 won\u0027t be the first port on the host (the router automatically is shceduled to both l3 agents, thus the ha port is already there).\n\nI did however add a test to see that compute port FDB gets sent when present with a distributed port.","commit_id":"0fbeef38258db0bfb3deceb52992b39cfd169aa6"}]}
