)]}'
{"neutron/ipam/requests.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3d2e317616b7f4b4fc71eca1d8ad3c0a9eaffb9b","unresolved":true,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        self._subnet_cidr \u003d netaddr.IPNetwork(subnet_cidr)"},{"line_number":185,"context_line":"        self._validate_with_subnet(self._subnet_cidr)"},{"line_number":186,"context_line":"        self._validate_gateway_ip_in_subnet(self._subnet_cidr, self.gateway_ip)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    @property"},{"line_number":189,"context_line":"    def subnet_cidr(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"b068f3d0_b60091cf","line":186,"range":{"start_line":186,"start_character":8,"end_line":186,"end_character":79},"updated":"2021-01-21 12:26:18.000000000","message":"Wasn\u0027t this validated before? This relates to the case when user specifies both subnet CIDR and gateway IP, right?","commit_id":"29722407c1b4faf7b79287f68f9ada0524fb281a"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"715f956c4878c15931ac2b19b10770945daebb5b","unresolved":true,"context_lines":[{"line_number":337,"context_line":"                if not validators.is_attr_set(prefixlen):"},{"line_number":338,"context_line":"                    prefixlen \u003d int(subnetpool[\u0027default_prefixlen\u0027])"},{"line_number":339,"context_line":"                gw_ip_net \u003d netaddr.IPNetwork(str(gateway_ip) +"},{"line_number":340,"context_line":"                                              \u0027/%s\u0027 % prefixlen)"},{"line_number":341,"context_line":"                cidr \u003d gw_ip_net.cidr"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"            return SpecificSubnetRequest("}],"source_content_type":"text/x-python","patch_set":5,"id":"39f062fa_29ccec24","line":340,"updated":"2021-02-02 10:57:40.000000000","message":"nitty nit:\nwhy not\n\n    netaddr.IPNetwork(\"%s/%s\" % (gateway_ip, prefixlen))","commit_id":"5f24850339acde490d3527726250df9feb4ababc"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"75964d3248cdc1d3fc6502c417afa5566e9355cb","unresolved":true,"context_lines":[{"line_number":337,"context_line":"                if not validators.is_attr_set(prefixlen):"},{"line_number":338,"context_line":"                    prefixlen \u003d int(subnetpool[\u0027default_prefixlen\u0027])"},{"line_number":339,"context_line":"                gw_ip_net \u003d netaddr.IPNetwork(str(gateway_ip) +"},{"line_number":340,"context_line":"                                              \u0027/%s\u0027 % prefixlen)"},{"line_number":341,"context_line":"                cidr \u003d gw_ip_net.cidr"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"            return SpecificSubnetRequest("}],"source_content_type":"text/x-python","patch_set":5,"id":"8b5dbec8_c5b05c38","line":340,"in_reply_to":"39f062fa_29ccec24","updated":"2021-02-18 12:45:52.000000000","message":"Much better","commit_id":"5f24850339acde490d3527726250df9feb4ababc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"22e15360373599e1e27b316906acdd44d6662d72","unresolved":true,"context_lines":[{"line_number":112,"context_line":"                                \"allocation_pools are not in the subnet\"))"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @staticmethod"},{"line_number":115,"context_line":"    def _validate_gateway_ip_in_subnet(subnet_cidr, gateway_ip):"},{"line_number":116,"context_line":"        if not gateway_ip:"},{"line_number":117,"context_line":"            return"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"2547b63d_70c28875","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":38},"updated":"2021-02-19 07:36:59.000000000","message":"I think this validation should be done at plugin level for consistency with non-subnetpool case: https://github.com/openstack/neutron/blob/90309cf6e2f3ed5ae6d5f4cca3c5351c2ac67a13/neutron/db/db_base_plugin_v2.py#L853 - like in \u0027else\u0027 block of this \u0027if\u0027: https://github.com/openstack/neutron/blob/90309cf6e2f3ed5ae6d5f4cca3c5351c2ac67a13/neutron/db/db_base_plugin_v2.py#L837\n\nWhat do you think?","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f00f113e1a4286da7cffd18ee0bf14cb479f3968","unresolved":true,"context_lines":[{"line_number":112,"context_line":"                                \"allocation_pools are not in the subnet\"))"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @staticmethod"},{"line_number":115,"context_line":"    def _validate_gateway_ip_in_subnet(subnet_cidr, gateway_ip):"},{"line_number":116,"context_line":"        if not gateway_ip:"},{"line_number":117,"context_line":"            return"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"4dfdc53e_3066290a","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":38},"in_reply_to":"025bb1c6_8b036dc8","updated":"2021-02-19 11:41:53.000000000","message":"I agree that subnet request validation should be the responsibility of IPAM backend.\nHowever my concern is that cidr \u003c-\u003e gateway_ip is quite a generic check and it\u0027s weird to have it at different levels, ideally it should be done once in the code (or at least at same level).\n\nDo you mean we should move the check from https://github.com/openstack/neutron/blob/90309cf6e2f3ed5ae6d5f4cca3c5351c2ac67a13/neutron/db/db_base_plugin_v2.py#L853 - to the IPAM level?","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"4ccd5c1f95459360d05fd95e7f59341d6f25806e","unresolved":true,"context_lines":[{"line_number":112,"context_line":"                                \"allocation_pools are not in the subnet\"))"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @staticmethod"},{"line_number":115,"context_line":"    def _validate_gateway_ip_in_subnet(subnet_cidr, gateway_ip):"},{"line_number":116,"context_line":"        if not gateway_ip:"},{"line_number":117,"context_line":"            return"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"025bb1c6_8b036dc8","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":38},"in_reply_to":"2547b63d_70c28875","updated":"2021-02-19 10:40:02.000000000","message":"I think just the opposite: the validation should be done by the particular IPAM SubnetRequest class used. This subclass (SpecificSubnetRequest, AnySubnetRequest) should have the logic to allow or reject the subnet creation. If we implemented a IPAM pluggable backend to handle everything related to subnets, IPs, pools, etc., why are we checking all this [1] in the plugin?\n\nThe IPAM backend is in charge of creating the needed SubnetRequest subclass instance, depending on the network and subnet attributes passed. There [2] is where part of those checks should be done or when the request is executed.\n\n[1]https://github.com/openstack/neutron/blob/90309cf6e2f3ed5ae6d5f4cca3c5351c2ac67a13/neutron/db/db_base_plugin_v2.py#L821-L853\n[2]https://github.com/openstack/neutron/blob/1994fbb8f909178dd8dfc45efd880429b5257e4c/neutron/db/ipam_pluggable_backend.py#L588","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"05aad3d8597c9409ce6ef6c254810c1abaf291e6","unresolved":true,"context_lines":[{"line_number":112,"context_line":"                                \"allocation_pools are not in the subnet\"))"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @staticmethod"},{"line_number":115,"context_line":"    def _validate_gateway_ip_in_subnet(subnet_cidr, gateway_ip):"},{"line_number":116,"context_line":"        if not gateway_ip:"},{"line_number":117,"context_line":"            return"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"70ef88de_da4065ae","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":38},"in_reply_to":"4dfdc53e_3066290a","updated":"2021-02-19 14:03:10.000000000","message":"Yes, we should move those checks to the IPAM, that\u0027s why we implemented it. Nothing related to IPs, cidrs, subnets or pools should be handled by the plugin.\n\nBut, of course, this should be done in a patch refactoring this section, not the present one.\n\nI\u0027ll commit myself to do this.","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"7afb6ad12de6789b713c4768a212104f37668f77","unresolved":true,"context_lines":[{"line_number":112,"context_line":"                                \"allocation_pools are not in the subnet\"))"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @staticmethod"},{"line_number":115,"context_line":"    def _validate_gateway_ip_in_subnet(subnet_cidr, gateway_ip):"},{"line_number":116,"context_line":"        if not gateway_ip:"},{"line_number":117,"context_line":"            return"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"dacbdd61_d51679ae","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":38},"in_reply_to":"70ef88de_da4065ae","updated":"2021-02-19 14:16:51.000000000","message":"Thanks Rodolfo","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"}],"releasenotes/notes/create-sunet-with-gateway-and-subnetpools-559335807639b5b6.yaml":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3d66a7a0f1efb107178ad2cd5eda50c102035027","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Now is possible to define a gateway IP when creating a subnet using a"},{"line_number":5,"context_line":"    subnet pool. If the gateway IP can be allocated in one of the subnet"},{"line_number":6,"context_line":"    pool available subnets, this subnet is created; a ``Conflict`` exception"},{"line_number":7,"context_line":"    is raised if not."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"f8008805_d368d3b8","line":4,"range":{"start_line":4,"start_character":4,"end_line":4,"end_character":11},"updated":"2021-02-22 09:07:04.000000000","message":"I\u0027m not english speaker but shouldn\u0027t be \"Now it is possible...\"?","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2d3a3570a8b5a560ef0208b6ab033d324eacf81d","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Now is possible to define a gateway IP when creating a subnet using a"},{"line_number":5,"context_line":"    subnet pool. If the gateway IP can be allocated in one of the subnet"},{"line_number":6,"context_line":"    pool available subnets, this subnet is created; a ``Conflict`` exception"},{"line_number":7,"context_line":"    is raised if not."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"83f07296_fbada2ff","line":4,"range":{"start_line":4,"start_character":4,"end_line":4,"end_character":11},"in_reply_to":"f8008805_d368d3b8","updated":"2021-02-25 17:12:55.000000000","message":"Yes, you are right","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3d66a7a0f1efb107178ad2cd5eda50c102035027","unresolved":true,"context_lines":[{"line_number":4,"context_line":"    Now is possible to define a gateway IP when creating a subnet using a"},{"line_number":5,"context_line":"    subnet pool. If the gateway IP can be allocated in one of the subnet"},{"line_number":6,"context_line":"    pool available subnets, this subnet is created; a ``Conflict`` exception"},{"line_number":7,"context_line":"    is raised if not."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"a83017a6_f7c3bd8f","line":7,"updated":"2021-02-22 09:07:04.000000000","message":"wouldn\u0027t be better something like \"otherwise a ``Conflict`` exteption is raised.\" ?","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2d3a3570a8b5a560ef0208b6ab033d324eacf81d","unresolved":true,"context_lines":[{"line_number":4,"context_line":"    Now is possible to define a gateway IP when creating a subnet using a"},{"line_number":5,"context_line":"    subnet pool. If the gateway IP can be allocated in one of the subnet"},{"line_number":6,"context_line":"    pool available subnets, this subnet is created; a ``Conflict`` exception"},{"line_number":7,"context_line":"    is raised if not."}],"source_content_type":"text/x-yaml","patch_set":6,"id":"5ebbc259_9b8c01a5","line":7,"in_reply_to":"a83017a6_f7c3bd8f","updated":"2021-02-25 17:12:55.000000000","message":"right","commit_id":"f61ae650e5c9095a7bb69797f4fa64a69b03fb81"}]}
