)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"98d2b0b9277be04422bc90c8c48ec5a65e56bf52","unresolved":false,"context_lines":[{"line_number":12,"context_line":"POST http://{{neutron_ip}}:9696/v2.0/subnets"},{"line_number":13,"context_line":"with this in the body:"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"  {\"subnet\": {\"allocation_pools\": []}}"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I42c1abfcc2996edaf90ad5440c438191109791a6"},{"line_number":18,"context_line":"Closes-Bug: #1616208"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa31d9ce_aa9d125b","line":15,"range":{"start_line":15,"start_character":2,"end_line":15,"end_character":38},"updated":"2017-02-17 13:28:19.000000000","message":"Will it be like this? Or will it be with \"no_allocation_pools\"?","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"52be29d7c2242d6ee018f5b89bb92c644ecfc8cb","unresolved":false,"context_lines":[{"line_number":12,"context_line":"POST http://{{neutron_ip}}:9696/v2.0/subnets"},{"line_number":13,"context_line":"with this in the body:"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"  {\"subnet\": {\"allocation_pools\": []}}"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I42c1abfcc2996edaf90ad5440c438191109791a6"},{"line_number":18,"context_line":"Closes-Bug: #1616208"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa31d9ce_4701e469","line":15,"range":{"start_line":15,"start_character":2,"end_line":15,"end_character":38},"in_reply_to":"fa31d9ce_aa9d125b","updated":"2017-02-17 17:21:12.000000000","message":"The actual attribute that hold the start and end values will still be allocation_pools. no_allocation_pools acts as a flag currently, based on whose value the allocation_pools values are decided.","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"98d2b0b9277be04422bc90c8c48ec5a65e56bf52","unresolved":false,"context_lines":[{"line_number":736,"context_line":"            network \u003d self._get_network(context,"},{"line_number":737,"context_line":"                                        subnet[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":738,"context_line":"            subnet, ipam_subnet, flag \u003d self.ipam.allocate_subnet(context,"},{"line_number":739,"context_line":"                                                            network,"},{"line_number":740,"context_line":"                                                            subnet[\u0027subnet\u0027],"},{"line_number":741,"context_line":"                                                            subnetpool_id)"},{"line_number":742,"context_line":"        result \u003d self._make_subnet_dict(subnet, context\u003dcontext)"},{"line_number":743,"context_line":"        if flag:"},{"line_number":744,"context_line":"            for pool in result[\u0027allocation_pools\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_d43e6f28","line":741,"range":{"start_line":739,"start_character":60,"end_line":741,"end_character":74},"updated":"2017-02-17 13:28:19.000000000","message":"need to be indented more to line up with \u0027context\u0027 above.","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"52be29d7c2242d6ee018f5b89bb92c644ecfc8cb","unresolved":false,"context_lines":[{"line_number":736,"context_line":"            network \u003d self._get_network(context,"},{"line_number":737,"context_line":"                                        subnet[\u0027subnet\u0027][\u0027network_id\u0027])"},{"line_number":738,"context_line":"            subnet, ipam_subnet, flag \u003d self.ipam.allocate_subnet(context,"},{"line_number":739,"context_line":"                                                            network,"},{"line_number":740,"context_line":"                                                            subnet[\u0027subnet\u0027],"},{"line_number":741,"context_line":"                                                            subnetpool_id)"},{"line_number":742,"context_line":"        result \u003d self._make_subnet_dict(subnet, context\u003dcontext)"},{"line_number":743,"context_line":"        if flag:"},{"line_number":744,"context_line":"            for pool in result[\u0027allocation_pools\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_072e0cfa","line":741,"range":{"start_line":739,"start_character":60,"end_line":741,"end_character":74},"in_reply_to":"fa31d9ce_d43e6f28","updated":"2017-02-17 17:21:12.000000000","message":"Done","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8e32414c3546de3871ef6ee3477af80d4f889cdd","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                subnetpool_id)"},{"line_number":744,"context_line":"        result \u003d self._make_subnet_dict(subnet, context\u003dcontext)"},{"line_number":745,"context_line":"        if flag:"},{"line_number":746,"context_line":"            for pool in result[\u0027allocation_pools\u0027]:"},{"line_number":747,"context_line":"                pool.update((k, \" \") for k, v in six.iteritems(pool))"},{"line_number":748,"context_line":"        return result, network, ipam_subnet"},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"    def _update_allocation_pools(self, subnet):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_4a051a12","line":747,"range":{"start_line":746,"start_character":1,"end_line":747,"end_character":69},"updated":"2017-03-03 04:22:07.000000000","message":"Since I am suggesting you need either a DB mixin for the ML2 plugin or an ML2 extension to process the new attribute for the subnets, this is not the right way to extend the subnet dictionary. You need a proper method to do that. In the case of a mixin, this is an example from the external network attribute: https://github.com/openstack/neutron/blob/master/neutron/db/external_net_db.py#L90  and https://github.com/openstack/neutron/blob/master/neutron/db/external_net_db.py#L96\n\nIf you decide to implement this as a ML2 extension, this is how you do it using DNS integration as example: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/extensions/dns_integration.py#L199","commit_id":"5df3c7b39610441cae878ab4195bfed11da15bc9"}],"neutron/db/ipam_pluggable_backend.py":[{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"98d2b0b9277be04422bc90c8c48ec5a65e56bf52","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        if subnet[\u0027cidr\u0027] is not constants.ATTR_NOT_SPECIFIED:"},{"line_number":459,"context_line":"            subnet[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(subnet,"},{"line_number":460,"context_line":"                                                        subnet[\u0027cidr\u0027])"},{"line_number":461,"context_line":"            if subnet[\u0027no_allocation_pools\u0027]:"},{"line_number":462,"context_line":"                subnet[\u0027allocation_pools\u0027] \u003d self._empty_allocation_pools()"},{"line_number":463,"context_line":"            else:"},{"line_number":464,"context_line":"                subnet[\u0027allocation_pools\u0027] \u003d self._prepare_allocation_pools("}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_748ce335","line":461,"updated":"2017-02-17 13:28:19.000000000","message":"A lot of the test failures are coming from here. You can do this more safely with:\n\n  if subnet.get(\u0027no_allocation_pools\u0027):\n\nSubnet.get() will return None if the key doesn\u0027t exist, rather than throwing a KeyError.","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"52be29d7c2242d6ee018f5b89bb92c644ecfc8cb","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        if subnet[\u0027cidr\u0027] is not constants.ATTR_NOT_SPECIFIED:"},{"line_number":459,"context_line":"            subnet[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(subnet,"},{"line_number":460,"context_line":"                                                        subnet[\u0027cidr\u0027])"},{"line_number":461,"context_line":"            if subnet[\u0027no_allocation_pools\u0027]:"},{"line_number":462,"context_line":"                subnet[\u0027allocation_pools\u0027] \u003d self._empty_allocation_pools()"},{"line_number":463,"context_line":"            else:"},{"line_number":464,"context_line":"                subnet[\u0027allocation_pools\u0027] \u003d self._prepare_allocation_pools("}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_673fc825","line":461,"in_reply_to":"fa31d9ce_748ce335","updated":"2017-02-17 17:21:12.000000000","message":"yes, that helped. thanks.","commit_id":"7bb292f78264a1bb81da2660570f27fd08b01d34"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8e32414c3546de3871ef6ee3477af80d4f889cdd","unresolved":false,"context_lines":[{"line_number":463,"context_line":"                subnet[\u0027cidr\u0027],"},{"line_number":464,"context_line":"                subnet[\u0027gateway_ip\u0027])"},{"line_number":465,"context_line":""},{"line_number":466,"context_line":"        flag \u003d subnet.get(\u0027no_allocation_pools\u0027)"},{"line_number":467,"context_line":"        ipam_driver \u003d driver.Pool.get_instance(subnetpool, context)"},{"line_number":468,"context_line":"        subnet_factory \u003d ipam_driver.get_subnet_request_factory()"},{"line_number":469,"context_line":"        subnet_request \u003d subnet_factory.get_request(context, subnet,"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_e5235fa5","line":466,"updated":"2017-03-03 04:22:07.000000000","message":"Does this mean that we waste an allocation pool?","commit_id":"5df3c7b39610441cae878ab4195bfed11da15bc9"}],"neutron/extensions/subnetnoallocation.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8e32414c3546de3871ef6ee3477af80d4f889cdd","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"EXTENDED_ATTRIBUTES_2_0 \u003d {"},{"line_number":22,"context_line":"    attributes.SUBNETS: {"},{"line_number":23,"context_line":"        \u0027no_allocation_pools\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: True,"},{"line_number":24,"context_line":"                                \u0027default\u0027: False,"},{"line_number":25,"context_line":"                                \u0027is_visible\u0027: True}"},{"line_number":26,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_8a28f287","line":23,"updated":"2017-03-03 04:22:07.000000000","message":"Since the attribute is going to be postable and putable, I think you need to remember what is its current state in the DB. Here\u0027s how this is done for the external network attribute: https://github.com/openstack/neutron/blob/master/neutron/db/models/external_net.py#L25\n\nAlso you can use the external network attribute extension definition as guide on what entries you need to define here. At a minimum, I think you also need a \u0027convert_to\u0027 entry like the one here: https://github.com/openstack/neutron/blob/master/neutron/extensions/external_net.py#L31","commit_id":"5df3c7b39610441cae878ab4195bfed11da15bc9"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8e32414c3546de3871ef6ee3477af80d4f889cdd","unresolved":false,"context_lines":[{"line_number":747,"context_line":"                                             context\u003dcontext)"},{"line_number":748,"context_line":"            self.extension_manager.process_create_network(context, net_data,"},{"line_number":749,"context_line":"                                                          result)"},{"line_number":750,"context_line":"            self._process_l3_create(context, result, net_data)"},{"line_number":751,"context_line":"            net_data[\u0027id\u0027] \u003d result[\u0027id\u0027]"},{"line_number":752,"context_line":"            self.type_manager.create_network_segments(context, net_data,"},{"line_number":753,"context_line":"                                                      tenant_id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_8a60f2a6","line":750,"updated":"2017-03-03 04:22:07.000000000","message":"This is how the external network attribute is processed by the ML2 plugin, in the case of a post. This method is defined here: https://github.com/openstack/neutron/blob/master/neutron/db/external_net_db.py#L99. Please note that this means that you will have to add a mixin the ML2 plugin inherits from.\n\nWhen I worked on the integration with Designate, I got a lot of pushback on adding a new mixin to the ML2 plugin. I used another mechanism, a ML2 plugin extension that doesn\u0027t require the ML2 to inherit from yet another mixin: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/extensions/dns_integration.py#L38. The extension is called automatically for you from line 748 above. For a network create, this is how an attribute is handled in a ML2 extension: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/extensions/dns_integration.py#L45. In this example, dns_domain attribute is added to networks\n\nEither way (mixin or ml2 extension) you need something that is going to create the row for the attribute in the DB.","commit_id":"5df3c7b39610441cae878ab4195bfed11da15bc9"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8e32414c3546de3871ef6ee3477af80d4f889cdd","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                                                                    network)"},{"line_number":815,"context_line":"            self.extension_manager.process_update_network(context, net_data,"},{"line_number":816,"context_line":"                                                          updated_network)"},{"line_number":817,"context_line":"            self._process_l3_update(context, updated_network, net_data)"},{"line_number":818,"context_line":"            self.type_manager.extend_network_dict_provider(context,"},{"line_number":819,"context_line":"                                                           updated_network)"},{"line_number":820,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba2be162_0a8c02d9","line":817,"updated":"2017-03-03 04:22:07.000000000","message":"If you follow the mixin route, this is an example of how the attribute would be updated in the DB: https://github.com/openstack/neutron/blob/master/neutron/db/external_net_db.py#L122.\n\nIf you follow the ml2 extension approach, this would be an example of how to process the attribute: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/extensions/dns_integration.py#L56. In this case, the extension is called from line 815 above","commit_id":"5df3c7b39610441cae878ab4195bfed11da15bc9"}]}
