)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"fdc823c2b061cde7a86ff75bdeb51c11214ea84a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Ensure that host routes are maintained for each subnet within"},{"line_number":10,"context_line":"a network. Subnets associated with different segments on the"},{"line_number":11,"context_line":"same network get\u0027s host_routes enties added/removed as"},{"line_number":12,"context_line":"subnets are created, deleted or updated."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Closes-Bug: #1766380"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_96d538e8","line":11,"range":{"start_line":11,"start_character":31,"end_line":11,"end_character":37},"updated":"2018-06-05 22:56:55.000000000","message":"entries","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"546dacfdbf487f5aab4d1e40888a2ee90ec9e868","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_75bcad05","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"updated":"2018-05-28 10:49:37.000000000","message":"This entire function is about updating peer subnets when a subnet is either created, updated or deleted.\n\nIt is called on create/update post-commit and on delete. \n\nActually I think we could drop it from update_subnet_postcommit. Since a subnet update does not allow changeing the cidr all of the peer network\u0027s routes should already be correct.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"db42c8113064607febfda7ca9bb77324c57639c1","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_392e478c","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"in_reply_to":"5f7c97a3_71262119","updated":"2018-06-08 16:44:54.000000000","message":"Never mind. I think I get how it can be done in the segments plugin now.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"fdc823c2b061cde7a86ff75bdeb51c11214ea84a","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_f6434c6b","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"in_reply_to":"5f7c97a3_75bcad05","updated":"2018-06-05 22:56:55.000000000","message":"Is the DB core plugin the correct level of abstraction to implement this functionality? This plugin knows about creating networks, ports and subnets in the DB. That\u0027s the extent of its responsibilities. I am afraid we are polluting it with knowledge of segments and routed networks that doesn\u0027t fit in this class. If you look at the ML2 plugin, it sends notifications when subnets are created: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L1063. Why not use these notifications to create the routes in a class similar to what is done to create in Placement the IPv4 inventories for routed networks (https://github.com/openstack/neutron/blob/master/neutron/services/segments/plugin.py#L187)? This class could reside in neutron.services.segments.plugin","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"75c7af0178a3eca5fa4f60452cf2b219a9158535","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_3fcf4258","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"in_reply_to":"5f7c97a3_f6434c6b","updated":"2018-06-06 16:34:04.000000000","message":"IMO we should follow up to make the link-local routes[1] that is added in the dhcp agent today here, so that they are also visible. (This is why I did this here. Thinking a follow up to include the link-local routes for non-routed networks ...)\n\nBut it may make sense if we decide to do link-local routes using the notifications as well? Or not do it at all, and in that case I aggree that this should be moved to the segmens service plugin.)\n\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/agent/linux/dhcp.py#L942-L948","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"11359ef189f4b6ad5df5af48e5f01a1af12c1423","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_71262119","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"in_reply_to":"5f7c97a3_f6434c6b","updated":"2018-06-08 09:32:19.000000000","message":"If I use the notifications will I be able to mixin/merge the hostroutes that we calculate for the routed network when a new subnet is created? e.g would the respons of a create request include the routes? Or would it be create -\u003e event -\u003e update to land the calculated routes?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"58e9488342497593bbd0e8c1d7e32c8fc0fc1fc2","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            external_gateway_info}}"},{"line_number":709,"context_line":"        l3plugin.update_router(context, router_id, info)"},{"line_number":710,"context_line":""},{"line_number":711,"context_line":"    def _update_routed_network_host_routes(self, context, network,"},{"line_number":712,"context_line":"                                           old_cidr\u003dNone):"},{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_8e6574e3","line":711,"range":{"start_line":711,"start_character":7,"end_line":711,"end_character":42},"in_reply_to":"5f7c97a3_f6434c6b","updated":"2018-06-13 13:08:36.000000000","message":"Thanks for this suggestion Miquel.\nI have change this to use the notifications, and the code now lives in the neutron.services.segments.plugin.\n\nI split the work it into three patches: (I hope this split is helpful for reviewers.)\nhttps://review.openstack.org/573896\nhttps://review.openstack.org/570405\nhttps://review.openstack.org/573897\n\nAlso the shim extension for neutron-lig:\nhttps://review.openstack.org/574706","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":25618,"name":"Paweł Suder","email":"pawel@suder.info","username":"SuderPawel"},"change_message_id":"2055211a509c291285d8b25a693f3e634ea86fc5","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"},{"line_number":715,"context_line":"        for subnet in network.subnets:"},{"line_number":716,"context_line":"            hr \u003d self.get_subnet(context, subnet.id,"},{"line_number":717,"context_line":"                                 fields\u003d[\u0027host_routes\u0027])[\u0027host_routes\u0027]"},{"line_number":718,"context_line":"            calc_hr \u003d self._calculate_host_routes("},{"line_number":719,"context_line":"                context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_7ca81a1f","line":716,"range":{"start_line":716,"start_character":12,"end_line":716,"end_character":14},"updated":"2018-05-28 07:32:19.000000000","message":"3. That hr ;)","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"546dacfdbf487f5aab4d1e40888a2ee90ec9e868","unresolved":false,"context_lines":[{"line_number":713,"context_line":"        LOG.debug(\"Updating host routes for subnets on routed network %s\","},{"line_number":714,"context_line":"                  network.id)"},{"line_number":715,"context_line":"        for subnet in network.subnets:"},{"line_number":716,"context_line":"            hr \u003d self.get_subnet(context, subnet.id,"},{"line_number":717,"context_line":"                                 fields\u003d[\u0027host_routes\u0027])[\u0027host_routes\u0027]"},{"line_number":718,"context_line":"            calc_hr \u003d self._calculate_host_routes("},{"line_number":719,"context_line":"                context\u003dcontext,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_b5f9e5c8","line":716,"range":{"start_line":716,"start_character":12,"end_line":716,"end_character":14},"in_reply_to":"5f7c97a3_7ca81a1f","updated":"2018-05-28 10:49:37.000000000","message":"So I\u0027m not convinced about the validate name. See comment on L733.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":25618,"name":"Paweł Suder","email":"pawel@suder.info","username":"SuderPawel"},"change_message_id":"2055211a509c291285d8b25a693f3e634ea86fc5","unresolved":false,"context_lines":[{"line_number":725,"context_line":"                routes\u003dcopy.deepcopy(hr),"},{"line_number":726,"context_line":"                gateway_ip\u003dsubnet.gateway_ip,"},{"line_number":727,"context_line":"                old_cidr\u003dold_cidr)"},{"line_number":728,"context_line":"            if (set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in hr) !\u003d"},{"line_number":729,"context_line":"                    set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in calc_hr)):"},{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_dcafee27","line":729,"range":{"start_line":728,"start_character":15,"end_line":729,"end_character":75},"updated":"2018-05-28 07:32:19.000000000","message":"2. What if this will be replaced with self._validate_hr?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":725,"context_line":"                routes\u003dcopy.deepcopy(hr),"},{"line_number":726,"context_line":"                gateway_ip\u003dsubnet.gateway_ip,"},{"line_number":727,"context_line":"                old_cidr\u003dold_cidr)"},{"line_number":728,"context_line":"            if (set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in hr) !\u003d"},{"line_number":729,"context_line":"                    set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in calc_hr)):"},{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_ae64a7e6","line":729,"range":{"start_line":728,"start_character":15,"end_line":729,"end_character":75},"in_reply_to":"5f7c97a3_55d89179","updated":"2018-06-05 12:43:46.000000000","message":"+1 for new function with some \"self explaining\" name :)","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"58e9488342497593bbd0e8c1d7e32c8fc0fc1fc2","unresolved":false,"context_lines":[{"line_number":725,"context_line":"                routes\u003dcopy.deepcopy(hr),"},{"line_number":726,"context_line":"                gateway_ip\u003dsubnet.gateway_ip,"},{"line_number":727,"context_line":"                old_cidr\u003dold_cidr)"},{"line_number":728,"context_line":"            if (set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in hr) !\u003d"},{"line_number":729,"context_line":"                    set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in calc_hr)):"},{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_6e3c98c7","line":729,"range":{"start_line":728,"start_character":15,"end_line":729,"end_character":75},"in_reply_to":"5f7c97a3_ae64a7e6","updated":"2018-06-13 13:08:36.000000000","message":"Done","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"546dacfdbf487f5aab4d1e40888a2ee90ec9e868","unresolved":false,"context_lines":[{"line_number":725,"context_line":"                routes\u003dcopy.deepcopy(hr),"},{"line_number":726,"context_line":"                gateway_ip\u003dsubnet.gateway_ip,"},{"line_number":727,"context_line":"                old_cidr\u003dold_cidr)"},{"line_number":728,"context_line":"            if (set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in hr) !\u003d"},{"line_number":729,"context_line":"                    set((r[\u0027destination\u0027], r[\u0027nexthop\u0027]) for r in calc_hr)):"},{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_55d89179","line":729,"range":{"start_line":728,"start_character":15,"end_line":729,"end_character":75},"in_reply_to":"5f7c97a3_dcafee27","updated":"2018-05-28 10:49:37.000000000","message":"I guess we could make a function out of the set comparison here. to make it more clear that we test if the exising hostroutes and the calculated hostroutes for a peer subnet is different? We only update the peer-subnet if it is required.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":25618,"name":"Paweł Suder","email":"pawel@suder.info","username":"SuderPawel"},"change_message_id":"2055211a509c291285d8b25a693f3e634ea86fc5","unresolved":false,"context_lines":[{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    def _calculate_host_routes(self, context, ip_version, network_id,"},{"line_number":734,"context_line":"                               network\u003dNone, subnet_id\u003dNone, segment_id\u003dNone,"},{"line_number":735,"context_line":"                               routes\u003dNone, gateway_ip\u003dNone,"},{"line_number":736,"context_line":"                               old_gateway_ip\u003dNone, old_cidr\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_fcb42a84","line":733,"range":{"start_line":733,"start_character":8,"end_line":733,"end_character":30},"updated":"2018-05-28 07:32:19.000000000","message":"1. I am considering if this could be replaced with _validate_hr.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":25618,"name":"Paweł Suder","email":"pawel@suder.info","username":"SuderPawel"},"change_message_id":"cd21ba16d79bd3f38bd4e99b1ce8aab776e6a081","unresolved":false,"context_lines":[{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    def _calculate_host_routes(self, context, ip_version, network_id,"},{"line_number":734,"context_line":"                               network\u003dNone, subnet_id\u003dNone, segment_id\u003dNone,"},{"line_number":735,"context_line":"                               routes\u003dNone, gateway_ip\u003dNone,"},{"line_number":736,"context_line":"                               old_gateway_ip\u003dNone, old_cidr\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_1248e62a","line":733,"range":{"start_line":733,"start_character":8,"end_line":733,"end_character":30},"in_reply_to":"5f7c97a3_35d39562","updated":"2018-05-29 07:34:54.000000000","message":"Understand, but at this moment output of that method is used only for validation output from method get_subnet.\n\nI am wondering if _calculate_host_routes might be transposed to _check_host_routes to speed up process of comparison only.\n\nThat might be useful ONLY if _calculate_hosts_routes will be used ONLY for comparison.\n\nWhat do you think?\n\nEDIT: I read body of that method and noticed that method modifies parameter routes. I am not a big fan of modifying something what is passed as argument and returning it as a result of method.\n\nIMO method should have different name, i.e _modifies_routes or _recalculate_routes.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"546dacfdbf487f5aab4d1e40888a2ee90ec9e868","unresolved":false,"context_lines":[{"line_number":730,"context_line":"                self.update_subnet(context, subnet.id,"},{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    def _calculate_host_routes(self, context, ip_version, network_id,"},{"line_number":734,"context_line":"                               network\u003dNone, subnet_id\u003dNone, segment_id\u003dNone,"},{"line_number":735,"context_line":"                               routes\u003dNone, gateway_ip\u003dNone,"},{"line_number":736,"context_line":"                               old_gateway_ip\u003dNone, old_cidr\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_35d39562","line":733,"range":{"start_line":733,"start_character":8,"end_line":733,"end_character":30},"in_reply_to":"5f7c97a3_fcb42a84","updated":"2018-05-28 10:49:37.000000000","message":"This function is used t calculate the host routes for a subnet. It is called from precomming classas and also for each subnet on the network in the _update_routed_network_host_routes.\n\nThis does modify the hostroutes, so I am not convinced about using validate as a name? To me validation is about checking the content and returning True if it is correct syntax/schema?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    def _calculate_host_routes(self, context, ip_version, network_id,"},{"line_number":734,"context_line":"                               network\u003dNone, subnet_id\u003dNone, segment_id\u003dNone,"},{"line_number":735,"context_line":"                               routes\u003dNone, gateway_ip\u003dNone,"},{"line_number":736,"context_line":"                               old_gateway_ip\u003dNone, old_cidr\u003dNone):"},{"line_number":737,"context_line":"        if network is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_4e0073ac","line":734,"updated":"2018-06-05 12:43:46.000000000","message":"what is the point to pass both network_id and network object to this method?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"58e9488342497593bbd0e8c1d7e32c8fc0fc1fc2","unresolved":false,"context_lines":[{"line_number":731,"context_line":"                                   {\u0027subnet\u0027: {\u0027host_routes\u0027: calc_hr}})"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    def _calculate_host_routes(self, context, ip_version, network_id,"},{"line_number":734,"context_line":"                               network\u003dNone, subnet_id\u003dNone, segment_id\u003dNone,"},{"line_number":735,"context_line":"                               routes\u003dNone, gateway_ip\u003dNone,"},{"line_number":736,"context_line":"                               old_gateway_ip\u003dNone, old_cidr\u003dNone):"},{"line_number":737,"context_line":"        if network is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_cef28c05","line":734,"in_reply_to":"5f7c97a3_4e0073ac","updated":"2018-06-13 13:08:36.000000000","message":"The method is/was called from different places. In one place where it was called I had the network, in the other I only had the network_id ... Not very pretty. Anyway, it has been changed in the latest patchset to only take the network object.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":757,"context_line":"            if gateway_ip:"},{"line_number":758,"context_line":"                new_route \u003d {\u0027destination\u0027: subnet.cidr,"},{"line_number":759,"context_line":"                             \u0027nexthop\u0027: gateway_ip}"},{"line_number":760,"context_line":"                if (new_route[\u0027destination\u0027] not in"},{"line_number":761,"context_line":"                        [route[\u0027destination\u0027] for route in routes]):"},{"line_number":762,"context_line":"                    routes.append(new_route)"},{"line_number":763,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0e9fdb65","line":760,"range":{"start_line":760,"start_character":20,"end_line":760,"end_character":44},"updated":"2018-06-05 12:43:46.000000000","message":"nit: it can be \"subnet.cidr\", right?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"58e9488342497593bbd0e8c1d7e32c8fc0fc1fc2","unresolved":false,"context_lines":[{"line_number":757,"context_line":"            if gateway_ip:"},{"line_number":758,"context_line":"                new_route \u003d {\u0027destination\u0027: subnet.cidr,"},{"line_number":759,"context_line":"                             \u0027nexthop\u0027: gateway_ip}"},{"line_number":760,"context_line":"                if (new_route[\u0027destination\u0027] not in"},{"line_number":761,"context_line":"                        [route[\u0027destination\u0027] for route in routes]):"},{"line_number":762,"context_line":"                    routes.append(new_route)"},{"line_number":763,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_ee60a8a7","line":760,"range":{"start_line":760,"start_character":20,"end_line":760,"end_character":44},"in_reply_to":"5f7c97a3_0e9fdb65","updated":"2018-06-13 13:08:36.000000000","message":"thanks. It is in the latest patchset.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":758,"context_line":"                new_route \u003d {\u0027destination\u0027: subnet.cidr,"},{"line_number":759,"context_line":"                             \u0027nexthop\u0027: gateway_ip}"},{"line_number":760,"context_line":"                if (new_route[\u0027destination\u0027] not in"},{"line_number":761,"context_line":"                        [route[\u0027destination\u0027] for route in routes]):"},{"line_number":762,"context_line":"                    routes.append(new_route)"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"        return routes"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_4ec71366","line":761,"range":{"start_line":761,"start_character":24,"end_line":761,"end_character":66},"updated":"2018-06-05 12:43:46.000000000","message":"can\u0027t it be done once before \"for\" loop starts?","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"58e9488342497593bbd0e8c1d7e32c8fc0fc1fc2","unresolved":false,"context_lines":[{"line_number":758,"context_line":"                new_route \u003d {\u0027destination\u0027: subnet.cidr,"},{"line_number":759,"context_line":"                             \u0027nexthop\u0027: gateway_ip}"},{"line_number":760,"context_line":"                if (new_route[\u0027destination\u0027] not in"},{"line_number":761,"context_line":"                        [route[\u0027destination\u0027] for route in routes]):"},{"line_number":762,"context_line":"                    routes.append(new_route)"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"        return routes"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0e6404b8","line":761,"range":{"start_line":761,"start_character":24,"end_line":761,"end_character":66},"in_reply_to":"5f7c97a3_4ec71366","updated":"2018-06-13 13:08:36.000000000","message":"thanks, it can and it should.","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":907,"context_line":"                                                            subnetpool_id)"},{"line_number":908,"context_line":"            # TODO(ihrachys): make sqlalchemy refresh expired relationships"},{"line_number":909,"context_line":"            getattr(network, \u0027subnets\u0027)"},{"line_number":910,"context_line":"        # NOTE(hjensas): Whithout this here len(network.subnets) in postcommit"},{"line_number":911,"context_line":"        # methods sometimes return a lenght of 0. (Seen only in unit testing.)"},{"line_number":912,"context_line":"        network \u003d self._get_network(context, subnet.network_id)"},{"line_number":913,"context_line":"        result \u003d self._make_subnet_dict(subnet, context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_6ea76fa9","line":910,"range":{"start_line":910,"start_character":25,"end_line":910,"end_character":33},"updated":"2018-06-05 12:43:46.000000000","message":"nitty nit: without","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"}],"neutron/services/segments/plugin.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f01874b8b46a7999be77811c055589958f282408","unresolved":false,"context_lines":[{"line_number":517,"context_line":"    @registry.receives(resources.SUBNET, [events.BEFORE_CREATE])"},{"line_number":518,"context_line":"    def host_routes_before_create(self, resource, event, trigger, context,"},{"line_number":519,"context_line":"                                  subnet, **kwargs):"},{"line_number":520,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027, None)"},{"line_number":521,"context_line":"        gateway_ip \u003d subnet.get(\u0027gateway_ip\u0027, None)"},{"line_number":522,"context_line":"        if validators.is_attr_set(subnet.get(\u0027host_routes\u0027)):"},{"line_number":523,"context_line":"            host_routes \u003d subnet.get(\u0027host_routes\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_1adaf8e7","line":520,"range":{"start_line":520,"start_character":46,"end_line":520,"end_character":50},"updated":"2018-06-26 18:20:53.000000000","message":"don\u0027t need None as it\u0027s the default returned if key not present","commit_id":"fe6293d72bc7811b48fcbc9c690e1978bdc26f65"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"7b8c25a184d580f21c307bd0afb1bc07abdfae63","unresolved":false,"context_lines":[{"line_number":517,"context_line":"    @registry.receives(resources.SUBNET, [events.BEFORE_CREATE])"},{"line_number":518,"context_line":"    def host_routes_before_create(self, resource, event, trigger, context,"},{"line_number":519,"context_line":"                                  subnet, **kwargs):"},{"line_number":520,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027, None)"},{"line_number":521,"context_line":"        gateway_ip \u003d subnet.get(\u0027gateway_ip\u0027, None)"},{"line_number":522,"context_line":"        if validators.is_attr_set(subnet.get(\u0027host_routes\u0027)):"},{"line_number":523,"context_line":"            host_routes \u003d subnet.get(\u0027host_routes\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_a44c0376","line":520,"range":{"start_line":520,"start_character":46,"end_line":520,"end_character":50},"in_reply_to":"5f7c97a3_1adaf8e7","updated":"2018-06-26 21:54:57.000000000","message":"Done","commit_id":"fe6293d72bc7811b48fcbc9c690e1978bdc26f65"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f01874b8b46a7999be77811c055589958f282408","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                segment_id\u003dsubnet[\u0027segment_id\u0027],"},{"line_number":533,"context_line":"                host_routes\u003dcopy.deepcopy(host_routes),"},{"line_number":534,"context_line":"                gateway_ip\u003dgateway_ip)"},{"line_number":535,"context_line":"            if self._host_routes_need_update(host_routes, calc_host_routes):"},{"line_number":536,"context_line":"                subnet[\u0027host_routes\u0027] \u003d calc_host_routes"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    @registry.receives(resources.SUBNET, [events.BEFORE_UPDATE])"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_1d03d243","line":535,"updated":"2018-06-26 18:20:53.000000000","message":"I guess if host_routes is empty you don\u0027t need to do the check and can just set directly - if not host_routes or ...\nBut this isn\u0027t called often enough to worry i would think.","commit_id":"fe6293d72bc7811b48fcbc9c690e1978bdc26f65"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"7b8c25a184d580f21c307bd0afb1bc07abdfae63","unresolved":false,"context_lines":[{"line_number":532,"context_line":"                segment_id\u003dsubnet[\u0027segment_id\u0027],"},{"line_number":533,"context_line":"                host_routes\u003dcopy.deepcopy(host_routes),"},{"line_number":534,"context_line":"                gateway_ip\u003dgateway_ip)"},{"line_number":535,"context_line":"            if self._host_routes_need_update(host_routes, calc_host_routes):"},{"line_number":536,"context_line":"                subnet[\u0027host_routes\u0027] \u003d calc_host_routes"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    @registry.receives(resources.SUBNET, [events.BEFORE_UPDATE])"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_448f2f2d","line":535,"in_reply_to":"5f7c97a3_1d03d243","updated":"2018-06-26 21:54:57.000000000","message":"hmm, yeah. Only when user did\u0027nt provide any host routes and going from 1 to 2 subnets I think. Tiny optimization, so why not. Done.","commit_id":"fe6293d72bc7811b48fcbc9c690e1978bdc26f65"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"c991c00bf03ecd0ca3fba7b7317ad6d16ae236dd","unresolved":false,"context_lines":[{"line_number":438,"context_line":"class SegmentHostRoutes(object):"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _get_network(self, context, network_id):"},{"line_number":441,"context_line":"        return context.session.query(models_v2.Network).filter("},{"line_number":442,"context_line":"            models_v2.Network.id \u003d\u003d network_id).one()"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    def _calculate_routed_network_host_routes(self, context, ip_version,"},{"line_number":445,"context_line":"                                              network\u003dNone, subnet_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_4935f144","line":442,"range":{"start_line":441,"start_character":15,"end_line":442,"end_character":53},"updated":"2018-06-27 16:42:45.000000000","message":"why not using object ? since network object is available and can be used.","commit_id":"8d580dc0379842a6a83e922d71f6bc1ffbc85d23"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"5f77186541286e60f378ec0505857e194fe82e96","unresolved":false,"context_lines":[{"line_number":438,"context_line":"class SegmentHostRoutes(object):"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    def _get_network(self, context, network_id):"},{"line_number":441,"context_line":"        return context.session.query(models_v2.Network).filter("},{"line_number":442,"context_line":"            models_v2.Network.id \u003d\u003d network_id).one()"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    def _calculate_routed_network_host_routes(self, context, ip_version,"},{"line_number":445,"context_line":"                                              network\u003dNone, subnet_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_4983b1cc","line":442,"range":{"start_line":441,"start_character":15,"end_line":442,"end_character":53},"in_reply_to":"5f7c97a3_4935f144","updated":"2018-06-27 16:44:15.000000000","message":"and net_obj is already imported","commit_id":"8d580dc0379842a6a83e922d71f6bc1ffbc85d23"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"56351f7d6b40d9b25e7381fcaa559d32ef2b6199","unresolved":false,"context_lines":[{"line_number":514,"context_line":"                 set((route[\u0027destination\u0027],"},{"line_number":515,"context_line":"                      route[\u0027nexthop\u0027]) for route in calc_host_routes)))"},{"line_number":516,"context_line":""},{"line_number":517,"context_line":"    @registry.receives(resources.SUBNET, [events.BEFORE_CREATE])"},{"line_number":518,"context_line":"    def host_routes_before_create(self, resource, event, trigger, context,"},{"line_number":519,"context_line":"                                  subnet, **kwargs):"},{"line_number":520,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_bfbe4ed1","line":517,"range":{"start_line":517,"start_character":49,"end_line":517,"end_character":62},"updated":"2018-06-27 01:54:10.000000000","message":"Aren\u0027t you amazed that Kevin Benton, in his infinite wisdom, foresaw that you would be needing it and left a designated place in the ML2 plugin to add this notification just for you ;-)","commit_id":"8d580dc0379842a6a83e922d71f6bc1ffbc85d23"}],"neutron/tests/unit/extensions/test_segment.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":2445,"context_line":"                             segment_id\u003dsegment0[\u0027id\u0027],"},{"line_number":2446,"context_line":"                             gateway_ip\u003dgateway_ips[0],"},{"line_number":2447,"context_line":"                             cidr\u003dcidrs[0]) as subnet0:"},{"line_number":2448,"context_line":"                with self.subnet(network\u003dnetwork,"},{"line_number":2449,"context_line":"                                 segment_id\u003dsegment1[\u0027id\u0027],"},{"line_number":2450,"context_line":"                                 gateway_ip\u003dgateway_ips[1],"},{"line_number":2451,"context_line":"                                 cidr\u003dcidrs[1]) as subnet1:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_4ef15395","line":2448,"updated":"2018-06-05 12:43:46.000000000","message":"nit: second \"with\" isn\u0027t necessary here. Both subnets can be in one \"with\"","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a87702df7cbfec6c1b89773aa355a32e12a3774e","unresolved":false,"context_lines":[{"line_number":2497,"context_line":"                             segment_id\u003dsegment[\u0027id\u0027],"},{"line_number":2498,"context_line":"                             gateway_ip\u003dgateway_ips[0],"},{"line_number":2499,"context_line":"                             cidr\u003dcidrs[0]) as subnet0:"},{"line_number":2500,"context_line":"                with self.subnet(network\u003dnetwork,"},{"line_number":2501,"context_line":"                                 segment_id\u003dsegment[\u0027id\u0027],"},{"line_number":2502,"context_line":"                                 gateway_ip\u003dgateway_ips[1],"},{"line_number":2503,"context_line":"                                 cidr\u003dcidrs[1]) as subnet1:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0e127bb5","line":2500,"updated":"2018-06-05 12:43:46.000000000","message":"same here, You will have one indentation level less :)","commit_id":"37f06c8326c3491acd4ddd86295dc3d569dc6088"}]}
