)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"be allocated from a subnet pool. Users can request a subnet allocation by"},{"line_number":11,"context_line":"supplying subnetpool_id and optionally prefixlen or cidr. If cidr is"},{"line_number":12,"context_line":"specified, an attempt is made to allocate the given CIDR from the pool. If"},{"line_number":13,"context_line":"prefixlen is specified, and attempt is made to allocate any CIDR with the"},{"line_number":14,"context_line":"given prefix length from the pool. If neither is specified, a CIDR is chosen"},{"line_number":15,"context_line":"from the pool using the default prefix length for the pool."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":40,"id":"9a80dd14_3f87b662","line":13,"updated":"2015-03-19 16:15:19.000000000","message":"and -\u003e an","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d720e7554a0d3e67a28bfa3ce9add9ee1c9ad230","unresolved":false,"context_lines":[{"line_number":10,"context_line":"be allocated from a subnet pool. Users can request a subnet allocation by"},{"line_number":11,"context_line":"supplying subnetpool_id and optionally prefixlen or cidr. If cidr is"},{"line_number":12,"context_line":"specified, an attempt is made to allocate the given CIDR from the pool. If"},{"line_number":13,"context_line":"prefixlen is specified, and attempt is made to allocate any CIDR with the"},{"line_number":14,"context_line":"given prefix length from the pool. If neither is specified, a CIDR is chosen"},{"line_number":15,"context_line":"from the pool using the default prefix length for the pool."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":40,"id":"9a80dd14_ab2448c6","line":13,"in_reply_to":"9a80dd14_3f87b662","updated":"2015-03-19 16:41:59.000000000","message":"Done","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":10,"context_line":"be allocated from a subnet pool. Users can request a subnet allocation by"},{"line_number":11,"context_line":"supplying subnetpool_id and optionally prefixlen or cidr. If cidr is"},{"line_number":12,"context_line":"specified, an attempt is made to allocate the given CIDR from the pool. If"},{"line_number":13,"context_line":"prefixlen is specified, and attempt is made to allocate any CIDR with the"},{"line_number":14,"context_line":"given prefix length from the pool. If neither is specified, a CIDR is chosen"},{"line_number":15,"context_line":"from the pool using the default prefix length for the pool."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":45,"id":"9a80dd14_c6786a91","line":13,"updated":"2015-03-20 14:59:22.000000000","message":"still: and -\u003e an","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9138cda95f6bbbef9a12360fed7cadc282522acc","unresolved":false,"context_lines":[{"line_number":10,"context_line":"be allocated from a subnet pool. Users can request a subnet allocation by"},{"line_number":11,"context_line":"supplying subnetpool_id and optionally prefixlen or cidr. If cidr is"},{"line_number":12,"context_line":"specified, an attempt is made to allocate the given CIDR from the pool. If"},{"line_number":13,"context_line":"prefixlen is specified, and attempt is made to allocate any CIDR with the"},{"line_number":14,"context_line":"given prefix length from the pool. If neither is specified, a CIDR is chosen"},{"line_number":15,"context_line":"from the pool using the default prefix length for the pool."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":45,"id":"9a80dd14_1b91ef51","line":13,"in_reply_to":"9a80dd14_c6786a91","updated":"2015-03-20 17:46:36.000000000","message":"Really Done","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"}],"neutron/api/v2/attributes.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4687df278489e4f8e507b67ba9f3683fbfa5ef34","unresolved":false,"context_lines":[{"line_number":763,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":764,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":765,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":766,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":767,"context_line":"                       \u0027required_by_policy\u0027: False,"},{"line_number":768,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":769,"context_line":"                       \u0027is_visible\u0027: True},"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_8309c697","line":766,"updated":"2015-02-20 10:59:27.000000000","message":"It might be just me forgetting something about the API, but I believe that you need to specify default: ATTR_NOT_SPECIFIED\n\nBecause, I believe you want to make it optional right?","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ec2c8b3c0a6e1a675ed658618d166159f05f4163","unresolved":false,"context_lines":[{"line_number":763,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":764,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":765,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":766,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: False,"},{"line_number":767,"context_line":"                       \u0027required_by_policy\u0027: False,"},{"line_number":768,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":769,"context_line":"                       \u0027is_visible\u0027: True},"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_67c85075","line":766,"in_reply_to":"ba7be1f8_8309c697","updated":"2015-02-20 16:32:14.000000000","message":"Right","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        \u0027cidr\u0027: {\u0027allow_post\u0027: True,"},{"line_number":780,"context_line":"                 \u0027allow_put\u0027: False,"},{"line_number":781,"context_line":"                 \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":782,"context_line":"                 \u0027validate\u0027: {\u0027type:subnet_or_none\u0027: None},"},{"line_number":783,"context_line":"                 \u0027required_by_policy\u0027: False,"},{"line_number":784,"context_line":"                 \u0027is_visible\u0027: True},"},{"line_number":785,"context_line":"        \u0027gateway_ip\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: True,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_51e2ff2f","line":782,"updated":"2015-03-11 21:25:03.000000000","message":"Does subnet_or_none allow for ATTR_NOT_SPECIFIED.  I assume so.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        \u0027cidr\u0027: {\u0027allow_post\u0027: True,"},{"line_number":780,"context_line":"                 \u0027allow_put\u0027: False,"},{"line_number":781,"context_line":"                 \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":782,"context_line":"                 \u0027validate\u0027: {\u0027type:subnet_or_none\u0027: None},"},{"line_number":783,"context_line":"                 \u0027required_by_policy\u0027: False,"},{"line_number":784,"context_line":"                 \u0027is_visible\u0027: True},"},{"line_number":785,"context_line":"        \u0027gateway_ip\u0027: {\u0027allow_post\u0027: True, \u0027allow_put\u0027: True,"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_c1f29c9a","line":782,"in_reply_to":"9a80dd14_51e2ff2f","updated":"2015-03-11 21:53:58.000000000","message":"See comment on line 1210 in https://review.openstack.org/#/c/157597/29/neutron/db/db_base_plugin_v2.py. I\u0027ve been meaning to come back to it.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"},{"line_number":776,"context_line":"                          \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":777,"context_line":"                          \u0027is_visible\u0027: True},"},{"line_number":778,"context_line":"        \u0027prefixlen\u0027: {\u0027allow_post\u0027: True,"},{"line_number":779,"context_line":"                      \u0027allow_put\u0027: False,"},{"line_number":780,"context_line":"                      \u0027validate\u0027: {\u0027type:non_negative\u0027: None},"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_13fa1c75","line":777,"updated":"2015-03-25 12:21:41.000000000","message":"I would say let us forget about the discussion on how allocation from a pool should be expressed at the API layer. I  am not sure this is the best way. However, it is consistent with how we do ip allocation for ports. with the exception that there we use a composite attribute - fixed_ips, but the reason for that is to have multiple addresses on a port.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"528ab0fffca3e174052e5e3902e5ee4564d58118","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_320ab0d3","line":772,"updated":"2015-03-29 10:06:16.000000000","message":"this is breaking the API.\nWhy is this not an extension?","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ae174e6ee72e9ac6ed15347cceb50995d8e15d20","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_20f232d3","line":772,"in_reply_to":"da9b358b_14e3f8a4","updated":"2015-03-30 21:18:03.000000000","message":"@Carl, I agree with you. I don\u0027t think we should miss the FFE deadline (I consider the feature important though I didn\u0027t mention it). I am fine with the plan.\n\nRegarding LB frontend, though I didn\u0027t mention it, mixing two different versions of neutron is not a regular situation and it would happen during the upgrade even if it happens. I agree we should not discuss it in this context.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"c22fd2977219a231816d77283f768aad66152e9c","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_bad8bc1e","line":772,"in_reply_to":"da9b358b_2c5fdf42","updated":"2015-03-30 15:40:17.000000000","message":"IMHO we should provide a way to know the subnet pool API is available or not from the point of view of API. It is directly related to how we implement th e feature (adding new attribute to this module or defining the related attributes in an extension file). I believe we should define an extension for the subnet pool EVEN THOUGH the extension itself does nothing and all changes are done to this module.\n\nFor CLI, we have added new sub commands to support new features and such sub commands do not work with the older version of Neutron. Thus it is okay.\n\nRegarding Horizon, Horizon works based on the API version and Horizon team is trying to keep the latest Horizon with some older version of OpenStack. All behavior is based on API, and if we don\u0027t provided a convenient way to check what features are supported and at the same time Neutron team want to support support subnet pool, Horizon will need a dirty work around (to check subnet pool is available). Again, I would like to have a way to detect a way to know the subnet pool API is available.\n\nOther possible option is not to support subnet pool in Horizon until we have a new version of API.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1380b57585c87c873b0b8e8837a107c425c32c05","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_589553e2","line":772,"in_reply_to":"da9b358b_320ab0d3","updated":"2015-03-29 17:17:06.000000000","message":"What exactly is this breaking?  We discussed this at length in the spec review, it was agreed upon that subnet pools and the corresponding change to add subnetpool_id to subnet would not be done as an extension, but rather as a core change.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"807200ec0ff5c5cda4b012015d780989505a0c9b","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_ab486c5c","line":772,"in_reply_to":"da9b358b_3ab02cf4","updated":"2015-03-30 16:36:06.000000000","message":"Regarding Horizon, how can Horizon determine the subnet pool? Horizon need a clear way to check the feature availability. Horizon does not assume some specific OpenStack release of neutron. This is the reason of my question. Dirty hack may be acceptable but perhaps it is not accepted to assume some version of Neutron from my experience so far.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1a35d0316ba3e72a8843956f0e4aa3bba43d313b","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_db239804","line":772,"in_reply_to":"da9b358b_589553e2","updated":"2015-03-30 05:18:58.000000000","message":"a number of questions:\n1. how does the management interface, for example horizon, know that it should enable a user to configure a subnetpool_id?\n2. what if we have more than one neutron service running behind a LB (and each has a different version). This would work up until this change. If this request is sent to a neutron service that does not support this field then the request fails.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0678eeff3735c4bfb1d6ba0a0b0a35fef4c3e2d3","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_14e3f8a4","line":772,"in_reply_to":"da9b358b_ab486c5c","updated":"2015-03-30 18:17:18.000000000","message":"You know this is a lot like the difference between using a \"try/except NotSupported\" in python and using an \"if supported: \" construct.  There are developers on both sides of the argument there.  In my opinion, this isn\u0027t a good reason to make this functionality miss its feature freeze exception deadline.\n\n@Akihiro, while it is already possible to discover support for this feature, I see your point.  It may be more elegant in the context of Horizon to discover the presence of the API before attempting to use it and failing.  Would you be content if we followed up this patch with a simple extension definition to facilitate discovery?\n\nThis boils down to a choice between 1) discovering the new functionality by trying to list subnet pools and getting either a 404 or an empty list, and 2) creating a new extension so that we can ask if it exists before we try to use it.\n\nThe LB fronting two different versions of Neutron is just a bad situation in general.  I don\u0027t think we have any extensions or API additions which would work with this.  I don\u0027t think we should discuss this problem any more in this context.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6277467e1c081df9a99c485afd7cbd49425080fa","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_3ab02cf4","line":772,"in_reply_to":"da9b358b_db239804","updated":"2015-03-30 16:00:49.000000000","message":"CLI patch is here: https://review.openstack.org/#/c/165910/\n\nHorizon has not been enhanced yet to support subnetpools.  At the moment, you won\u0027t be able to use Horizon to manipulate subnetpools or allocate subnets from a pool. It would be nice to get that done ASAP.\n\nThis patch should be entirely backward compatible in that subnetpool_id is not a required attribute.  If you don\u0027t specify it, subnet CRUD will work as it always has.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"43b3a031acff70f34fbe71f7dd1553750870b20a","unresolved":false,"context_lines":[{"line_number":769,"context_line":"                       \u0027required_by_policy\u0027: True,"},{"line_number":770,"context_line":"                       \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":771,"context_line":"                       \u0027is_visible\u0027: True},"},{"line_number":772,"context_line":"        \u0027subnetpool_id\u0027: {\u0027allow_post\u0027: True,"},{"line_number":773,"context_line":"                          \u0027allow_put\u0027: False,"},{"line_number":774,"context_line":"                          \u0027default\u0027: ATTR_NOT_SPECIFIED,"},{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_2c5fdf42","line":772,"in_reply_to":"da9b358b_db239804","updated":"2015-03-30 13:17:55.000000000","message":"I have no idea about CLI and Horizon support. While the latter is not fundamental, maybe support in the CLI should be done.\n\nfor the second issue you are raising, I believe that would be problematic even if this was implemented as an extension. I don\u0027t think Neutron in general has the ability of being both forward and backward compatible, in which case a scenario like the one you\u0027re suggesting would be doable.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"16c498739648870e5e5c6862d02c474cb5830e70","unresolved":false,"context_lines":[{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"},{"line_number":776,"context_line":"                          \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":777,"context_line":"                          \u0027is_visible\u0027: True},"},{"line_number":778,"context_line":"        \u0027prefixlen\u0027: {\u0027allow_post\u0027: True,"},{"line_number":779,"context_line":"                      \u0027allow_put\u0027: False,"},{"line_number":780,"context_line":"                      \u0027validate\u0027: {\u0027type:non_negative\u0027: None},"},{"line_number":781,"context_line":"                      \u0027convert_to\u0027: convert_to_int,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_5bf30874","line":778,"updated":"2015-03-30 05:28:58.000000000","message":"where is this used?","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"43b3a031acff70f34fbe71f7dd1553750870b20a","unresolved":false,"context_lines":[{"line_number":775,"context_line":"                          \u0027required_by_policy\u0027: False,"},{"line_number":776,"context_line":"                          \u0027validate\u0027: {\u0027type:uuid\u0027: None},"},{"line_number":777,"context_line":"                          \u0027is_visible\u0027: True},"},{"line_number":778,"context_line":"        \u0027prefixlen\u0027: {\u0027allow_post\u0027: True,"},{"line_number":779,"context_line":"                      \u0027allow_put\u0027: False,"},{"line_number":780,"context_line":"                      \u0027validate\u0027: {\u0027type:non_negative\u0027: None},"},{"line_number":781,"context_line":"                      \u0027convert_to\u0027: convert_to_int,"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_37c5ec8d","line":778,"in_reply_to":"da9b358b_5bf30874","updated":"2015-03-30 13:17:55.000000000","message":"This is used to allocate a subnet with a given prefixlen from the pool","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"}],"neutron/common/constants.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"653327481880ee027f30b52a3c8cbdd932f00c3d","unresolved":false,"context_lines":[{"line_number":115,"context_line":"LBAAS_AGENT_SCHEDULER_EXT_ALIAS \u003d \u0027lbaas_agent_scheduler\u0027"},{"line_number":116,"context_line":"L3_DISTRIBUTED_EXT_ALIAS \u003d \u0027dvr\u0027"},{"line_number":117,"context_line":"L3_HA_MODE_EXT_ALIAS \u003d \u0027l3-ha\u0027"},{"line_number":118,"context_line":"SUBNET_ALLOCATION_EXT_ALIAS \u003d \u0027subnet_allocation\u0027"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"# Protocol names and numbers for Security Groups/Firewalls"},{"line_number":121,"context_line":"PROTO_NAME_TCP \u003d \u0027tcp\u0027"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_f0fe3b6a","line":118,"updated":"2015-03-31 14:16:04.000000000","message":"The better extension name may be \"subnet_pool\". In my understanding, the subnet pool API and the subnet allocation with a subnet pool are one feature.\nThis is not a strong opinion, but I would like to share my thought.","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"}],"neutron/common/exceptions.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"528ab0fffca3e174052e5e3902e5ee4564d58118","unresolved":false,"context_lines":[{"line_number":434,"context_line":""},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"class SubnetAllocationError(NeutronException):"},{"line_number":437,"context_line":"    message \u003d _(\"Failed to allocate subnet: %(msg)s\")"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class MinPrefixSubnetAllocationError(BadRequest):"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_f213280c","line":437,"updated":"2015-03-29 10:06:16.000000000","message":"consider changing msg to reason","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"527e4495d67649b778e68605db7a40fb8d7567f0","unresolved":false,"context_lines":[{"line_number":434,"context_line":""},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"class SubnetAllocationError(NeutronException):"},{"line_number":437,"context_line":"    message \u003d _(\"Failed to allocate subnet: %(msg)s\")"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"class MinPrefixSubnetAllocationError(BadRequest):"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_f0f665d6","line":437,"in_reply_to":"da9b358b_f213280c","updated":"2015-03-30 18:11:13.000000000","message":"Done","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"}],"neutron/common/utils.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"807200ec0ff5c5cda4b012015d780989505a0c9b","unresolved":false,"context_lines":[{"line_number":403,"context_line":"    return net.prefixlen \u003d\u003d q_const.IPv6_BITS"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"def ip_version_from_int(ip_version_int):"},{"line_number":407,"context_line":"    if ip_version_int \u003d\u003d 4:"},{"line_number":408,"context_line":"        return q_const.IPv4"},{"line_number":409,"context_line":"    if ip_version_int \u003d\u003d 6:"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_fa5be452","line":406,"updated":"2015-03-30 16:36:06.000000000","message":"(nit) I think the better method name is get_ip_version_string_from_int.\nAt a quick glance, it is not clear that \"ip_version\" is a string like IPv4 or IPv6, so it is better to have \"string\" in method name.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"528ab0fffca3e174052e5e3902e5ee4564d58118","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        return q_const.IPv4"},{"line_number":409,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":410,"context_line":"        return q_const.IPv6"},{"line_number":411,"context_line":"    raise ValueError(\u0027Illegal IP version number\u0027)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_d2f944ca","line":411,"updated":"2015-03-29 10:06:16.000000000","message":"missing translation\nThis should be (_(\u0027Illegal IP version number\u0027))","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"6796b554b6f1756fcd8ccf0676f03b6235932c38","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        return q_const.IPv4"},{"line_number":409,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":410,"context_line":"        return q_const.IPv6"},{"line_number":411,"context_line":"    raise ValueError(\u0027Illegal IP version number\u0027)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_75092795","line":411,"in_reply_to":"da9b358b_d2f944ca","updated":"2015-03-30 16:08:25.000000000","message":"A user will never see this message.  Why are we wasting translators time with this?","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"527e4495d67649b778e68605db7a40fb8d7567f0","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        return q_const.IPv4"},{"line_number":409,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":410,"context_line":"        return q_const.IPv6"},{"line_number":411,"context_line":"    raise ValueError(\u0027Illegal IP version number\u0027)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_105f8942","line":411,"in_reply_to":"da9b358b_d2f944ca","updated":"2015-03-30 18:11:13.000000000","message":"Done","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ab92206e46915c0f48425c07376f915398d93ea7","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        return q_const.IPv4"},{"line_number":418,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":419,"context_line":"        return q_const.IPv6"},{"line_number":420,"context_line":"    raise ValueError(_(\u0027Illegal IP version number\u0027))"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_6c05be78","line":420,"updated":"2015-03-31 09:53:54.000000000","message":"I think this statement mainly depends on what country you are in. ;)","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"653327481880ee027f30b52a3c8cbdd932f00c3d","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        return q_const.IPv4"},{"line_number":418,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":419,"context_line":"        return q_const.IPv6"},{"line_number":420,"context_line":"    raise ValueError(_(\u0027Illegal IP version number\u0027))"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_501607f2","line":420,"in_reply_to":"da9b358b_0d198b88","updated":"2015-03-31 14:16:04.000000000","message":"Invalid? IPv5 is not allowed in my country :-)","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"587256e70546455526f8a1a5f17aa2962d2159c9","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        return q_const.IPv4"},{"line_number":418,"context_line":"    if ip_version_int \u003d\u003d 6:"},{"line_number":419,"context_line":"        return q_const.IPv6"},{"line_number":420,"context_line":"    raise ValueError(_(\u0027Illegal IP version number\u0027))"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_0d198b88","line":420,"in_reply_to":"da9b358b_6c05be78","updated":"2015-03-31 12:06:14.000000000","message":"When I reviewed this patch I had a vision of agents storming through my door and arresting me for using IPv7 ;)","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":810,"context_line":"               \u0027network_id\u0027: subnet[\u0027network_id\u0027],"},{"line_number":811,"context_line":"               \u0027ip_version\u0027: subnet[\u0027ip_version\u0027],"},{"line_number":812,"context_line":"               \u0027cidr\u0027: subnet[\u0027cidr\u0027],"},{"line_number":813,"context_line":"               \u0027subnetpool_id\u0027: subnet.get(\u0027subnetpool_id\u0027, \u0027\u0027),"},{"line_number":814,"context_line":"               \u0027allocation_pools\u0027: [{\u0027start\u0027: pool[\u0027first_ip\u0027],"},{"line_number":815,"context_line":"                                     \u0027end\u0027: pool[\u0027last_ip\u0027]}"},{"line_number":816,"context_line":"                                    for pool in subnet[\u0027allocation_pools\u0027]],"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_f1c3f387","line":813,"updated":"2015-03-11 21:25:03.000000000","message":"Should the default be None instead of empty string?","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"                    nexthop\u003drt[\u0027nexthop\u0027])"},{"line_number":1081,"context_line":"                context.session.add(route)"},{"line_number":1082,"context_line":""},{"line_number":1083,"context_line":"        if allocation_pools is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1084,"context_line":"            for pool in allocation_pools:"},{"line_number":1085,"context_line":"                ip_pool \u003d models_v2.IPAllocationPool(subnet\u003dsubnet,"},{"line_number":1086,"context_line":"                                                     first_ip\u003dpool[\u0027start\u0027],"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_0ce78e13","line":1083,"updated":"2015-03-11 21:25:03.000000000","message":"I don\u0027t think we can just not write anything for this field.  We have to have allocation_pools.  Otherwise, IPAM will having nothing from which to allocate individual IPs in the subnet.\n\nAre you counting on the user updating the subnet with a subnet update to make it useable?","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"                    nexthop\u003drt[\u0027nexthop\u0027])"},{"line_number":1081,"context_line":"                context.session.add(route)"},{"line_number":1082,"context_line":""},{"line_number":1083,"context_line":"        if allocation_pools is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1084,"context_line":"            for pool in allocation_pools:"},{"line_number":1085,"context_line":"                ip_pool \u003d models_v2.IPAllocationPool(subnet\u003dsubnet,"},{"line_number":1086,"context_line":"                                                     first_ip\u003dpool[\u0027start\u0027],"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_41086cd9","line":1083,"in_reply_to":"9a80dd14_0ce78e13","updated":"2015-03-11 21:53:58.000000000","message":"This method should probably enforce this then. The assumption is that the caller has already populated the allocation_pools","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"                    nexthop\u003drt[\u0027nexthop\u0027])"},{"line_number":1081,"context_line":"                context.session.add(route)"},{"line_number":1082,"context_line":""},{"line_number":1083,"context_line":"        if allocation_pools is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1084,"context_line":"            for pool in allocation_pools:"},{"line_number":1085,"context_line":"                ip_pool \u003d models_v2.IPAllocationPool(subnet\u003dsubnet,"},{"line_number":1086,"context_line":"                                                     first_ip\u003dpool[\u0027start\u0027],"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_9ab3ece8","line":1083,"in_reply_to":"9a80dd14_41086cd9","updated":"2015-03-16 21:53:59.000000000","message":"I thought that with \"not specified\" there was a default configuration for the allocation pools.  Something like \"all available addresses except for the gateway.\n\n\"not specified\" is different than empty.  If they\u0027re allowed to specify an empty list of allocation pools then they should get an empty list.\n\nAlso, we\u0027ve dropped the use case to specify allocation pools with an \"any subnet\" request.  Right?","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6a949578d80e4575ed1487df37292bf1091067bf","unresolved":false,"context_lines":[{"line_number":1080,"context_line":"                    nexthop\u003drt[\u0027nexthop\u0027])"},{"line_number":1081,"context_line":"                context.session.add(route)"},{"line_number":1082,"context_line":""},{"line_number":1083,"context_line":"        if allocation_pools is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1084,"context_line":"            for pool in allocation_pools:"},{"line_number":1085,"context_line":"                ip_pool \u003d models_v2.IPAllocationPool(subnet\u003dsubnet,"},{"line_number":1086,"context_line":"                                                     first_ip\u003dpool[\u0027start\u0027],"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_3c9afb6e","line":1083,"in_reply_to":"9a80dd14_9ab3ece8","updated":"2015-03-16 22:57:12.000000000","message":"Look at the latest patch sets, they handle the allocation_pools properly and remove the wildcard allocation support on an \"any\" request. Not sure if it\u0027s much of an issue, but technically you can send allocation_pools on an \"any\" request, but unless you get lucky the allocation_pools won\u0027t be in the subnet you were allocated and the subnet-create will fail.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"            return True"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        ip \u003d netaddr.IPNetwork(cidr).network"},{"line_number":1101,"context_line":"        return ip.is_hostmask()"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    def _make_subnet_request(self, subnet, subnetpool):"},{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_a7085dda","line":1101,"updated":"2015-03-11 21:25:03.000000000","message":"Is this going after the wildcard use case?\n\nis_hostmask returns True if the binary representation of the address is all 0s followed by all 1s (e.g. 255.255.255.255, 0.0.255.255, 0.0.0.1, or 0.0.0.0).  I don\u0027t think that is what we want.\n\nI think we want is this:\n\n ip \u003d netaddr.IPNetwork(cidr).network\n return 0 \u003d\u003d int(ip)\n\nHowever, I think we\u0027ve all agreed that we\u0027re dropping the wildcard use case.  So, this point is probably moot.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"            return True"},{"line_number":1099,"context_line":""},{"line_number":1100,"context_line":"        ip \u003d netaddr.IPNetwork(cidr).network"},{"line_number":1101,"context_line":"        return ip.is_hostmask()"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    def _make_subnet_request(self, subnet, subnetpool):"},{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_9de006ce","line":1101,"in_reply_to":"9a80dd14_a7085dda","updated":"2015-03-11 21:53:58.000000000","message":"No, this doesn\u0027t do what I thought it does. Definitely moot though, this will disappear in the next patch set.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":12912,"name":"John Belamaric","email":"jbelamaric@infoblox.com","username":"johnbelamaric"},"change_message_id":"bcd761bd773d69d27dbd4063c51565aff809f8ae","unresolved":false,"context_lines":[{"line_number":1100,"context_line":"        ip \u003d netaddr.IPNetwork(cidr).network"},{"line_number":1101,"context_line":"        return ip.is_hostmask()"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    def _make_subnet_request(self, subnet, subnetpool):"},{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_5da5ae45","line":1103,"updated":"2015-03-11 21:37:16.000000000","message":"Shouldn\u0027t this use the factory method defined in [1]? This enables driver-specific request types based on the address specification string (aka cidr). That is, cidr need not be only empty or a real cidr - those map to the pre-defined request types, but others are possible.\n\n[1] https://review.openstack.org/#/c/153236/20/neutron/ipam/__init__.py","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1100,"context_line":"        ip \u003d netaddr.IPNetwork(cidr).network"},{"line_number":1101,"context_line":"        return ip.is_hostmask()"},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"    def _make_subnet_request(self, subnet, subnetpool):"},{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_81b7c4f4","line":1103,"in_reply_to":"9a80dd14_5da5ae45","updated":"2015-03-11 21:53:58.000000000","message":"Probably. I noticed this as well although I\u0027m not sure how to use it right now given the dependent chain of reviews as they exist right now. I don\u0027t want to depend on that review.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1107,"context_line":"            if cidr is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1108,"context_line":"                subnet[\u0027prefixlen\u0027] \u003d netaddr.IPNetwork(cidr).prefixlen"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_878fd922","line":1107,"updated":"2015-03-11 21:25:03.000000000","message":"Is there any consistency check between cidr and prefixlen?  I think it should be prohibited to specify both.  I didn\u0027t see any restriction on what combination of arguments can be specified.  But, that may be just because this is a WIP.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6a949578d80e4575ed1487df37292bf1091067bf","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1107,"context_line":"            if cidr is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1108,"context_line":"                subnet[\u0027prefixlen\u0027] \u003d netaddr.IPNetwork(cidr).prefixlen"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_dc1d5f12","line":1107,"in_reply_to":"9a80dd14_7ae558db","updated":"2015-03-16 22:57:12.000000000","message":"Done","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1107,"context_line":"            if cidr is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1108,"context_line":"                subnet[\u0027prefixlen\u0027] \u003d netaddr.IPNetwork(cidr).prefixlen"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_7ae558db","line":1107,"in_reply_to":"9a80dd14_7d60b235","updated":"2015-03-16 21:53:59.000000000","message":"We shouldn\u0027t let this merge without make them mutually exclusive.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":""},{"line_number":1106,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1107,"context_line":"            if cidr is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1108,"context_line":"                subnet[\u0027prefixlen\u0027] \u003d netaddr.IPNetwork(cidr).prefixlen"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 4:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_7d60b235","line":1107,"in_reply_to":"9a80dd14_878fd922","updated":"2015-03-11 21:53:58.000000000","message":"I have not gotten around to this yet, but I agree that you supply either cidr or prefixlen, but not both. The way this works right now is that if cidr is specified, prefixlen is simply ignored.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1107,"context_line":"            if cidr is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1108,"context_line":"                subnet[\u0027prefixlen\u0027] \u003d netaddr.IPNetwork(cidr).prefixlen"},{"line_number":1109,"context_line":""},{"line_number":1110,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 4:"},{"line_number":1111,"context_line":"                version \u003d constants.IPv4"},{"line_number":1112,"context_line":"            else:"},{"line_number":1113,"context_line":"                version \u003d constants.IPv6"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_47c88174","line":1110,"updated":"2015-03-11 21:25:03.000000000","message":"I wonder if we should create a conversion utility for this.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1112,"context_line":"            else:"},{"line_number":1113,"context_line":"                version \u003d constants.IPv6"},{"line_number":1114,"context_line":"            return ipam.AnySubnetRequest(version, subnet[\u0027prefixlen\u0027])"},{"line_number":1115,"context_line":"        else:"},{"line_number":1116,"context_line":"            return ipam.SpecificSubnetRequest(cidr)"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"    def _update_allocation_subnet_id(self, context, allocation_id, subnet_id):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_4c4ee6c2","line":1115,"updated":"2015-03-11 21:25:03.000000000","message":"nit:  I like to stick the trivial case first, return quickly and put the more complicated case after and indented less:  For me, it reads better.\n\n  if not self._is_any_subnet_pool_request(cidr):\n      return ipam.SpecificSubnetRequest(cidr)\n\n  if cidr is not attributes...","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1170,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1173,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1174,"context_line":"        else:"},{"line_number":1175,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1176,"context_line":"                                            s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_8ca1beab","line":1173,"updated":"2015-03-11 21:25:03.000000000","message":"I think we need to do this for _create_subnet_from_pool too.  Am I missing something?","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6a949578d80e4575ed1487df37292bf1091067bf","unresolved":false,"context_lines":[{"line_number":1170,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1173,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1174,"context_line":"        else:"},{"line_number":1175,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1176,"context_line":"                                            s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_fc76a33e","line":1173,"in_reply_to":"9a80dd14_1ad61cf2","updated":"2015-03-16 22:57:12.000000000","message":"Done, see latest patch sets","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1170,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1173,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1174,"context_line":"        else:"},{"line_number":1175,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1176,"context_line":"                                            s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_fddae2e7","line":1173,"in_reply_to":"9a80dd14_8ca1beab","updated":"2015-03-11 21:53:58.000000000","message":"Nope, you\u0027re not missing anything. Just a work-in-progress. I\u0027ve been holding off on tackling this until we have some clarity on wildcard allocation_pools.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":1170,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1173,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1174,"context_line":"        else:"},{"line_number":1175,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1176,"context_line":"                                            s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_1ad61cf2","line":1173,"in_reply_to":"9a80dd14_fddae2e7","updated":"2015-03-16 21:53:59.000000000","message":"See above.  No wildcard allocation pools for now.  So, they shouldn\u0027t be allowed to specific allocation pools with an \"any subnet\" request.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1209,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1210,"context_line":"        # TODO(tidwellr) when cidr is not specified it\u0027s None, not sure why"},{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_4c3426de","line":1212,"updated":"2015-03-11 21:25:03.000000000","message":"What else would it be at this point?  Is there some sort of normalization you get here?\n\nNote this little oddity:\n\n  \u003e\u003e\u003e import netaddr\n  \u003e\u003e\u003e str(netaddr.IPNetwork(\u002710.0.0.1\u0027))\n  \u002710.0.0.1/32\u0027\n\nI don\u0027t think we want to allow a naked IP to be converted into a /32 (or /128) in this case.  However, I don\u0027t quite think it is appropriate to prevent /32 or /128 if explicitly requested at this point.  We should let max_prefixlen do that.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1209,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1210,"context_line":"        # TODO(tidwellr) when cidr is not specified it\u0027s None, not sure why"},{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_9d3486fc","line":1212,"in_reply_to":"9a80dd14_4c3426de","updated":"2015-03-11 21:53:58.000000000","message":"This little snippet was lifted from the base patch set. I think the intent is to clean up a CIDR that looks like \u002710.10.1.2/24\u0027. The netaddr API\u0027s will return \u002710.10.1.2/24\u0027 as the CIDR, so by joining the network IP and the prefixlen it gets normalized.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_d1aeef97","line":1214,"updated":"2015-03-11 21:25:03.000000000","message":"I think str(net) works.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"fccfc5f76af166523e7dd61c3f243c5cf8de710e","unresolved":false,"context_lines":[{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_755a862b","line":1214,"in_reply_to":"9a80dd14_1d2096af","updated":"2015-03-11 23:30:41.000000000","message":"Actually, here\u0027s why str(net) doesn\u0027t work.\n\n\u003e\u003e\u003e import netaddr\n\u003e\u003e\u003e net \u003d netaddr.IPNetwork(\u002710.10.10.2/24\u0027)\n\u003e\u003e\u003e print str(net)\n10.10.10.2/24\n\nI think the original intent here is to mask off the host bits of the CIDR so it stores in the DB properly and doesn\u0027t look silly when displayed. From a functional perspective I don\u0027t think it matters, but this normalization should help with display. There\u0027s  a number of ways to normalize the CIDR, this is what was here when I found it.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_3a5e807a","line":1214,"in_reply_to":"9a80dd14_755a862b","updated":"2015-03-16 21:53:59.000000000","message":"Ok, I see.  Thanks for pointing that out.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1211,"context_line":"        if s[\u0027cidr\u0027] and s[\u0027cidr\u0027] is not attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1212,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1213,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1214,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_1d2096af","line":1214,"in_reply_to":"9a80dd14_d1aeef97","updated":"2015-03-11 21:53:58.000000000","message":"Yes it does, copy/paste artifacts from existing code.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            return self._create_subnet_from_implicit_pool(context,"},{"line_number":1219,"context_line":"                                                          subnet)"},{"line_number":1220,"context_line":"        else:"},{"line_number":1221,"context_line":"            return self._create_subnet_from_pool(context, subnet)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_91b9d7cd","line":1218,"updated":"2015-03-11 21:25:03.000000000","message":"Maybe put a comment here that this supports backwards (pre-subnet pool) compatibility.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1215,"context_line":""},{"line_number":1216,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            return self._create_subnet_from_implicit_pool(context,"},{"line_number":1219,"context_line":"                                                          subnet)"},{"line_number":1220,"context_line":"        else:"},{"line_number":1221,"context_line":"            return self._create_subnet_from_pool(context, subnet)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_1d07b61e","line":1218,"in_reply_to":"9a80dd14_91b9d7cd","updated":"2015-03-11 21:53:58.000000000","message":"Done","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            return self._create_subnet_from_implicit_pool(context,"},{"line_number":1219,"context_line":"                                                          subnet)"},{"line_number":1220,"context_line":"        else:"},{"line_number":1221,"context_line":"            return self._create_subnet_from_pool(context, subnet)"},{"line_number":1222,"context_line":""},{"line_number":1223,"context_line":"    def _update_subnet_dns_nameservers(self, context, id, s):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_11c5e73c","line":1220,"updated":"2015-03-11 21:25:03.000000000","message":"Nit:  no need for else.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            return self._create_subnet_from_implicit_pool(context,"},{"line_number":1219,"context_line":"                                                          subnet)"},{"line_number":1220,"context_line":"        else:"},{"line_number":1221,"context_line":"            return self._create_subnet_from_pool(context, subnet)"},{"line_number":1222,"context_line":""},{"line_number":1223,"context_line":"    def _update_subnet_dns_nameservers(self, context, id, s):"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_fd0bc228","line":1220,"in_reply_to":"9a80dd14_11c5e73c","updated":"2015-03-11 21:53:58.000000000","message":"Done","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"5e329d7dc2bac3399bd77d3a5877394461cd1961","unresolved":false,"context_lines":[{"line_number":1099,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1102,"context_line":"            # TODO(tidwellr) need to assert prefixlen is specified"},{"line_number":1103,"context_line":"            return ipam.AnySubnetRequest("},{"line_number":1104,"context_line":"                          utils.ip_version_from_int(subnetpool[\u0027ip_version\u0027]),"},{"line_number":1105,"context_line":"                          subnet[\u0027prefixlen\u0027])"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_cbd9a558","line":1102,"updated":"2015-03-12 20:07:29.000000000","message":"It seems either prerfixlen or cidr can be used.\nIf neither was specified, can we have subnetpool to use default_prefixlen?","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"865b525d6429777a4a34e447dc3f360ec06c8fa7","unresolved":false,"context_lines":[{"line_number":1099,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1102,"context_line":"            # TODO(tidwellr) need to assert prefixlen is specified"},{"line_number":1103,"context_line":"            return ipam.AnySubnetRequest("},{"line_number":1104,"context_line":"                          utils.ip_version_from_int(subnetpool[\u0027ip_version\u0027]),"},{"line_number":1105,"context_line":"                          subnet[\u0027prefixlen\u0027])"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_f39700ea","line":1102,"in_reply_to":"9a80dd14_cbd9a558","updated":"2015-03-13 22:37:55.000000000","message":"Good catch. As written this will force you to supply either prefixlen or cidr. You should be able to get away without either and have it default. I will make that change.","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":810,"context_line":"               \u0027network_id\u0027: subnet[\u0027network_id\u0027],"},{"line_number":811,"context_line":"               \u0027ip_version\u0027: subnet[\u0027ip_version\u0027],"},{"line_number":812,"context_line":"               \u0027cidr\u0027: subnet[\u0027cidr\u0027],"},{"line_number":813,"context_line":"               \u0027subnetpool_id\u0027: subnet.get(\u0027subnetpool_id\u0027, \u0027\u0027),"},{"line_number":814,"context_line":"               \u0027allocation_pools\u0027: [{\u0027start\u0027: pool[\u0027first_ip\u0027],"},{"line_number":815,"context_line":"                                     \u0027end\u0027: pool[\u0027last_ip\u0027]}"},{"line_number":816,"context_line":"                                    for pool in subnet[\u0027allocation_pools\u0027]],"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_1a01bc06","line":813,"updated":"2015-03-16 23:01:34.000000000","message":"Forgive me if this has been asked already. Why are you preferring an empty string to None?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"acea3b11b6e4c1c16f3180e50da9a82369e4d884","unresolved":false,"context_lines":[{"line_number":810,"context_line":"               \u0027network_id\u0027: subnet[\u0027network_id\u0027],"},{"line_number":811,"context_line":"               \u0027ip_version\u0027: subnet[\u0027ip_version\u0027],"},{"line_number":812,"context_line":"               \u0027cidr\u0027: subnet[\u0027cidr\u0027],"},{"line_number":813,"context_line":"               \u0027subnetpool_id\u0027: subnet.get(\u0027subnetpool_id\u0027, \u0027\u0027),"},{"line_number":814,"context_line":"               \u0027allocation_pools\u0027: [{\u0027start\u0027: pool[\u0027first_ip\u0027],"},{"line_number":815,"context_line":"                                     \u0027end\u0027: pool[\u0027last_ip\u0027]}"},{"line_number":816,"context_line":"                                    for pool in subnet[\u0027allocation_pools\u0027]],"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_2249f660","line":813,"in_reply_to":"9a80dd14_1a01bc06","updated":"2015-03-17 00:33:58.000000000","message":"This is an artifact, good catch. Carl also pointed this out, I just haven\u0027t fixed it yet.  I needed to be nagged about this.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":844,"context_line":"               \u0027prefixes\u0027: [prefix[\u0027cidr\u0027]"},{"line_number":845,"context_line":"                            for prefix in subnetpool[\u0027prefixes\u0027]],"},{"line_number":846,"context_line":"               \u0027allocations\u0027: [alloc[\u0027cidr\u0027]"},{"line_number":847,"context_line":"                               for alloc in subnetpool[\u0027allocations\u0027]],"},{"line_number":848,"context_line":"               \u0027ip_version\u0027: subnetpool[\u0027ip_version\u0027]}"},{"line_number":849,"context_line":"        return self._fields(res, fields)"},{"line_number":850,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_955adf28","line":847,"updated":"2015-03-16 23:01:34.000000000","message":"are you sure this is practical?\nAPI users might find this annoying once you have thousands of allocations on subnetpool.\n\nthe same info can be retrieved with /subnets?allocation_pool_id\u003d\u003cpool_id\u003e - is that correct?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":12912,"name":"John Belamaric","email":"jbelamaric@infoblox.com","username":"johnbelamaric"},"change_message_id":"ed65ef1ac2e539a6c78cea4bd2d1bcea2d5631a3","unresolved":false,"context_lines":[{"line_number":844,"context_line":"               \u0027prefixes\u0027: [prefix[\u0027cidr\u0027]"},{"line_number":845,"context_line":"                            for prefix in subnetpool[\u0027prefixes\u0027]],"},{"line_number":846,"context_line":"               \u0027allocations\u0027: [alloc[\u0027cidr\u0027]"},{"line_number":847,"context_line":"                               for alloc in subnetpool[\u0027allocations\u0027]],"},{"line_number":848,"context_line":"               \u0027ip_version\u0027: subnetpool[\u0027ip_version\u0027]}"},{"line_number":849,"context_line":"        return self._fields(res, fields)"},{"line_number":850,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_dcad5f34","line":847,"in_reply_to":"9a80dd14_955adf28","updated":"2015-03-16 23:15:41.000000000","message":"+1 seems excessive","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"acea3b11b6e4c1c16f3180e50da9a82369e4d884","unresolved":false,"context_lines":[{"line_number":844,"context_line":"               \u0027prefixes\u0027: [prefix[\u0027cidr\u0027]"},{"line_number":845,"context_line":"                            for prefix in subnetpool[\u0027prefixes\u0027]],"},{"line_number":846,"context_line":"               \u0027allocations\u0027: [alloc[\u0027cidr\u0027]"},{"line_number":847,"context_line":"                               for alloc in subnetpool[\u0027allocations\u0027]],"},{"line_number":848,"context_line":"               \u0027ip_version\u0027: subnetpool[\u0027ip_version\u0027]}"},{"line_number":849,"context_line":"        return self._fields(res, fields)"},{"line_number":850,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_624bee5f","line":847,"in_reply_to":"9a80dd14_955adf28","updated":"2015-03-17 00:33:58.000000000","message":"Actually, this gets filtered out at the API level and is not exposed to API users. See api/v2/attributes.py.  This is populated only for internal server-side purposes.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":844,"context_line":"               \u0027prefixes\u0027: [prefix[\u0027cidr\u0027]"},{"line_number":845,"context_line":"                            for prefix in subnetpool[\u0027prefixes\u0027]],"},{"line_number":846,"context_line":"               \u0027allocations\u0027: [alloc[\u0027cidr\u0027]"},{"line_number":847,"context_line":"                               for alloc in subnetpool[\u0027allocations\u0027]],"},{"line_number":848,"context_line":"               \u0027ip_version\u0027: subnetpool[\u0027ip_version\u0027]}"},{"line_number":849,"context_line":"        return self._fields(res, fields)"},{"line_number":850,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_ffc85577","line":847,"in_reply_to":"9a80dd14_dcad5f34","updated":"2015-03-16 23:34:07.000000000","message":"Yes, this could get ugly.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"        return self._make_subnet_dict(subnet)"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def _create_subnet_from_implicit_pool(self, context, subnet):"},{"line_number":1172,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1173,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1174,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_9571ffaa","line":1171,"updated":"2015-03-16 23:01:34.000000000","message":"this \"implicit\u0027 pool would be the \u0027null\u0027 pool I was referring to in the review of the patch for subnet pools CRUD","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"        return self._make_subnet_dict(subnet)"},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def _create_subnet_from_implicit_pool(self, context, subnet):"},{"line_number":1172,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1173,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1174,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_7f8b851e","line":1171,"in_reply_to":"9a80dd14_9571ffaa","updated":"2015-03-16 23:34:07.000000000","message":"Correct \"implicit pool\" \u003d\u003d \"null pool\"","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        if has_cidr:"},{"line_number":1227,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1228,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1229,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1230,"context_line":""},{"line_number":1231,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1232,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_75248b60","line":1229,"updated":"2015-03-16 23:01:34.000000000","message":"I was under the impression that API-level checks already ensured this...","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        if has_cidr:"},{"line_number":1227,"context_line":"            # turn the CIDR into a proper subnet"},{"line_number":1228,"context_line":"            net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1229,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1230,"context_line":""},{"line_number":1231,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1232,"context_line":"        if subnetpool_id is attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_9fe599de","line":1229,"in_reply_to":"9a80dd14_75248b60","updated":"2015-03-16 23:34:07.000000000","message":"Nope, in fact the API-level checks allow for a CIDR of \u002710.10.10.2/24\u0027 to be passed in.  When you run that through netaddr.IPNetwork constructor, it sees it valid CIDR. See comments in PS29 on this point. We need to normalize it CIDR for storage.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1060,"context_line":"                    ip_address\u003dgateway_ip)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    def _save_subnet(self, context, subnet_args,"},{"line_number":1063,"context_line":"                     dns_nameservers\u003dattributes.ATTR_NOT_SPECIFIED,"},{"line_number":1064,"context_line":"                     host_routes\u003dattributes.ATTR_NOT_SPECIFIED,"},{"line_number":1065,"context_line":"                     allocation_pools\u003dattributes.ATTR_NOT_SPECIFIED):"},{"line_number":1066,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_a0b4e7d4","line":1063,"updated":"2015-03-17 13:57:04.000000000","message":"Why do these have defaults?  Neither caller uses them.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1145,"context_line":"                    \u0027enable_dhcp\u0027: s[\u0027enable_dhcp\u0027],"},{"line_number":1146,"context_line":"                    \u0027gateway_ip\u0027: s[\u0027gateway_ip\u0027],"},{"line_number":1147,"context_line":"                    \u0027shared\u0027: network.shared}"},{"line_number":1148,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 6 and s[\u0027enable_dhcp\u0027]:"},{"line_number":1149,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_ra_mode\u0027]):"},{"line_number":1150,"context_line":"                    args[\u0027ipv6_ra_mode\u0027] \u003d s[\u0027ipv6_ra_mode\u0027]"},{"line_number":1151,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_address_mode\u0027]):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_0575c5cb","line":1148,"updated":"2015-03-17 13:57:04.000000000","message":"Some of this logic could be deduplicated.  I wouldn\u0027t mind if you started a follow-on patch to do it to avoid extra noise on this patch.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1145,"context_line":"                    \u0027enable_dhcp\u0027: s[\u0027enable_dhcp\u0027],"},{"line_number":1146,"context_line":"                    \u0027gateway_ip\u0027: s[\u0027gateway_ip\u0027],"},{"line_number":1147,"context_line":"                    \u0027shared\u0027: network.shared}"},{"line_number":1148,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 6 and s[\u0027enable_dhcp\u0027]:"},{"line_number":1149,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_ra_mode\u0027]):"},{"line_number":1150,"context_line":"                    args[\u0027ipv6_ra_mode\u0027] \u003d s[\u0027ipv6_ra_mode\u0027]"},{"line_number":1151,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_address_mode\u0027]):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_49d5fde3","line":1148,"in_reply_to":"9a80dd14_0575c5cb","updated":"2015-03-17 22:30:18.000000000","message":"Pavel has some code in https://review.openstack.org/#/c/153236/ that does just that.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_address_mode\u0027]):"},{"line_number":1152,"context_line":"                    args[\u0027ipv6_address_mode\u0027] \u003d s[\u0027ipv6_address_mode\u0027]"},{"line_number":1153,"context_line":""},{"line_number":1154,"context_line":"            # TODO(tidwellr) exception if allocation_pools on any request?"},{"line_number":1155,"context_line":"            if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1156,"context_line":"                s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet("},{"line_number":1157,"context_line":"                                                                context, args)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_a534f9fb","line":1154,"updated":"2015-03-17 13:57:04.000000000","message":"I\u0027d say yes for now.  The only way to specify them is to use the wildcard syntax as far as I can tell.  And that has been a point of contention with reviewers jumping in late.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_address_mode\u0027]):"},{"line_number":1152,"context_line":"                    args[\u0027ipv6_address_mode\u0027] \u003d s[\u0027ipv6_address_mode\u0027]"},{"line_number":1153,"context_line":""},{"line_number":1154,"context_line":"            # TODO(tidwellr) exception if allocation_pools on any request?"},{"line_number":1155,"context_line":"            if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1156,"context_line":"                s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet("},{"line_number":1157,"context_line":"                                                                context, args)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_4966ddbc","line":1154,"in_reply_to":"9a80dd14_a534f9fb","updated":"2015-03-17 22:30:18.000000000","message":"Done","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"            # TODO(tidwellr) exception if allocation_pools on any request?"},{"line_number":1155,"context_line":"            if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1156,"context_line":"                s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet("},{"line_number":1157,"context_line":"                                                                context, args)"},{"line_number":1158,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1159,"context_line":"                                            str(detail.subnet.cidr))"},{"line_number":1160,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_2024770d","line":1157,"updated":"2015-03-17 13:57:04.000000000","message":"Nit: most of the time, this line would be indented only 20 spaces:  four more than the line above it.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"            # TODO(tidwellr) exception if allocation_pools on any request?"},{"line_number":1155,"context_line":"            if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1156,"context_line":"                s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet("},{"line_number":1157,"context_line":"                                                                context, args)"},{"line_number":1158,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1159,"context_line":"                                            str(detail.subnet.cidr))"},{"line_number":1160,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_690481c6","line":1157,"in_reply_to":"9a80dd14_2024770d","updated":"2015-03-17 22:30:18.000000000","message":"Done","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def _create_subnet_from_implicit_pool(self, context, subnet):"},{"line_number":1172,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1173,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1174,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1175,"context_line":"        if s[\u0027gateway_ip\u0027] is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1176,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_20cc778a","line":1173,"updated":"2015-03-17 13:57:04.000000000","message":"I\u0027m curious why you moved this up here from L1079 in the old code.  It seems to just decrease the SNR of the patch.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"    def _create_subnet_from_implicit_pool(self, context, subnet):"},{"line_number":1172,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1173,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1174,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1175,"context_line":"        if s[\u0027gateway_ip\u0027] is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1176,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_69ed618e","line":1173,"in_reply_to":"9a80dd14_20cc778a","updated":"2015-03-17 22:30:18.000000000","message":"I was planning on needing tenant_id for some checks before opening the DB session, but that never materialized so I guess it just it just stayed.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1179,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context,"},{"line_number":1180,"context_line":"                                                                    s)"},{"line_number":1181,"context_line":"        else:"},{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_e0f17f02","line":1179,"updated":"2015-03-17 13:57:04.000000000","message":"Nit:  line wrapping changed here for no reason.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b27496dbc69dddd0f853094a2be2a4aee4162c82","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1179,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context,"},{"line_number":1180,"context_line":"                                                                    s)"},{"line_number":1181,"context_line":"        else:"},{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_0f0f403a","line":1179,"in_reply_to":"9a80dd14_69d2c135","updated":"2015-03-19 05:23:41.000000000","message":"The old version is exactly the same with the same level of indentation and it doesn\u0027t wrap.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(netaddr.IPAddress(net.first + 1))"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1179,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context,"},{"line_number":1180,"context_line":"                                                                    s)"},{"line_number":1181,"context_line":"        else:"},{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_69d2c135","line":1179,"in_reply_to":"9a80dd14_e0f17f02","updated":"2015-03-17 22:30:18.000000000","message":"Line goes to 80 char. if not wrapped","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b27496dbc69dddd0f853094a2be2a4aee4162c82","unresolved":false,"context_lines":[{"line_number":1179,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context,"},{"line_number":1180,"context_line":"                                                                    s)"},{"line_number":1181,"context_line":"        else:"},{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1183,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_2a0b1225","line":1182,"updated":"2015-03-19 05:23:41.000000000","message":"ditto","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1183,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"},{"line_number":1186,"context_line":"            self._validate_gw_out_of_pools(s[\u0027gateway_ip\u0027],"},{"line_number":1187,"context_line":"                                           s[\u0027allocation_pools\u0027])"},{"line_number":1188,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_8067e3b6","line":1185,"updated":"2015-03-17 13:57:04.000000000","message":"I\u0027m curious why this indentation level changed here.  Was it incorrect before?","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"8f8e6b41872fc378dd4970fe78d4151489d5b7c5","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1183,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"},{"line_number":1186,"context_line":"            self._validate_gw_out_of_pools(s[\u0027gateway_ip\u0027],"},{"line_number":1187,"context_line":"                                           s[\u0027allocation_pools\u0027])"},{"line_number":1188,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_0ab3ae9a","line":1185,"in_reply_to":"9a80dd14_4a3a06ce","updated":"2015-03-19 06:24:17.000000000","message":"Ok, now I understand. Fixed.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1183,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"},{"line_number":1186,"context_line":"            self._validate_gw_out_of_pools(s[\u0027gateway_ip\u0027],"},{"line_number":1187,"context_line":"                                           s[\u0027allocation_pools\u0027])"},{"line_number":1188,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_b8f24004","line":1185,"in_reply_to":"9a80dd14_8067e3b6","updated":"2015-03-17 22:30:18.000000000","message":"In the base version this code exists at different indentation levels because it is nested under the \"with\" block in create_subnet. I extracted it from there, so the indentation changed accordingly as it now requires only 1 level of indentation instead of 2.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b27496dbc69dddd0f853094a2be2a4aee4162c82","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1183,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1184,"context_line":""},{"line_number":1185,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"},{"line_number":1186,"context_line":"            self._validate_gw_out_of_pools(s[\u0027gateway_ip\u0027],"},{"line_number":1187,"context_line":"                                           s[\u0027allocation_pools\u0027])"},{"line_number":1188,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_4a3a06ce","line":1185,"in_reply_to":"9a80dd14_b8f24004","updated":"2015-03-19 05:23:41.000000000","message":"Which with statement?  I don\u0027t see one until L1079 in the old code.  So, that doesn\u0027t exactly add up.\n\nWhat I was saying is that in the old code, L1185/6 are nested under the else clause (L1073/4) and here they are not.  I\u0027m still wondering why.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1105,"context_line":"        subnet_id \u003d subnet.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1106,"context_line":""},{"line_number":1107,"context_line":"        if self._is_any_subnetpool_request(cidr):"},{"line_number":1108,"context_line":"            prefixlen \u003d subnet[\u0027prefixlen\u0027]"},{"line_number":1109,"context_line":"            if prefixlen is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1110,"context_line":"                prefixlen \u003d int(subnetpool[\u0027default_prefixlen\u0027])"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_cf4d2874","line":1107,"updated":"2015-03-19 05:26:59.000000000","message":"nit:  This doesn\u0027t really need to be a method:\n\n  is_any_subnetpool_request \u003d cidr is attributes.ATTR_NOT_SPECIFIED\n  if is_any_subnetpool_request:\n      ...","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":1115,"context_line":"                          utils.ip_version_from_int(subnetpool[\u0027ip_version\u0027]),"},{"line_number":1116,"context_line":"                          prefixlen)"},{"line_number":1117,"context_line":"        else:"},{"line_number":1118,"context_line":"            return ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1119,"context_line":"                                              subnet_id,"},{"line_number":1120,"context_line":"                                              cidr)"},{"line_number":1121,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_6f37dce3","line":1118,"updated":"2015-03-19 05:26:59.000000000","message":"nit:  I always prefer to put the simple one first and reduce the indentation for the rest.  Just a style thing though so I won\u0027t vote negatively for it.\n\nStarting at L1107:\n\n  is_specific_subnetpool_request \u003d cidr is attributes.ATTR_NOT_SPECIFIED\n  if is_specific_subnetpool_request:\n      return ipam.SpecificSubnetRequest(tenant_id, subnet_id, cidr)\n\n  prefixlen \u003d subnet[\u0027prefixlen\u0027]\n  ...","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":1192,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1193,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1194,"context_line":""},{"line_number":1195,"context_line":"        if s[\u0027gateway_ip\u0027] is not None:"},{"line_number":1196,"context_line":"            self._validate_gw_out_of_pools(s[\u0027gateway_ip\u0027],"},{"line_number":1197,"context_line":"                                           s[\u0027allocation_pools\u0027])"},{"line_number":1198,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_8a8cfe81","line":1195,"updated":"2015-03-19 05:26:59.000000000","message":"I\u0027m still wondering about my questions on PS34 around this area.","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":1144,"context_line":"            ipam_subnet \u003d allocator.allocate_subnet(context.session, req)"},{"line_number":1145,"context_line":"            detail \u003d ipam_subnet.get_details()"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"            if s[\u0027gateway_ip\u0027] is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1148,"context_line":"                s[\u0027gateway_ip\u0027] \u003d str(detail.subnet.network + 1)"},{"line_number":1149,"context_line":""},{"line_number":1150,"context_line":"            args \u003d {\u0027tenant_id\u0027: tenant_id,"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_357ef7e4","line":1147,"updated":"2015-03-19 16:15:19.000000000","message":"Gateway calculation is duplicated in both _create_subnet_* methods. Can we move it into create_subnet()?","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"                    \u0027enable_dhcp\u0027: s[\u0027enable_dhcp\u0027],"},{"line_number":1158,"context_line":"                    \u0027gateway_ip\u0027: s[\u0027gateway_ip\u0027],"},{"line_number":1159,"context_line":"                    \u0027shared\u0027: network.shared}"},{"line_number":1160,"context_line":"            if subnetpool[\u0027ip_version\u0027] \u003d\u003d 6 and s[\u0027enable_dhcp\u0027]:"},{"line_number":1161,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_ra_mode\u0027]):"},{"line_number":1162,"context_line":"                    args[\u0027ipv6_ra_mode\u0027] \u003d s[\u0027ipv6_ra_mode\u0027]"},{"line_number":1163,"context_line":"                if attributes.is_attr_set(s[\u0027ipv6_address_mode\u0027]):"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_b0711579","line":1160,"updated":"2015-03-19 16:15:19.000000000","message":"The code from line 1160 till line 1175 is pretty the same as in implicit method. It should be easy to reuse the code here. The only difference is that in some places we use subnetpool attributes for args instead of subnet ones. That can be generalized by accessing them from args dictionary itself.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            if not has_allocpool:"},{"line_number":1167,"context_line":"                s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet("},{"line_number":1168,"context_line":"                                                                context, args)"},{"line_number":1169,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"},{"line_number":1170,"context_line":"                                            str(detail.subnet.cidr))"},{"line_number":1171,"context_line":""},{"line_number":1172,"context_line":"            subnet \u003d self._save_subnet(context, args,"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_b0403536","line":1169,"updated":"2015-03-19 16:15:19.000000000","message":"there should be no need to validate pools that we allocated ourselves above.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"        prefixlen \u003d s.get(\u0027prefixlen\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1229,"context_line":"        has_cidr \u003d cidr is not attributes.ATTR_NOT_SPECIFIED"},{"line_number":1230,"context_line":"        has_prefixlen \u003d prefixlen is not attributes.ATTR_NOT_SPECIFIED"},{"line_number":1231,"context_line":"        if has_cidr and has_prefixlen:"},{"line_number":1232,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1233,"context_line":"                                   msg\u003d\u0027Both cidr and prefixlen specified.\u0027)"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_f2d395fe","line":1231,"updated":"2015-03-19 16:15:19.000000000","message":"We probably should not consider it an error if prefixlen is the same as in cidr.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d720e7554a0d3e67a28bfa3ce9add9ee1c9ad230","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"        prefixlen \u003d s.get(\u0027prefixlen\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1229,"context_line":"        has_cidr \u003d cidr is not attributes.ATTR_NOT_SPECIFIED"},{"line_number":1230,"context_line":"        has_prefixlen \u003d prefixlen is not attributes.ATTR_NOT_SPECIFIED"},{"line_number":1231,"context_line":"        if has_cidr and has_prefixlen:"},{"line_number":1232,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1233,"context_line":"                                   msg\u003d\u0027Both cidr and prefixlen specified.\u0027)"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_8bb5c4ee","line":1231,"in_reply_to":"9a80dd14_f2d395fe","updated":"2015-03-19 16:41:59.000000000","message":"Done","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fedb08b29f775ddb6d4231dc6ead3b9a79379181","unresolved":false,"context_lines":[{"line_number":1572,"context_line":"        \"\"\"Delete a subnetpool.\"\"\""},{"line_number":1573,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1574,"context_line":"            subnetpool \u003d self._get_subnetpool(context, id)"},{"line_number":1575,"context_line":"            subnets \u003d self._get_subnets_by_subnetpool(context, id)"},{"line_number":1576,"context_line":"            if subnets:"},{"line_number":1577,"context_line":"                reason \u003d _(\"Subnet pool has existing allocations\")"},{"line_number":1578,"context_line":"                raise n_exc.SubnetPoolDeleteError(reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a80dd14_c436c150","line":1575,"updated":"2015-03-19 21:19:50.000000000","message":"Do we need an index on the subnetpool attribute of subnets for this?  Otherwise, we\u0027ll be looking through every subnet in the table.","commit_id":"61587239a5931b748c3171197f064290c4fbad19"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1ea54952d999681cff3b8b6d388337f8888b258c","unresolved":false,"context_lines":[{"line_number":1572,"context_line":"        \"\"\"Delete a subnetpool.\"\"\""},{"line_number":1573,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1574,"context_line":"            subnetpool \u003d self._get_subnetpool(context, id)"},{"line_number":1575,"context_line":"            subnets \u003d self._get_subnets_by_subnetpool(context, id)"},{"line_number":1576,"context_line":"            if subnets:"},{"line_number":1577,"context_line":"                reason \u003d _(\"Subnet pool has existing allocations\")"},{"line_number":1578,"context_line":"                raise n_exc.SubnetPoolDeleteError(reason\u003dreason)"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a80dd14_87ee8b20","line":1575,"in_reply_to":"9a80dd14_c436c150","updated":"2015-03-19 21:27:30.000000000","message":"Yes, we do","commit_id":"61587239a5931b748c3171197f064290c4fbad19"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"        if not attributes.is_attr_set(allocation_pools):"},{"line_number":1112,"context_line":"            allocation_pools \u003d self._allocate_pools_for_subnet("},{"line_number":1113,"context_line":"                                                         context, args)"},{"line_number":1114,"context_line":"        self._validate_allocation_pools(allocation_pools,"},{"line_number":1115,"context_line":"                                        args[\u0027cidr\u0027])"},{"line_number":1116,"context_line":""},{"line_number":1117,"context_line":"        subnet \u003d models_v2.Subnet(**args)"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_9a5fa20e","line":1114,"updated":"2015-03-20 14:59:22.000000000","message":"I suspect we don\u0027t need validation if we allocated pools ourselves, same as in line 1219.","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":1210,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1211,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        if s[\u0027gateway_ip\u0027] is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1214,"context_line":"            cidr_net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1215,"context_line":"            s[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(s, cidr_net)"},{"line_number":1216,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_da83da53","line":1213,"updated":"2015-03-20 14:59:22.000000000","message":"can\u0027t we move gateway_ip setting into _save_subnet()? It\u0027s set for both implicit and explicit cases.","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9138cda95f6bbbef9a12360fed7cadc282522acc","unresolved":false,"context_lines":[{"line_number":1210,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1211,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        if s[\u0027gateway_ip\u0027] is attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1214,"context_line":"            cidr_net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1215,"context_line":"            s[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(s, cidr_net)"},{"line_number":1216,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_bbb1c302","line":1213,"in_reply_to":"9a80dd14_da83da53","updated":"2015-03-20 17:46:36.000000000","message":"Done","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":1214,"context_line":"            cidr_net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1215,"context_line":"            s[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(s, cidr_net)"},{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1219,"context_line":"        else:"},{"line_number":1220,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_fa86de63","line":1217,"updated":"2015-03-20 14:59:22.000000000","message":"We do pretty the same thing in _save_subnet(). Is it needed here at all?","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9138cda95f6bbbef9a12360fed7cadc282522acc","unresolved":false,"context_lines":[{"line_number":1214,"context_line":"            cidr_net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1215,"context_line":"            s[\u0027gateway_ip\u0027] \u003d self._gateway_ip_str(s, cidr_net)"},{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"        if s[\u0027allocation_pools\u0027] \u003d\u003d attributes.ATTR_NOT_SPECIFIED:"},{"line_number":1218,"context_line":"            s[\u0027allocation_pools\u0027] \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1219,"context_line":"        else:"},{"line_number":1220,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027],"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_5be9a7e1","line":1217,"in_reply_to":"9a80dd14_fa86de63","updated":"2015-03-20 17:46:36.000000000","message":"I get some strange failures in some of the other plugins that extend NeutronDbPluginV2 if this whole if/else block isn\u0027t left as is. It needs further investigation, I just haven\u0027t wanted to go down the rabbit hole yet.","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"7ca44ccc06666261d082ce968d080eec57b2e7d7","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def _get_subnetpool(self, context, id):"},{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            return self._get_by_id(context, models_v2.SubnetPool, id)"},{"line_number":106,"context_line":"        except exc.NoResultFound:"},{"line_number":107,"context_line":"            raise n_exc.SubnetPoolNotFound(subnetpool_id\u003did)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _get_all_subnetpools(self, context):"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_02c211e9","line":106,"updated":"2015-03-23 22:13:09.000000000","message":"This is something I didn\u0027t catch before.  We agreed with the prefix delegation folks that we would ignore any pool ids that we don\u0027t recognize.  Any suggestions for how to handle this?  Maybe we can just do this for now and their code [1] could adjust it (e.g. catch this exception and do their PD thing at that point).\n\n[1] https://review.openstack.org/#/c/158697/","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1d405cb508436b6e110c9af7c66e1294d6706bc6","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def _get_subnetpool(self, context, id):"},{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            return self._get_by_id(context, models_v2.SubnetPool, id)"},{"line_number":106,"context_line":"        except exc.NoResultFound:"},{"line_number":107,"context_line":"            raise n_exc.SubnetPoolNotFound(subnetpool_id\u003did)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _get_all_subnetpools(self, context):"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_0f1db173","line":106,"in_reply_to":"1a6ced46_02c211e9","updated":"2015-03-24 17:37:28.000000000","message":"I\u0027m not sure how to get around in here without raising an exception. The code that calls this is invoked when a user runs a GET against subnetpools/\u003csubnet pool ID\u003e.  If the subnet pool doesn\u0027t exist, I\u0027m not sure what the alternative to raising NoResultFound is.","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e706a59137a2d615f44031de2d59edd1dba91cde","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def _get_subnetpool(self, context, id):"},{"line_number":104,"context_line":"        try:"},{"line_number":105,"context_line":"            return self._get_by_id(context, models_v2.SubnetPool, id)"},{"line_number":106,"context_line":"        except exc.NoResultFound:"},{"line_number":107,"context_line":"            raise n_exc.SubnetPoolNotFound(subnetpool_id\u003did)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _get_all_subnetpools(self, context):"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_38ec6cc7","line":106,"in_reply_to":"1a6ced46_0f1db173","updated":"2015-03-25 21:31:25.000000000","message":"Thinking about it further, I think raising an exception here is fine.  It will have to be caught somewhere to handle the case I was talking about.  So, leave it out of this patch.","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"6b4093b1c888d8601ee896596d84cf8e8e159e44","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"            if has_prefixlen and has_cidr and net.prefixlen !\u003d prefixlen:"},{"line_number":1256,"context_line":"                msg \u003d _(\u0027prefixlen does not match the given prefix for cidr\u0027)"},{"line_number":1257,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dmsg)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1261,"context_line":"            # Create subnet in backward-compatible way using the implicit pool"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_b56dd134","line":1258,"updated":"2015-03-24 16:33:21.000000000","message":"If not has_cidr and not has_subnetpool_id then we need to turn to the configured default pool [1].  Currently, we only have a default for ipv6 to handle the use case where a deployer wants a single ipv6 pool throughout the cloud.\n\n[1] https://review.openstack.org/#/c/166973","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1097,"context_line":""},{"line_number":1098,"context_line":"    def _save_subnet(self, context,"},{"line_number":1099,"context_line":"                     network,"},{"line_number":1100,"context_line":"                     args,"},{"line_number":1101,"context_line":"                     dns_nameservers,"},{"line_number":1102,"context_line":"                     host_routes,"},{"line_number":1103,"context_line":"                     allocation_pools):"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_f9f63ff8","line":1100,"updated":"2015-03-25 12:21:41.000000000","message":"call this parameters subnet_args, because it\u0027s a dict.\nargs can be mixed up with *args.\n\nalso consider passing the elements of the dict as keyword parameters.\nI thought you liked strong typing, why then waive also the week parameter verification mechanism python has and resort to dict magic?\nI know you\u0027re doing it to have the same data format with and without pools, so it is not a thing I would require you to address now.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1097,"context_line":""},{"line_number":1098,"context_line":"    def _save_subnet(self, context,"},{"line_number":1099,"context_line":"                     network,"},{"line_number":1100,"context_line":"                     args,"},{"line_number":1101,"context_line":"                     dns_nameservers,"},{"line_number":1102,"context_line":"                     host_routes,"},{"line_number":1103,"context_line":"                     allocation_pools):"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_2e8a386a","line":1100,"in_reply_to":"1a6ced46_f9f63ff8","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"                                            args[\u0027cidr\u0027])"},{"line_number":1110,"context_line":"            if args[\u0027gateway_ip\u0027]:"},{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_f9239fa4","line":1112,"updated":"2015-03-25 12:21:41.000000000","message":"If the pools are supplied, but the gateway isn\u0027t would it be possible to just tell the subnet allocator to generate a gateway which is not in any pool, thus avoiding us this check?\n\nIf both gateway and pools are specified instead the check can be performed before allocating the subnet, thus allowing us to fail fast","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"                                            args[\u0027cidr\u0027])"},{"line_number":1110,"context_line":"            if args[\u0027gateway_ip\u0027]:"},{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_eeb4a036","line":1112,"in_reply_to":"1a6ced46_f9239fa4","updated":"2015-03-25 19:47:55.000000000","message":"I\u0027ll look into this. Having this if/else block as is keeps existing tests that create subnets in the null pool happy. I\u0027ll admit that this is a bit of cut/paste refactoring of the original create_subnet() method.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""},{"line_number":1116,"context_line":"        subnet \u003d models_v2.Subnet(**args)"},{"line_number":1117,"context_line":"        context.session.add(subnet)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_5949135f","line":1114,"updated":"2015-03-25 12:21:41.000000000","message":"I reckon doing this check when a subnet is generated by a pool is a waste of resources because it should not be needed (especially once we merge removal of overlapping cidrs within a pool)","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""},{"line_number":1116,"context_line":"        subnet \u003d models_v2.Subnet(**args)"},{"line_number":1117,"context_line":"        context.session.add(subnet)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_5a8bafc2","line":1114,"in_reply_to":"1a6ced46_5949135f","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1143,"context_line":""},{"line_number":1144,"context_line":"    def _make_subnet_args(self, context, shared, detail,"},{"line_number":1145,"context_line":"                          subnet, subnetpool_id\u003dNone):"},{"line_number":1146,"context_line":"        self._validate_subnet(context, subnet)"},{"line_number":1147,"context_line":"        args \u003d {\u0027tenant_id\u0027: detail.tenant_id,"},{"line_number":1148,"context_line":"                \u0027id\u0027: detail.subnet_id,"},{"line_number":1149,"context_line":"                \u0027name\u0027: subnet[\u0027name\u0027],"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_f9855f07","line":1146,"updated":"2015-03-25 12:21:41.000000000","message":"I think this validation should occur before allocating from the pool, as it pertains user input.\n\nIn my opinion it is always better to fail fast.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1187,"context_line":"        return subnet.get(\u0027gateway_ip\u0027)"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":1190,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":1191,"context_line":"    def _create_subnet_from_pool(self, context, subnet):"},{"line_number":1192,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1193,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_396c5735","line":1190,"updated":"2015-03-25 12:21:41.000000000","message":"I think you want to retry also on deadlock here","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1187,"context_line":"        return subnet.get(\u0027gateway_ip\u0027)"},{"line_number":1188,"context_line":""},{"line_number":1189,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":1190,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":1191,"context_line":"    def _create_subnet_from_pool(self, context, subnet):"},{"line_number":1192,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1193,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_dad23f5b","line":1190,"in_reply_to":"1a6ced46_396c5735","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"        has_allocpool \u003d attributes.is_attr_set(s[\u0027allocation_pools\u0027])"},{"line_number":1195,"context_line":""},{"line_number":1196,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1197,"context_line":"            subnetpool \u003d self.get_subnetpool(context, s[\u0027subnetpool_id\u0027])"},{"line_number":1198,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1199,"context_line":"            allocator \u003d subnet_alloc.SubnetAllocator(subnetpool)"},{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_997b8bf4","line":1197,"updated":"2015-03-25 12:21:41.000000000","message":"I think you can also call _get_subnetpool in the statement above, you do not need top build the dict as well, do you?","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"        has_allocpool \u003d attributes.is_attr_set(s[\u0027allocation_pools\u0027])"},{"line_number":1195,"context_line":""},{"line_number":1196,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1197,"context_line":"            subnetpool \u003d self.get_subnetpool(context, s[\u0027subnetpool_id\u0027])"},{"line_number":1198,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1199,"context_line":"            allocator \u003d subnet_alloc.SubnetAllocator(subnetpool)"},{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_bae2e32c","line":1197,"in_reply_to":"1a6ced46_997b8bf4","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1254,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1255,"context_line":"            if has_prefixlen and has_cidr and net.prefixlen !\u003d prefixlen:"},{"line_number":1256,"context_line":"                msg \u003d _(\u0027prefixlen does not match the given prefix for cidr\u0027)"},{"line_number":1257,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dmsg)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_d9fc2375","line":1257,"updated":"2015-03-25 12:21:41.000000000","message":"I\u0027d rather just do cidr and prefixlen mutually exclusive. It would be simpler to understand from a user perspective. But this is a minor point, ignore it if you don\u0027t agree with it.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1254,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1255,"context_line":"            if has_prefixlen and has_cidr and net.prefixlen !\u003d prefixlen:"},{"line_number":1256,"context_line":"                msg \u003d _(\u0027prefixlen does not match the given prefix for cidr\u0027)"},{"line_number":1257,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dmsg)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_1a7bf77b","line":1257,"in_reply_to":"1a6ced46_8525d40a","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"59f33bbccdcc6d5e4fe9eb4cef6fe18844e48756","unresolved":false,"context_lines":[{"line_number":1254,"context_line":"            subnet[\u0027subnet\u0027][\u0027cidr\u0027] \u003d \u0027%s/%s\u0027 % (net.network, net.prefixlen)"},{"line_number":1255,"context_line":"            if has_prefixlen and has_cidr and net.prefixlen !\u003d prefixlen:"},{"line_number":1256,"context_line":"                msg \u003d _(\u0027prefixlen does not match the given prefix for cidr\u0027)"},{"line_number":1257,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dmsg)"},{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_8525d40a","line":1257,"in_reply_to":"1a6ced46_d9fc2375","updated":"2015-03-25 16:55:03.000000000","message":"+1","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1261,"context_line":"            # Create subnet in backward-compatible way using the implicit pool"},{"line_number":1262,"context_line":"            return self._create_subnet_from_implicit_pool(context, subnet)"},{"line_number":1263,"context_line":"        return self._create_subnet_from_pool(context, subnet)"},{"line_number":1264,"context_line":""}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_f6e00efc","line":1261,"updated":"2015-03-25 12:21:41.000000000","message":"pedant nit: this is not a matter of backward compatibility, I think neutron API will keep the option of creating subnets without a pool for the foreseeable future","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"59f33bbccdcc6d5e4fe9eb4cef6fe18844e48756","unresolved":false,"context_lines":[{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1261,"context_line":"            # Create subnet in backward-compatible way using the implicit pool"},{"line_number":1262,"context_line":"            return self._create_subnet_from_implicit_pool(context, subnet)"},{"line_number":1263,"context_line":"        return self._create_subnet_from_pool(context, subnet)"},{"line_number":1264,"context_line":""}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_c5726c10","line":1261,"in_reply_to":"1a6ced46_f6e00efc","updated":"2015-03-25 16:55:03.000000000","message":"@Salvatore.  You\u0027re right, that is a bit more accurate way to state it.  I asked for the comment in a previous patch set because I wanted something here to explain why we have this decision point.  You\u0027ve done a better job explaining.","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":1258,"context_line":""},{"line_number":1259,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1260,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1261,"context_line":"            # Create subnet in backward-compatible way using the implicit pool"},{"line_number":1262,"context_line":"            return self._create_subnet_from_implicit_pool(context, subnet)"},{"line_number":1263,"context_line":"        return self._create_subnet_from_pool(context, subnet)"},{"line_number":1264,"context_line":""}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_3a80b345","line":1261,"in_reply_to":"1a6ced46_f6e00efc","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"80d19de450dfb72a11f44f2d01a9995f9c1a0c19","unresolved":false,"context_lines":[{"line_number":1115,"context_line":"            # The \u0027shared\u0027 attribute for subnets is for internal plugin"},{"line_number":1116,"context_line":"            # use only. It is not exposed through the API"},{"line_number":1117,"context_line":"            args \u003d {\u0027tenant_id\u0027: tenant_id,"},{"line_number":1118,"context_line":"                    \u0027id\u0027: s.get(\u0027id\u0027) or uuidutils.generate_uuid(),"},{"line_number":1119,"context_line":"                    \u0027name\u0027: s[\u0027name\u0027],"},{"line_number":1120,"context_line":"                    \u0027network_id\u0027: s[\u0027network_id\u0027],"},{"line_number":1121,"context_line":"                    \u0027ip_version\u0027: s[\u0027ip_version\u0027],"}],"source_content_type":"text/x-python","patch_set":54,"id":"1a6ced46_c6b0a045","side":"PARENT","line":1118,"updated":"2015-03-26 04:18:44.000000000","message":"Here is where the subnet_id from the request is used.  If it isn\u0027t in the request then one is generated.  At first glance, it appears as though you\u0027ve preserved that functionality.  However, the functional test thinks otherwise.","commit_id":"ecf8c524b9080065f6a20413a9e99256f6432738"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"80d19de450dfb72a11f44f2d01a9995f9c1a0c19","unresolved":false,"context_lines":[{"line_number":1163,"context_line":""},{"line_number":1164,"context_line":"    def _make_subnet_request(self, tenant_id, subnet, subnetpool):"},{"line_number":1165,"context_line":"        cidr \u003d subnet.get(\u0027cidr\u0027)"},{"line_number":1166,"context_line":"        subnet_id \u003d subnet.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1167,"context_line":"        is_any_subnetpool_request \u003d not attributes.is_attr_set(cidr)"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"        if is_any_subnetpool_request:"}],"source_content_type":"text/x-python","patch_set":54,"id":"1a6ced46_66f0ccfe","line":1166,"updated":"2015-03-26 04:18:44.000000000","message":"This appears to be correct since you pass s for subnet on L1201","commit_id":"423ddbe2604f626b367848e47de1b7795db9f6dd"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"80d19de450dfb72a11f44f2d01a9995f9c1a0c19","unresolved":false,"context_lines":[{"line_number":1223,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1224,"context_line":"        self._validate_subnet(context, s)"},{"line_number":1225,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, s)"},{"line_number":1226,"context_line":"        id \u003d subnet.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":54,"id":"1a6ced46_86f14803","line":1226,"updated":"2015-03-26 04:18:44.000000000","message":"Here\u0027s the problem.  This should be s.get(\u0027id\u0027, uuidutils.generate_uuid())","commit_id":"423ddbe2604f626b367848e47de1b7795db9f6dd"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"6f16a9eadc6992210d6a8dcc08e763f6ec505bbc","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_49aa3272","line":1229,"updated":"2015-03-26 16:01:15.000000000","message":"This raises an error for me when s[\u0027cidr\u0027]  \u003d\u003d attributes.ATTR_NOT_SPECIFIED. Not sure if this needs to be addressed here or on the ipam side.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"7b742153c8cf2562c88406bf264422b702ecf683","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_c213b70c","line":1229,"in_reply_to":"fa963961_1f957ce3","updated":"2015-03-26 16:49:56.000000000","message":"According to the BP, creating a subnet without passing a CIDR or subnet-pool ID should be allowed. The subnet should then be assigned a CIDR from the default pool defined in neutron.conf, or an error if a default isn\u0027t defined. This part seems to be missing. If we\u0027re saying that that\u0027s going to be added in a subsequent patch then I\u0027m ok with that.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"18ebfb3e0af9f362dff4f3d9d92bc5ef24987bfa","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_bf71f0e2","line":1229,"in_reply_to":"fa963961_2995aee3","updated":"2015-03-26 16:40:37.000000000","message":"Here\u0027s the stacktrace from q-svc when calling subnet-create with only a network ID using the updated python client (https://review.openstack.org/#/c/165910/): http://pastebin.com/S2NWgG2U. That\u0027s something that should work as far I understand, perhaps you could point out where I\u0027m going wrong? Thanks.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":12912,"name":"John Belamaric","email":"jbelamaric@infoblox.com","username":"johnbelamaric"},"change_message_id":"05e84612be57c8d83e4132eeaacc0e1dd62c3f4b","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_1f957ce3","line":1229,"in_reply_to":"fa963961_2995aee3","updated":"2015-03-26 16:39:50.000000000","message":"So, what you are saying is that it should be a validation error at the API layer if someone tries to allocate a subnet from the null pool without passing a CIDR. That is, if you do not pass a subnet pool ID you must pass a CIDR.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"413d199bca6008656e5ccc7867009f51ec986764","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_2995aee3","line":1229,"in_reply_to":"fa963961_49aa3272","updated":"2015-03-26 16:12:47.000000000","message":"Handle it on the IPAM side. Since you\u0027re allocating from the null pool, s[\u0027cidr\u0027] should not be attributes.ATTR_NOT_SPECIFIED. You get into this method if you want to create subnets in a legacy way. I contend that you\u0027re not calling this correctly.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"730d566251850387300fb34cdb1a4d6fc22a8e35","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_ff0e4de4","line":1229,"in_reply_to":"fa963961_7376ff3f","updated":"2015-03-26 21:01:15.000000000","message":"Ok, sounds good. Thanks for clarifying","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"3b1dca1ea362c5c54ca1265cc7ca902b0104cff6","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_7376ff3f","line":1229,"in_reply_to":"fa963961_bf71f0e2","updated":"2015-03-26 18:13:55.000000000","message":"I\u0027ll go to the ML with a more detailed description.  We have deviated from the spec a little bit in the interest of getting something working. Automatic subnet allocation from the null pool is not supported, which is what it appears you\u0027re trying to do.  At a high level, if you don\u0027t pass CIDR you must pass a subnetpool_id.  The default pool in neutron.conf is not something that will exist in Kilo. What you are seeing is expected behavior, and yes it deviates from the spec a little bit.  Creating a subnet can only be done in the following ways 1): network,cidr  2): network,cidr,subnetpool_id  3): network,subnetpool_id","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f2e1022072aeb85e0f74e96e99d1554ec3c70b3d","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_d3d5cbb9","line":1229,"in_reply_to":"fa963961_bf71f0e2","updated":"2015-03-26 18:12:47.000000000","message":"We do need a follow-on patch to integrate with your patch.  I will work on that here [1].  It will be straight-forward.\n\n[1] https://review.openstack.org/168098","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":6635,"name":"John Davidge","email":"john.davidge@rackspace.com","username":"john-davidge"},"change_message_id":"730d566251850387300fb34cdb1a4d6fc22a8e35","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        id \u003d s.get(\u0027id\u0027, uuidutils.generate_uuid())"},{"line_number":1227,"context_line":"        detail \u003d ipam.SpecificSubnetRequest(tenant_id,"},{"line_number":1228,"context_line":"                                            id,"},{"line_number":1229,"context_line":"                                            s[\u0027cidr\u0027])"},{"line_number":1230,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1231,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1232,"context_line":"            self._validate_subnet_cidr(context, network, s[\u0027cidr\u0027])"}],"source_content_type":"text/x-python","patch_set":56,"id":"fa963961_ff252d5c","line":1229,"in_reply_to":"fa963961_d3d5cbb9","updated":"2015-03-26 21:01:15.000000000","message":"Great, thanks.","commit_id":"aad43c87b7cf590e002f04adfc28786464b1e183"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"43b3a031acff70f34fbe71f7dd1553750870b20a","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1199,"context_line":"            allocator \u003d subnet_alloc.SubnetAllocator(subnetpool)"},{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"},{"line_number":1201,"context_line":"            if isinstance(req, ipam.AnySubnetRequest) and has_allocpool:"},{"line_number":1202,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1203,"context_line":"                                       msg\u003d\"allocation_pools allowed only \""},{"line_number":1204,"context_line":"                                       \"for specific subnet requests.\")"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_d717e0eb","line":1201,"updated":"2015-03-30 13:17:55.000000000","message":"I still believe that you could perform this check before entering the transaction. We should strive to fail fast where possible.\n\nIt seems that you feel a need to build first a subnetrequest object, which requires you to load the subnetpool. But all you need is:\n\nis_any_subnetpool_request \u003d not attributes.is_attr_set(cidr)","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6277467e1c081df9a99c485afd7cbd49425080fa","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"            network \u003d self._get_network(context, s[\"network_id\"])"},{"line_number":1199,"context_line":"            allocator \u003d subnet_alloc.SubnetAllocator(subnetpool)"},{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"},{"line_number":1201,"context_line":"            if isinstance(req, ipam.AnySubnetRequest) and has_allocpool:"},{"line_number":1202,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1203,"context_line":"                                       msg\u003d\"allocation_pools allowed only \""},{"line_number":1204,"context_line":"                                       \"for specific subnet requests.\")"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_5ab6508b","line":1201,"in_reply_to":"da9b358b_d717e0eb","updated":"2015-03-30 16:00:49.000000000","message":"Done","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"528ab0fffca3e174052e5e3902e5ee4564d58118","unresolved":false,"context_lines":[{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"},{"line_number":1201,"context_line":"            if isinstance(req, ipam.AnySubnetRequest) and has_allocpool:"},{"line_number":1202,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1203,"context_line":"                                       msg\u003d\"allocation_pools allowed only \""},{"line_number":1204,"context_line":"                                       \"for specific subnet requests.\")"},{"line_number":1205,"context_line":"            ipam_subnet \u003d allocator.allocate_subnet(context.session, req)"},{"line_number":1206,"context_line":"            detail \u003d ipam_subnet.get_details()"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_9203bcb8","line":1203,"updated":"2015-03-29 10:06:16.000000000","message":"msg\u003d\u003ereason\nIn addition to this the reason should be translated","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6277467e1c081df9a99c485afd7cbd49425080fa","unresolved":false,"context_lines":[{"line_number":1200,"context_line":"            req \u003d self._make_subnet_request(tenant_id, s, subnetpool)"},{"line_number":1201,"context_line":"            if isinstance(req, ipam.AnySubnetRequest) and has_allocpool:"},{"line_number":1202,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027,"},{"line_number":1203,"context_line":"                                       msg\u003d\"allocation_pools allowed only \""},{"line_number":1204,"context_line":"                                       \"for specific subnet requests.\")"},{"line_number":1205,"context_line":"            ipam_subnet \u003d allocator.allocate_subnet(context.session, req)"},{"line_number":1206,"context_line":"            detail \u003d ipam_subnet.get_details()"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_dafca040","line":1203,"in_reply_to":"da9b358b_9203bcb8","updated":"2015-03-30 16:00:49.000000000","message":"Done","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"807200ec0ff5c5cda4b012015d780989505a0c9b","unresolved":false,"context_lines":[{"line_number":1244,"context_line":""},{"line_number":1245,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1246,"context_line":"        cidr \u003d s.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1247,"context_line":"        prefixlen \u003d s.get(\u0027prefixlen\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1248,"context_line":"        has_cidr \u003d attributes.is_attr_set(cidr)"},{"line_number":1249,"context_line":"        has_prefixlen \u003d attributes.is_attr_set(prefixlen)"},{"line_number":1250,"context_line":""}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_15b09b42","line":1247,"updated":"2015-03-30 16:36:06.000000000","message":"For both cidr and prefixlen, do we need to use get(). In the attribute map, the default value for these fields are declared as ATTR_NOT_SPEICIFED, so I think you don\u0027t need to use get(). You can use just s[\u0027cidr\u0027] instead.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"807200ec0ff5c5cda4b012015d780989505a0c9b","unresolved":false,"context_lines":[{"line_number":1249,"context_line":"        has_prefixlen \u003d attributes.is_attr_set(prefixlen)"},{"line_number":1250,"context_line":""},{"line_number":1251,"context_line":"        if has_cidr and has_prefixlen:"},{"line_number":1252,"context_line":"            msg \u003d _(\u0027cidr and prefixlen must not be supplied together\u0027)"},{"line_number":1253,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dmsg)"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"        if has_cidr:"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_15de5b6d","line":1252,"updated":"2015-03-30 16:36:06.000000000","message":"I think more straightforward message is \"cannot be specified together\".","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"43b3a031acff70f34fbe71f7dd1553750870b20a","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1261,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1262,"context_line":"            # Create subnet from the implicit(AKA null) pool"},{"line_number":1263,"context_line":"            return self._create_subnet_from_implicit_pool(context, subnet)"},{"line_number":1264,"context_line":"        return self._create_subnet_from_pool(context, subnet)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"    def _update_subnet_dns_nameservers(self, context, id, s):"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_770ff4e1","line":1263,"updated":"2015-03-30 13:17:55.000000000","message":"it\u0027s interesting that we already have another patch lined up that basically reworks the logic of this method!","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"6796b554b6f1756fcd8ccf0676f03b6235932c38","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"        subnetpool_id \u003d s.get(\u0027subnetpool_id\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1261,"context_line":"        if not attributes.is_attr_set(subnetpool_id):"},{"line_number":1262,"context_line":"            # Create subnet from the implicit(AKA null) pool"},{"line_number":1263,"context_line":"            return self._create_subnet_from_implicit_pool(context, subnet)"},{"line_number":1264,"context_line":"        return self._create_subnet_from_pool(context, subnet)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"    def _update_subnet_dns_nameservers(self, context, id, s):"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_103b09d3","line":1263,"in_reply_to":"da9b358b_770ff4e1","updated":"2015-03-30 16:08:25.000000000","message":"Are you talking about my follow-on?  I wouldn\u0027t call that reworking.  It is adding further functionality to this method.  Would you prefer we squash it all together and continue to add functionality to this patch while reviewers are reviewing?  I find that disruptive and hard on reviewers.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"43b3a031acff70f34fbe71f7dd1553750870b20a","unresolved":false,"context_lines":[{"line_number":1469,"context_line":"        if not cfg.CONF.allow_overlapping_ips:"},{"line_number":1470,"context_line":"            msg \u003d _(\"Use of subnet pools only supported when\""},{"line_number":1471,"context_line":"                    \" allow_overlapping_ips\u003dTrue\")"},{"line_number":1472,"context_line":"            raise n_exc.BadRequest(msg\u003dmsg)"},{"line_number":1473,"context_line":""},{"line_number":1474,"context_line":"        sp \u003d subnetpool[\u0027subnetpool\u0027]"},{"line_number":1475,"context_line":"        sp_reader \u003d subnet_alloc.SubnetPoolReader(sp)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_775814fb","line":1472,"updated":"2015-03-30 13:17:55.000000000","message":"this should go in another patch as it\u0027s a bug on the subnetpools API.\nSorry about this pedant comment, but while there are ongoing discussions on the gist of this patch, this specific kind of change should be easy to merge.\n\nPlus, you\u0027ll get an extra commit! Free brownie points ;)","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6277467e1c081df9a99c485afd7cbd49425080fa","unresolved":false,"context_lines":[{"line_number":1469,"context_line":"        if not cfg.CONF.allow_overlapping_ips:"},{"line_number":1470,"context_line":"            msg \u003d _(\"Use of subnet pools only supported when\""},{"line_number":1471,"context_line":"                    \" allow_overlapping_ips\u003dTrue\")"},{"line_number":1472,"context_line":"            raise n_exc.BadRequest(msg\u003dmsg)"},{"line_number":1473,"context_line":""},{"line_number":1474,"context_line":"        sp \u003d subnetpool[\u0027subnetpool\u0027]"},{"line_number":1475,"context_line":"        sp_reader \u003d subnet_alloc.SubnetPoolReader(sp)"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_5ae8907c","line":1472,"in_reply_to":"da9b358b_775814fb","updated":"2015-03-30 16:00:49.000000000","message":"Done","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cb6d123473b8b8acfd6814fa7c9e45afa8239edd","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(subnet_args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, subnet_args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""},{"line_number":1116,"context_line":"        subnet \u003d models_v2.Subnet(**subnet_args)"},{"line_number":1117,"context_line":"        context.session.add(subnet)"}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_57cbbd53","line":1114,"updated":"2015-03-30 21:19:11.000000000","message":"Let me ask the reason we call these validation methods (validate_allocation_pools, validate_gw_out_of_pools, validate_subnet_cidr) after a subnet allocation here?\n\nFor the case of subnet pool allocation without CIDR specification,\nCIDR is allocated from the subnet pool and users cannot control a CIDR range, so I think users can do nothing even if an exception is raised from these validation methods.\n\nIf CIDR is specified in an API request, we can call the validation methods earlier (as the previous code did).\n\nFrom the above observation, I wonder why we validate these fields after the subnet allocation. Perhaps I might be missing some important point.\n\n(The current code work, so I don\u0027t think we need to fix this now.)","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7eba0b921df73bcaaf8d6dffc3fedd963e0a7e98","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(subnet_args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, subnet_args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""},{"line_number":1116,"context_line":"        subnet \u003d models_v2.Subnet(**subnet_args)"},{"line_number":1117,"context_line":"        context.session.add(subnet)"}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_8207b81b","line":1114,"in_reply_to":"da9b358b_57cbbd53","updated":"2015-03-31 03:08:04.000000000","message":"You\u0027re not the first to point this out, and I whole-heartedly agree with everyone pointing this. However, I\u0027m most concerned about backward compatibility at this juncture. This code path is exercised by _create_subnet_from_pool() and _create_subnet_from_implicit_pool() (this method must be backward compatible).  Since this code is used in both paths there is some overlap and is a little redundant in the allocation case, however it works and I believe correctness is most important at this juncture.  This will be refactored heavily as we move forward with pluggable IPAM in future cycles.","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"8c2da6903a78adbd71436310b2cb7f0f770156e6","unresolved":false,"context_lines":[{"line_number":1111,"context_line":"                self._validate_gw_out_of_pools(subnet_args[\u0027gateway_ip\u0027],"},{"line_number":1112,"context_line":"                                               allocation_pools)"},{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        self._validate_subnet_cidr(context, network, subnet_args[\u0027cidr\u0027])"},{"line_number":1115,"context_line":""},{"line_number":1116,"context_line":"        subnet \u003d models_v2.Subnet(**subnet_args)"},{"line_number":1117,"context_line":"        context.session.add(subnet)"}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_d0a8d7dd","line":1114,"in_reply_to":"da9b358b_8207b81b","updated":"2015-03-31 13:58:46.000000000","message":"Thanks for sharing your thought. Your point sounds reasonable too because we are introducing a new feature with keeping the compatible behavior. I am fine we will refactor and improve the code/features in the future cycles!","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cb6d123473b8b8acfd6814fa7c9e45afa8239edd","unresolved":false,"context_lines":[{"line_number":1195,"context_line":"        is_any_subnetpool_request \u003d not attributes.is_attr_set(s[\u0027cidr\u0027])"},{"line_number":1196,"context_line":"        if is_any_subnetpool_request and has_allocpool:"},{"line_number":1197,"context_line":"            reason \u003d _(\"allocation_pools allowed only \""},{"line_number":1198,"context_line":"                       \"for specific subnet requests.\")"},{"line_number":1199,"context_line":"            raise n_exc.BadRequest(resource\u003d\u0027subnets\u0027, msg\u003dreason)"},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_f4c52f5b","line":1198,"updated":"2015-03-30 21:19:11.000000000","message":"(can be cleanup later) The message looks a bit ambiguous to users.\nMore explicit error message would be nice.\n\n  allocation_pools can be specified only for specific subnet request.\n  Please specify cidr too.","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"cb6d123473b8b8acfd6814fa7c9e45afa8239edd","unresolved":false,"context_lines":[{"line_number":1246,"context_line":""},{"line_number":1247,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1248,"context_line":"        cidr \u003d s.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1249,"context_line":"        prefixlen \u003d s.get(\u0027prefixlen\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1250,"context_line":"        has_cidr \u003d attributes.is_attr_set(cidr)"},{"line_number":1251,"context_line":"        has_prefixlen \u003d attributes.is_attr_set(prefixlen)"},{"line_number":1252,"context_line":""}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_c036e602","line":1249,"updated":"2015-03-30 21:19:11.000000000","message":"(please update if there is a chance of new patch set) The default value of there attributes are ATTR_NOT_SPECIFIED as defined in the attribute map. There is no need to use get(). We can simply do s[\u0027cidr\u0027].","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7eba0b921df73bcaaf8d6dffc3fedd963e0a7e98","unresolved":false,"context_lines":[{"line_number":1246,"context_line":""},{"line_number":1247,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1248,"context_line":"        cidr \u003d s.get(\u0027cidr\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1249,"context_line":"        prefixlen \u003d s.get(\u0027prefixlen\u0027, attributes.ATTR_NOT_SPECIFIED)"},{"line_number":1250,"context_line":"        has_cidr \u003d attributes.is_attr_set(cidr)"},{"line_number":1251,"context_line":"        has_prefixlen \u003d attributes.is_attr_set(prefixlen)"},{"line_number":1252,"context_line":""}],"source_content_type":"text/x-python","patch_set":60,"id":"da9b358b_ed0c353d","line":1249,"in_reply_to":"da9b358b_c036e602","updated":"2015-03-31 03:08:04.000000000","message":"Done","commit_id":"c4c5e1de5364bcce31af43c2b0501e58c82c0b68"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1eab8b5247787a748adc686d2c8c2c593899213a","unresolved":false,"context_lines":[{"line_number":1241,"context_line":"                                       s[\u0027dns_nameservers\u0027],"},{"line_number":1242,"context_line":"                                       s[\u0027host_routes\u0027],"},{"line_number":1243,"context_line":"                                       s[\u0027allocation_pools\u0027])"},{"line_number":1244,"context_line":"        if network.external:"},{"line_number":1245,"context_line":"            self._update_router_gw_ports(context,"},{"line_number":1246,"context_line":"                                         subnet[\u0027id\u0027],"},{"line_number":1247,"context_line":"                                         subnet[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":62,"id":"da9b358b_283782e4","line":1244,"updated":"2015-03-31 22:13:35.000000000","message":"Note:  I see this is where you had a conflict (replaying the rebase myself).  I also see that you\u0027ve added this here and on L1270.  That seems like the right thing to do to me.\n\nI won\u0027t ask you to reduce the code duplication here now.  This doesn\u0027t hit my threshold for demanding a refactor to reduce code duplication.","commit_id":"fb8ea72240700573e97a70597418453374fbd02f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1eab8b5247787a748adc686d2c8c2c593899213a","unresolved":false,"context_lines":[{"line_number":1267,"context_line":"                                       s[\u0027dns_nameservers\u0027],"},{"line_number":1268,"context_line":"                                       s[\u0027host_routes\u0027],"},{"line_number":1269,"context_line":"                                       s[\u0027allocation_pools\u0027])"},{"line_number":1270,"context_line":"        if network.external:"},{"line_number":1271,"context_line":"            self._update_router_gw_ports(context,"},{"line_number":1272,"context_line":"                                         subnet[\u0027id\u0027],"},{"line_number":1273,"context_line":"                                         subnet[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":62,"id":"da9b358b_680d8a36","line":1270,"updated":"2015-03-31 22:13:35.000000000","message":"Here too (L1244)","commit_id":"fb8ea72240700573e97a70597418453374fbd02f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"50ea34653afff858e17d9a4f6bb5bb20805ff92b","unresolved":false,"context_lines":[{"line_number":1499,"context_line":""},{"line_number":1500,"context_line":"    def create_subnetpool(self, context, subnetpool):"},{"line_number":1501,"context_line":"        \"\"\"Create a subnetpool\"\"\""},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"        sp \u003d subnetpool[\u0027subnetpool\u0027]"},{"line_number":1504,"context_line":"        sp_reader \u003d subnet_alloc.SubnetPoolReader(sp)"},{"line_number":1505,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, sp)"}],"source_content_type":"text/x-python","patch_set":62,"id":"da9b358b_f7785ff4","line":1502,"updated":"2015-03-31 21:39:40.000000000","message":"whitespace","commit_id":"fb8ea72240700573e97a70597418453374fbd02f"}],"neutron/db/migration/alembic_migrations/versions/268fb5e99aa2_subnetpool_allocation.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"9ceba1329af98639b3afe8dfc22ce64e61a382f6","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027subnets\u0027,"},{"line_number":34,"context_line":"                  sa.Column(\u0027subnetpool_id\u0027,"},{"line_number":35,"context_line":"                            mysql.VARCHAR(length\u003d36),"},{"line_number":36,"context_line":"                            nullable\u003dTrue,"},{"line_number":37,"context_line":"                            sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":38,"context_line":"                                                    [\u0027subnetpools.id\u0027]))))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_34ee958c","line":35,"updated":"2015-02-20 08:36:51.000000000","message":"Seems this was generated by alembic, should be sa.String(length\u003d36)","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ec2c8b3c0a6e1a675ed658618d166159f05f4163","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    op.add_column(\u0027subnets\u0027,"},{"line_number":34,"context_line":"                  sa.Column(\u0027subnetpool_id\u0027,"},{"line_number":35,"context_line":"                            mysql.VARCHAR(length\u003d36),"},{"line_number":36,"context_line":"                            nullable\u003dTrue,"},{"line_number":37,"context_line":"                            sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":38,"context_line":"                                                    [\u0027subnetpools.id\u0027]))))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_c78d7c33","line":35,"in_reply_to":"ba7be1f8_34ee958c","updated":"2015-02-20 16:32:14.000000000","message":"Yep, this is still very rough. Good catch","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"9ceba1329af98639b3afe8dfc22ce64e61a382f6","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                            mysql.VARCHAR(length\u003d36),"},{"line_number":36,"context_line":"                            nullable\u003dTrue,"},{"line_number":37,"context_line":"                            sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":38,"context_line":"                                                    [\u0027subnetpools.id\u0027]))))"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def downgrade():"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_549a2915","line":38,"updated":"2015-02-20 08:36:51.000000000","message":"Extra \u0027)\u0027 here :)","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"ec2c8b3c0a6e1a675ed658618d166159f05f4163","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                            mysql.VARCHAR(length\u003d36),"},{"line_number":36,"context_line":"                            nullable\u003dTrue,"},{"line_number":37,"context_line":"                            sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":38,"context_line":"                                                    [\u0027subnetpools.id\u0027]))))"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def downgrade():"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_277c9820","line":38,"in_reply_to":"ba7be1f8_549a2915","updated":"2015-02-20 16:32:14.000000000","message":"Doh","commit_id":"33f1700a6ded38f15f7c60998ec24655ac40bba7"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"e50ef88d36aad9e268b9345a8aa2feb6b02859bf","unresolved":false,"context_lines":[{"line_number":31,"context_line":"def upgrade():"},{"line_number":32,"context_line":"    op.add_column(\u0027subnets\u0027,"},{"line_number":33,"context_line":"                  sa.Column(\u0027subnetpool_id\u0027,"},{"line_number":34,"context_line":"                            sa.VARCHAR(length\u003d36),"},{"line_number":35,"context_line":"                            sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":36,"context_line":"                                                    [\u0027subnetpools.id\u0027]),"},{"line_number":37,"context_line":"                            nullable\u003dTrue))"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_b493c959","line":34,"updated":"2015-02-25 07:36:56.000000000","message":"not VARCHAR, String.","commit_id":"59cc16b8a058a9aed7d84cff34cbc46932aa534d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"e50ef88d36aad9e268b9345a8aa2feb6b02859bf","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                                            ondelete\u003d\u0027CASCADE\u0027))"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def downgrade():"},{"line_number":55,"context_line":"    op.add_column(\u0027subnets\u0027, \u0027subnetpool_id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_14b815c7","line":54,"updated":"2015-02-25 07:36:56.000000000","message":"table should be also dropped in downgrade","commit_id":"59cc16b8a058a9aed7d84cff34cbc46932aa534d"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"2aab91def67d1fa0db7574cbd0aadfc8a7d5012b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    op.create_table(\u0027subnetallocations\u0027,"},{"line_number":38,"context_line":"                    sa.Column(\u0027subnetpool_id\u0027,"},{"line_number":39,"context_line":"                              sa.String(length\u003d36),"},{"line_number":40,"context_line":"                              sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],"},{"line_number":41,"context_line":"                                                      [\u0027subnetpools.id\u0027]),"},{"line_number":42,"context_line":"                              nullable\u003dFalse),"},{"line_number":43,"context_line":"                    sa.Column(\u0027cidr\u0027, sa.String(44), nullable\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_40193d87","line":40,"updated":"2015-03-05 17:20:05.000000000","message":"For subnetallocations table, we need column id.\nForeignkeyConstainst can be outside of column definition.\nop.create_table(\u0027subnetallocations\u0027,\n    sa.Column(\u0027id\u0027, sa.String(length\u003d36), nullable\u003dFalse),\n    sa.Column(\u0027subnetpool_id\u0027,\n    sa.String(length\u003d36), nullable\u003dFalse),\n    sa.ForeignKeyConstraint([\u0027subnetpool_id\u0027],[\u0027subnetpools.id\u0027]),\n    sa.Column(\u0027cidr\u0027, sa.String(44), nullable\u003dFalse))","commit_id":"4fd7b313fc82c129c84c5b17095835b084b8a7b0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"Initial operations in support of subnet allocation from a pool"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: 268fb5e99aa2"},{"line_number":19,"context_line":"Revises: 51c54792158e"},{"line_number":20,"context_line":"Create Date: 2015-02-19 15:16:47.105016"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_80e0c397","line":18,"updated":"2015-03-17 13:57:04.000000000","message":"Aside:  I really don\u0027t get why we need this comment here with the same information as the code 6 lines down.  :(","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"Initial operations in support of subnet allocation from a pool"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Revision ID: 268fb5e99aa2"},{"line_number":19,"context_line":"Revises: 51c54792158e"},{"line_number":20,"context_line":"Create Date: 2015-02-19 15:16:47.105016"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_f8491833","line":18,"in_reply_to":"9a80dd14_80e0c397","updated":"2015-03-17 22:30:18.000000000","message":"Done","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"3682b52738e9e18f585a412b85c657bf9ca8d2df","unresolved":false,"context_lines":[{"line_number":24,"context_line":"import sqlalchemy as sa"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"SUBNETPOOL_FK_NAME \u003d \u0027subnetpool_id_fk\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def upgrade():"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_7f626fae","line":27,"updated":"2015-03-24 06:59:18.000000000","message":"is not used","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"14552ac907010b7caad48f4ba090cb9430610a92","unresolved":false,"context_lines":[{"line_number":24,"context_line":"import sqlalchemy as sa"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"SUBNETPOOL_FK_NAME \u003d \u0027subnetpool_id_fk\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def upgrade():"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_2f37cd4f","line":27,"in_reply_to":"1a6ced46_7f626fae","updated":"2015-03-24 17:31:47.000000000","message":"Done","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"3682b52738e9e18f585a412b85c657bf9ca8d2df","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                            index\u003dTrue))"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def downgrade():"},{"line_number":39,"context_line":"    op.drop_column(\u0027subnets\u0027, \u0027subnetpool_id\u0027)"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_5f5f73e5","line":38,"updated":"2015-03-24 06:59:18.000000000","message":"As https://review.openstack.org/165740 get merged, please remove downgrade.","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"14552ac907010b7caad48f4ba090cb9430610a92","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                            index\u003dTrue))"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"def downgrade():"},{"line_number":39,"context_line":"    op.drop_column(\u0027subnets\u0027, \u0027subnetpool_id\u0027)"}],"source_content_type":"text/x-python","patch_set":46,"id":"1a6ced46_4f3a4937","line":38,"in_reply_to":"1a6ced46_5f5f73e5","updated":"2015-03-24 17:31:47.000000000","message":"Done","commit_id":"73366183533c7cbeac10ebf0e6b626991560040d"}],"neutron/db/models_v2.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":232,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":233,"context_line":"                          nullable\u003dTrue)"},{"line_number":234,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"class SubnetPool(model_base.BASEV2, HasId, HasTenant):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_5ce7af46","line":234,"updated":"2015-03-16 23:01:34.000000000","message":"I have the feeling that seem like redundant info... is there a benefit in terms of performance for the allocator?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":12912,"name":"John Belamaric","email":"jbelamaric@infoblox.com","username":"johnbelamaric"},"change_message_id":"ed65ef1ac2e539a6c78cea4bd2d1bcea2d5631a3","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":232,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":233,"context_line":"                          nullable\u003dTrue)"},{"line_number":234,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"class SubnetPool(model_base.BASEV2, HasId, HasTenant):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_bc3eebd8","line":234,"in_reply_to":"9a80dd14_5ce7af46","updated":"2015-03-16 23:15:41.000000000","message":"+1\n\nIs this so we can delete the pool without deleting the allocated subnets? What\u0027s the use case for that? Wouldn\u0027t we just fail delete of the pool if there are allocations?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":232,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":233,"context_line":"                          nullable\u003dTrue)"},{"line_number":234,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"class SubnetPool(model_base.BASEV2, HasId, HasTenant):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_5f9961cf","line":234,"in_reply_to":"9a80dd14_5ce7af46","updated":"2015-03-16 23:34:07.000000000","message":"I\u0027d like to be able to query  subnetallocations without joining it to subnets just to get at the cidr. The same goes for tenant_id, even though it too could be derived from joining subnets.\n\nStoring subnet_id with an FK constraint serves 2 purposes:\n1. Allow for future \"auditing\" or quota features\n2. Cascading delete. This is the most important reason. I tried implementing without having the allocation delete on a cascade, and that caused a lot of problems. In some cases the allocation would never be removed, it\u0027s most problematic when you delete a network and the subnet delete cascades on the network delete. The allocation must cascade unless we perform some serious surgery outside the scope of subnet allocation.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"334791f144590e7d01da35cdc820fd7540375834","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":232,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":233,"context_line":"                          nullable\u003dTrue)"},{"line_number":234,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"class SubnetPool(model_base.BASEV2, HasId, HasTenant):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_ded613f1","line":234,"in_reply_to":"9a80dd14_5f9961cf","updated":"2015-03-17 15:07:27.000000000","message":"I was suggesting you could use a subnet itself as an allocation, thus not having to duplicate a CIDR. However, I understand this won\u0027t work smoothly when using an IPAM driver as the driver must allocate a CIDR for a subnet before the subnet is created.\n\nHowever, because I am a pedant nagger - the ID here might be removed if we give on overlappin cidrs within the pool. Just like for IP allocation we use ip_address and subnet_id as key here you could use cidr and subnetpool_id","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027subnetpools.id\u0027))"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_7f45ae6d","line":185,"updated":"2015-03-19 16:15:19.000000000","message":"(No action required)\n\nIIRC a better model relationship would be:\n\nsubnet -\u003e allocation -\u003e subnetpool.\n\nIn that case, you would deduce subnetpool from allocation that is assigned to a subnet.\n\nCurrently model relationships seem twisted.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d720e7554a0d3e67a28bfa3ce9add9ee1c9ad230","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027subnetpools.id\u0027))"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_8b45c470","line":185,"in_reply_to":"9a80dd14_7f45ae6d","updated":"2015-03-19 16:41:59.000000000","message":"Better yet, eliminate the allocation table altogether. A subnet is effectively an allocation. The subnet carries all the information we would need to track an \"allocation\"","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e2c5cde16900f121e78028635bf71ca53a74fcfe","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027subnetpools.id\u0027))"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_3a7df7b2","line":185,"in_reply_to":"9a80dd14_8b45c470","updated":"2015-03-19 21:02:47.000000000","message":"@Ihar - Thanks for bringing this up.  We need to be sure this is well thought through.  The problem with the relationship you propose is that allocations are an IPAM implementation detail.  We\u0027re trying to break out IPAM to allow plugging external IPAM.  We can\u0027t link subnets to allocations either directly or through a foreign key because of this.  The pool id is the proper link from a subnet to IPAM.  It needs to be added to the subnet.\n\n@Ryan, removing the allocations table will be ok for the near term.  We must understand that IPAM will be \"cheating\" by piggy-backing off of the subnets table for a while.  But, it removes the need to have the cascading delete relationship on L233 to which I object and allows us to deliver something that works now and can be expanded upon later; it doesn\u0027t paint us in to a corner.\n\nHere is what we need to do to follow up (in a new patch).  We need to make sure that IPAM gets an explicit call to de-allocate whenever a subnet is deleted.  That might mean that we need to break the cascade delete from networks.  Or, maybe we just add the explicit call to deallocate in the delete network path.  We need this as the minimum for Kilo so that external IPAM systems can work.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                              primary_key\u003dTrue)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"class SubnetAllocation(model_base.BASEV2, HasId, HasTenant):"},{"line_number":227,"context_line":"    \"\"\"Represents a neutron subnet allocation from a pool"},{"line_number":228,"context_line":"    \"\"\""},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_7fb5aeeb","line":226,"updated":"2015-03-19 16:15:19.000000000","message":"Do we really need tenant_id here? I think it can be easily deduced from subnetpool or subnet, isn\u0027t it?","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d720e7554a0d3e67a28bfa3ce9add9ee1c9ad230","unresolved":false,"context_lines":[{"line_number":223,"context_line":"                              primary_key\u003dTrue)"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"class SubnetAllocation(model_base.BASEV2, HasId, HasTenant):"},{"line_number":227,"context_line":"    \"\"\"Represents a neutron subnet allocation from a pool"},{"line_number":228,"context_line":"    \"\"\""},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_ab4a8824","line":226,"in_reply_to":"9a80dd14_7fb5aeeb","updated":"2015-03-19 16:41:59.000000000","message":"Joining the subnet table to do things like check quotas per tenant felt a little too indirect. The subnetpool can be shared amongst tenants, so it doesn\u0027t guarantee a single tenant_id across the pool.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e2c5cde16900f121e78028635bf71ca53a74fcfe","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":231,"context_line":"                              sa.ForeignKey(\u0027subnetpools.id\u0027),"},{"line_number":232,"context_line":"                              nullable\u003dFalse)"},{"line_number":233,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":234,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":235,"context_line":"                          nullable\u003dTrue)"},{"line_number":236,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_2e45bcb3","line":233,"updated":"2015-03-19 21:02:47.000000000","message":"I don\u0027t think that subnet_id should be referenced here.  Allocations should not be explicitly tied to a subnet like this.\n\nRemember how the current IPAM system ties individual address allocations to ports?  We\u0027re still kicking ourselves for that decision.  It led to having to create a \"port\" just to allocate an address for a floating ip.  It is expected to lead to other difficulties down the road.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"aa0f84154952277caa8595d06d0862b6f7e94f61","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":231,"context_line":"                              sa.ForeignKey(\u0027subnetpools.id\u0027),"},{"line_number":232,"context_line":"                              nullable\u003dFalse)"},{"line_number":233,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":234,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":235,"context_line":"                          nullable\u003dTrue)"},{"line_number":236,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_6463551a","line":233,"in_reply_to":"9a80dd14_2e45bcb3","updated":"2015-03-19 21:26:49.000000000","message":"Right, subnet_id is only referenced to get around an issue where deletes on networks cascade to subnets. In those cases, delete_subnet() is never invoked, so the allocator has no way of updating the allocation table. The allocation will then never be released. In newer patch sets this table is gone in favor of using the subnets table as our allocation record (a short term hack)","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bf704d61e392c8ef7a843fa1429a9c58837e5c8f","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                              nullable\u003dFalse)"},{"line_number":233,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":234,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":235,"context_line":"                          nullable\u003dTrue)"},{"line_number":236,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_9fd0a2f8","line":235,"updated":"2015-03-19 16:15:19.000000000","message":"What does an allocation with null subnet_id mean? Is it some kind of reservation to exclude some addresses from the pool? In that case, it\u0027s not really a subnet allocation, but an address allocation, isn\u0027t it?","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d720e7554a0d3e67a28bfa3ce9add9ee1c9ad230","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                              nullable\u003dFalse)"},{"line_number":233,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":234,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":235,"context_line":"                          nullable\u003dTrue)"},{"line_number":236,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_ebb48037","line":235,"in_reply_to":"9a80dd14_9fd0a2f8","updated":"2015-03-19 16:41:59.000000000","message":"It\u0027s more of a transient state as written.  It has to be nullable because we don\u0027t have a subnet_id until after we\u0027ve stored the allocation.  The allocation always has to be created before the subnet. The allocation is made, then the subnet is stored, then subnet_id is added to the allocation. I don\u0027t think it\u0027s much trouble to generate the subnet UUID up front so we can store a complete allocation.","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e2c5cde16900f121e78028635bf71ca53a74fcfe","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                              nullable\u003dFalse)"},{"line_number":233,"context_line":"    subnet_id \u003d sa.Column(sa.String(length\u003d36),"},{"line_number":234,"context_line":"                          sa.ForeignKey(\u0027subnets.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":235,"context_line":"                          nullable\u003dTrue)"},{"line_number":236,"context_line":"    cidr \u003d sa.Column(\u0027cidr\u0027, sa.String(64), nullable\u003dFalse)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9a80dd14_8e1788a2","line":235,"in_reply_to":"9a80dd14_ebb48037","updated":"2015-03-19 21:02:47.000000000","message":"See L233","commit_id":"b3f54f6751a90444edfaad7ade249675602cc9db"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fedb08b29f775ddb6d4231dc6ead3b9a79379181","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027subnetpools.id\u0027))"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a80dd14_a4562d5c","line":185,"updated":"2015-03-19 21:19:50.000000000","message":"I\u0027m not sure a foreign key makes sense here.  IPAM could be provided through an external system.","commit_id":"61587239a5931b748c3171197f064290c4fbad19"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1ea54952d999681cff3b8b6d388337f8888b258c","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027subnetpools.id\u0027))"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":42,"id":"9a80dd14_67827753","line":185,"in_reply_to":"9a80dd14_a4562d5c","updated":"2015-03-19 21:27:30.000000000","message":"Done","commit_id":"61587239a5931b748c3171197f064290c4fbad19"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"528ab0fffca3e174052e5e3902e5ee4564d58118","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), index\u003dTrue)"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_720038ab","line":185,"updated":"2015-03-29 10:06:16.000000000","message":"i do not think that this should be part of the base subnet","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1380b57585c87c873b0b8e8837a107c425c32c05","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), index\u003dTrue)"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_d802833e","line":185,"in_reply_to":"da9b358b_720038ab","updated":"2015-03-29 17:17:06.000000000","message":"It\u0027s in the spec that this would not be done as an extension.","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"6796b554b6f1756fcd8ccf0676f03b6235932c38","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    name \u003d sa.Column(sa.String(255))"},{"line_number":184,"context_line":"    network_id \u003d sa.Column(sa.String(36), sa.ForeignKey(\u0027networks.id\u0027))"},{"line_number":185,"context_line":"    subnetpool_id \u003d sa.Column(sa.String(36), index\u003dTrue)"},{"line_number":186,"context_line":"    ip_version \u003d sa.Column(sa.Integer, nullable\u003dFalse)"},{"line_number":187,"context_line":"    cidr \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":188,"context_line":"    gateway_ip \u003d sa.Column(sa.String(64))"}],"source_content_type":"text/x-python","patch_set":59,"id":"da9b358b_505871fa","line":185,"in_reply_to":"da9b358b_d802833e","updated":"2015-03-30 16:08:25.000000000","message":"@Gary, do you have a constructive suggestion or do you just want us all to know that you don\u0027t like it?","commit_id":"d102a3abf1bc39294b0d47dc29a4b260a8ba6e5f"}],"neutron/extensions/subnetallocation.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"908c59e5c53ab0eb0e77dbb2f29f149e50278b76","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        return []"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def get_extended_resources(self, version):"},{"line_number":53,"context_line":"            return {}"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_9f55b851","line":53,"updated":"2015-03-31 15:53:26.000000000","message":"nit:  too much indentation but I\u0027d hate to roll the patch just for this.","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"}],"neutron/ipam/subnet_alloc.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self._context \u003d context"},{"line_number":34,"context_line":"        self._subnetpool \u003d subnetpool"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":37,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":38,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":39,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_a7985d1c","line":36,"updated":"2015-03-11 21:25:03.000000000","message":"Note:  This isn\u0027t a very efficient implementation.  This is partially my doing.  I suggested it because this is a reference implementation.  I wanted to get something functionally correct and testable first.  Since this is an IPAM driver, we will be able to swap out implementations post-Kilo and run the same functional tests on the new implementation.  Refining this will go in to Liberty for sure.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6a949578d80e4575ed1487df37292bf1091067bf","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self._context \u003d context"},{"line_number":34,"context_line":"        self._subnetpool \u003d subnetpool"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":37,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":38,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":39,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_bc126b07","line":36,"in_reply_to":"9a80dd14_a7985d1c","updated":"2015-03-16 22:57:12.000000000","message":"We should definitely target some refinements for Liberty.  I have some thoughts about to how to make this more efficient, and I\u0027m sure you do too.  This is not really pluggable either, and we should work toward making it so.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self._subnetpool \u003d subnetpool"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":37,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":38,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":39,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"},{"line_number":40,"context_line":"        allocation_set \u003d netaddr.IPSet(iterable\u003dallocations)"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_671bc5ca","line":37,"updated":"2015-03-11 21:25:03.000000000","message":"You might consider using a generator.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":37,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":38,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":39,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"},{"line_number":40,"context_line":"        allocation_set \u003d netaddr.IPSet(iterable\u003dallocations)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_a77cddec","line":38,"updated":"2015-03-11 21:25:03.000000000","message":"ditto","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":57,"context_line":"        with self._context.session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            prefix_pool \u003d self._get_available_prefix_list()"},{"line_number":59,"context_line":"            # TODO(tidwellr) prune prefixes \u003e requested prefix length"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"},{"line_number":61,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":62,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_824d0775","line":59,"updated":"2015-03-11 21:25:03.000000000","message":"I was going to call you on this but you got it.  :)\n\nJust to be clear, bigger prefixes mean smaller networks.  That always trips someone up (I almost got tripped up myself).\n\nIf you sort from small to large (big prefixlen to small) then you just iterate until you find one that fits.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":57,"context_line":"        with self._context.session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            prefix_pool \u003d self._get_available_prefix_list()"},{"line_number":59,"context_line":"            # TODO(tidwellr) prune prefixes \u003e requested prefix length"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"},{"line_number":61,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":62,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_baad1035","line":59,"in_reply_to":"9a80dd14_35e00ecc","updated":"2015-03-16 21:53:59.000000000","message":"Is there a significant complexity difference between pruning (which I think requires the same iterating) and just iterating?\n\nDoes Python have a binary search utility?\n\nActually, since you\u0027ve just gone through a O(NlogN) sort routine, a linear iteration is nothing to worry about.  I wouldn\u0027t optimize this with a binary search.  If you find you need to optimize later, let\u0027s figure out how to optimize the part of the operation that really matters, not just optimize an insignificant part of the operation.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"408fc0b34edad88bfeb5ad91b866cd32136bd164","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":57,"context_line":"        with self._context.session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            prefix_pool \u003d self._get_available_prefix_list()"},{"line_number":59,"context_line":"            # TODO(tidwellr) prune prefixes \u003e requested prefix length"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"},{"line_number":61,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":62,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_35e00ecc","line":59,"in_reply_to":"9a80dd14_824d0775","updated":"2015-03-11 23:47:37.000000000","message":"If you look at _get_available_prefix_list(), it does exactly as you suggest. By not pruning, the downside is the potential for unnecessarily iterating over prefixes that can\u0027t support the request.  As written, this fails slowly and succeeds fast. Hence the TODO.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6a949578d80e4575ed1487df37292bf1091067bf","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":57,"context_line":"        with self._context.session.begin(subtransactions\u003dTrue):"},{"line_number":58,"context_line":"            prefix_pool \u003d self._get_available_prefix_list()"},{"line_number":59,"context_line":"            # TODO(tidwellr) prune prefixes \u003e requested prefix length"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"},{"line_number":61,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":62,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_fca943de","line":59,"in_reply_to":"9a80dd14_baad1035","updated":"2015-03-16 22:57:12.000000000","message":"This is an old TODO that should just be removed.  At one time I was simply concerned about returning a large data set and puzzling over how to put it on a diet so we can fail fast(er).  Now that I\u0027ve come this far, I also see this as an irrelevant issue.  And as you pointed out, we\u0027ve already incurred the complexity hit by sorting the the prefixes in _get_available_prefix_list().","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                    gateway_ip \u003d request.gateway_ip"},{"line_number":69,"context_line":"                    if not gateway_ip:"},{"line_number":70,"context_line":"                        return IpamSubnet(subnet.cidr,"},{"line_number":71,"context_line":"                                          gateway_ip\u003dsubnet.network + 1,"},{"line_number":72,"context_line":"                                          allocation_pools\u003dNone,"},{"line_number":73,"context_line":"                                          allocation_id\u003dsa.id)"},{"line_number":74,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_070cc941","line":71,"updated":"2015-03-11 21:25:03.000000000","message":"nit:  Only gateway_ip is different:\n\n if not gateway_ip:\n     gateway_ip \u003d subnet.network +1\n\n return IpamSubnet(subnet.cidr,\n                   gateway_ip\u003dgateway_ip,\n                   allocation_pools\u003dNone,\n                   allocation_id\u003dsa.id)","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"408fc0b34edad88bfeb5ad91b866cd32136bd164","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                    gateway_ip \u003d request.gateway_ip"},{"line_number":69,"context_line":"                    if not gateway_ip:"},{"line_number":70,"context_line":"                        return IpamSubnet(subnet.cidr,"},{"line_number":71,"context_line":"                                          gateway_ip\u003dsubnet.network + 1,"},{"line_number":72,"context_line":"                                          allocation_pools\u003dNone,"},{"line_number":73,"context_line":"                                          allocation_id\u003dsa.id)"},{"line_number":74,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_b5c4fe41","line":71,"in_reply_to":"9a80dd14_070cc941","updated":"2015-03-11 23:47:37.000000000","message":"Done","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            subnet \u003d request.subnet"},{"line_number":87,"context_line":"            available \u003d self._get_available_prefix_list()"},{"line_number":88,"context_line":"            matched \u003d netaddr.all_matching_cidrs(subnet, available)"},{"line_number":89,"context_line":"            if len(matched) is 1 and matched[0].prefixlen \u003c\u003d subnet.prefixlen:"},{"line_number":90,"context_line":"                args \u003d {\u0027id\u0027: uuidutils.generate_uuid(),"},{"line_number":91,"context_line":"                        \u0027subnetpool_id\u0027: self._subnetpool[\u0027id\u0027],"},{"line_number":92,"context_line":"                        \u0027cidr\u0027: str(request.subnet.cidr)}"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_22e29b01","line":89,"updated":"2015-03-11 21:25:03.000000000","message":"Is there some IPSet magic we can do?  Like:\n\n  if request.subnet not in available_set:\n      raise n_exc.SubnetAllocationError(...)\n\n... or something equivalent.\n\nThe code already created the IPSet inside _get_available_prefix_list.  A little refactoring could get at it.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            subnet \u003d request.subnet"},{"line_number":87,"context_line":"            available \u003d self._get_available_prefix_list()"},{"line_number":88,"context_line":"            matched \u003d netaddr.all_matching_cidrs(subnet, available)"},{"line_number":89,"context_line":"            if len(matched) is 1 and matched[0].prefixlen \u003c\u003d subnet.prefixlen:"},{"line_number":90,"context_line":"                args \u003d {\u0027id\u0027: uuidutils.generate_uuid(),"},{"line_number":91,"context_line":"                        \u0027subnetpool_id\u0027: self._subnetpool[\u0027id\u0027],"},{"line_number":92,"context_line":"                        \u0027cidr\u0027: str(request.subnet.cidr)}"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_817fc465","line":89,"in_reply_to":"9a80dd14_22e29b01","updated":"2015-03-11 21:53:58.000000000","message":"Probably. I had a specific reason for doing it this way, but I can\u0027t remember why. That probably means it needs some re-thinking :)","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"289e3b14b0d5634d2b42e4edc17be1ba3bf5be74","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Unsupported request type\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def get_subnet(self, subnet):"},{"line_number":124,"context_line":"        raise NotImplementedError()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def update_subnet(self, request):"},{"line_number":127,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_479321fa","line":124,"updated":"2015-03-11 21:25:03.000000000","message":"Needs flesh!  ;)","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c7812bc81a3894fcba6807eeb317f463e08ce0cd","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Unsupported request type\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def get_subnet(self, subnet):"},{"line_number":124,"context_line":"        raise NotImplementedError()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def update_subnet(self, request):"},{"line_number":127,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_c10d3c37","line":124,"in_reply_to":"9a80dd14_479321fa","updated":"2015-03-11 21:53:58.000000000","message":"Does this really need an implementation right now?","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fbcd1071d4afcaa47c44f6cef709d849e796667","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Unsupported request type\")"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def get_subnet(self, subnet):"},{"line_number":124,"context_line":"        raise NotImplementedError()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def update_subnet(self, request):"},{"line_number":127,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_ba519065","line":124,"in_reply_to":"9a80dd14_c10d3c37","updated":"2015-03-16 21:53:59.000000000","message":"Oh, I guess you\u0027re right.  I was actually just joking around anyway.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"408fc0b34edad88bfeb5ad91b866cd32136bd164","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        raise NotImplementedError()"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def remove_subnet(self, subnet):"},{"line_number":130,"context_line":"        # TODO(tidwellr) flesh this out"},{"line_number":131,"context_line":"        raise NotImplementedError()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"9a80dd14_15b6aadc","line":130,"updated":"2015-03-11 23:47:37.000000000","message":"I don\u0027t know if this needs flesh right now. Subnet allocations are deleted when the subnet itself is deleted. Because subnets are removed on a cascade from deleting a network, we need subnet allocations to delete on the cascade as well.  The allocation is always removed via cascade in the DB.  I\u0027m not sure fleshing this out adds much value at the moment, it won\u0027t ever be called.","commit_id":"0e123486815f6dfc52df79773d3347a2aa43f50d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"754e76b8952e0c5111989c7a4c3010127db8e743","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Unsupported request type\")"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def get_subnet(self, subnet):"},{"line_number":120,"context_line":"        raise NotImplementedError()"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def update_subnet(self, request):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_fd3d4fde","line":119,"updated":"2015-03-12 19:25:07.000000000","message":"does this match the driver\u0027s signature?","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"865b525d6429777a4a34e447dc3f360ec06c8fa7","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        else:"},{"line_number":117,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Unsupported request type\")"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def get_subnet(self, subnet):"},{"line_number":120,"context_line":"        raise NotImplementedError()"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def update_subnet(self, request):"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_53852ccd","line":119,"in_reply_to":"9a80dd14_fd3d4fde","updated":"2015-03-13 22:37:55.000000000","message":"Nope, looks like the IPAM driver interface has changed since this patch set.","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import neutron.ipam as ipam"},{"line_number":22,"context_line":"from neutron.ipam import driver"},{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"import operator"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class SubnetAllocator(driver.Pool):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_397ccdb5","line":24,"updated":"2015-03-16 23:01:34.000000000","message":"nitpick: stdlib imports should be first in the list","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import neutron.ipam as ipam"},{"line_number":22,"context_line":"from neutron.ipam import driver"},{"line_number":23,"context_line":"from neutron.openstack.common import uuidutils"},{"line_number":24,"context_line":"import operator"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class SubnetAllocator(driver.Pool):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_9fa3d9ff","line":24,"in_reply_to":"9a80dd14_397ccdb5","updated":"2015-03-16 23:34:07.000000000","message":"Done","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            available_set \u003d prefix_set"},{"line_number":46,"context_line":"        available_set.compact()"},{"line_number":47,"context_line":"        return sorted(available_set.iter_cidrs(),"},{"line_number":48,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":49,"context_line":"                      reverse\u003dTrue)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _allocate_gateway_ip(self, request):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_f9587559","line":48,"updated":"2015-03-16 23:01:34.000000000","message":"what difference is the use of operator making in terms of performance?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"acea3b11b6e4c1c16f3180e50da9a82369e4d884","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            available_set \u003d prefix_set"},{"line_number":46,"context_line":"        available_set.compact()"},{"line_number":47,"context_line":"        return sorted(available_set.iter_cidrs(),"},{"line_number":48,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":49,"context_line":"                      reverse\u003dTrue)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _allocate_gateway_ip(self, request):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_42d6eaf2","line":48,"in_reply_to":"9a80dd14_f9587559","updated":"2015-03-17 00:33:58.000000000","message":"I\u0027m not quite sure what you\u0027re asking here. The intent is to sort the available set by prefix length, and this seemed like the most elegant way to do it. Are you concerned about how this affects the performance of sorted()?","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":49,"context_line":"                      reverse\u003dTrue)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _allocate_gateway_ip(self, request):"},{"line_number":52,"context_line":"        if request.gateway_ip:"},{"line_number":53,"context_line":"            return request.gateway_ip"},{"line_number":54,"context_line":"        return request.subnet"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_7c2e33fc","line":51,"updated":"2015-03-16 23:01:34.000000000","message":"It might be just my eyes being tired but I do not see where this one is called","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"acea3b11b6e4c1c16f3180e50da9a82369e4d884","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":49,"context_line":"                      reverse\u003dTrue)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _allocate_gateway_ip(self, request):"},{"line_number":52,"context_line":"        if request.gateway_ip:"},{"line_number":53,"context_line":"            return request.gateway_ip"},{"line_number":54,"context_line":"        return request.subnet"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_625ccef1","line":51,"in_reply_to":"9a80dd14_7c2e33fc","updated":"2015-03-17 00:33:58.000000000","message":"Done","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b3863f6b29b406978c298e53547d905504b7878e","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        raise NotImplementedError()"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def get_details(self):"},{"line_number":160,"context_line":"        return self._req"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"class SubnetPoolReader(object):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_d9ad7134","line":160,"updated":"2015-03-16 23:01:34.000000000","message":"as commented on patch #134339 I think strange to have a method with returns a \"request\" instance...\n\nIt seems here indeed that IpamSubnet is a wrapper to SpecificSubnetRequest - nothing more than that, and it was created because there was a need to create a concrete representation of the abstract class driver.Subnet\n\nI wonder whether the details returned by this method would be better represented instead by attributes on the subnet object itself.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f9b5b540b67cbc0865e8caf8763f43f0994ee042","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        raise NotImplementedError()"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def get_details(self):"},{"line_number":160,"context_line":"        return self._req"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"class SubnetPoolReader(object):"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_bff6ddf7","line":160,"in_reply_to":"9a80dd14_d9ad7134","updated":"2015-03-16 23:34:07.000000000","message":"Agreed, although I\u0027m trying to conform to the IPAM API\u0027s as they exist.  I would say that we\u0027re held hostage by the API on this point.","commit_id":"ad419515326ca53ebf0063752f94072a89a609d4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self._context \u003d context"},{"line_number":35,"context_line":"        self._subnetpool \u003d subnetpool"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":38,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":39,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":40,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_d63fe185","line":37,"updated":"2015-03-17 13:57:04.000000000","message":"I\u0027m concerned that there is no way for different processes to coordinate.  As it is now, two processes allocating from the same pool will likely produce conflicting allocations.  We need to come up with some way, even if it is just locking on something across all processes (for a given pool anyway) to prevent this.  We should chat about this today if at all possible.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"35c8e3b4ac614f0e32bbdd2fd4a450dba73dbb98","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        self._context \u003d context"},{"line_number":35,"context_line":"        self._subnetpool \u003d subnetpool"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":38,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":39,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":40,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_de2a938f","line":37,"in_reply_to":"9a80dd14_d63fe185","updated":"2015-03-17 15:41:58.000000000","message":"This is trickier DB-wise than allocation pools, because overlapping CIDRS cannot be detected as primary key violations.\n\nAccess should be serialized. It is too late in the cycle to introduce distributed locks, even those abstracted out by stackforge/tooz.\n\nA locking query in _allocate_any_subnet might be a solution, but at this moment I won\u0027t know how to implement it.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"35c8e3b4ac614f0e32bbdd2fd4a450dba73dbb98","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":38,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":39,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":40,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"},{"line_number":41,"context_line":"        allocation_set \u003d netaddr.IPSet(iterable\u003dallocations)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_5e8783d7","line":39,"updated":"2015-03-17 15:41:58.000000000","message":"why the iterator?","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"a754aa6bcd3427b58598545b7ec5a19f5851889f","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _get_available_prefix_list(self):"},{"line_number":38,"context_line":"        prefixes \u003d [x for x in self._subnetpool[\u0027prefixes\u0027]]"},{"line_number":39,"context_line":"        allocations \u003d [x for x in self._subnetpool[\u0027allocations\u0027]]"},{"line_number":40,"context_line":"        prefix_set \u003d netaddr.IPSet(iterable\u003dprefixes)"},{"line_number":41,"context_line":"        allocation_set \u003d netaddr.IPSet(iterable\u003dallocations)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_d811b405","line":39,"in_reply_to":"9a80dd14_5e8783d7","updated":"2015-03-17 22:30:18.000000000","message":"In an earlier patch set I was passing the model object and needed to extract an attribute from each object. Good catch, totally unnecessary now.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fdbe241fec5daad6169cc8dba040042fb4230f21","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    def _allocate_any_subnet(self, request):"},{"line_number":53,"context_line":"        with self._context.session.begin(subtransactions\u003dTrue):"},{"line_number":54,"context_line":"            prefix_pool \u003d self._get_available_prefix_list()"},{"line_number":55,"context_line":"            # TODO(tidwellr) prune prefixes \u003e requested prefix length"},{"line_number":56,"context_line":"            for prefix in prefix_pool:"},{"line_number":57,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":58,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_1bdb627e","line":55,"updated":"2015-03-17 13:57:04.000000000","message":"I think I\u0027d remove this todo unless pruning has a functional purpose other than an attempt at optimization.  The sort dominates the complexity of all of this.  The way to optimize would be a partial sort or, better, a db level optimization.  I wouldn\u0027t worry about where to optimize yet until we have some performance data to work from.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"35c8e3b4ac614f0e32bbdd2fd4a450dba73dbb98","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                            \u0027subnetpool_id\u0027: self._subnetpool[\u0027id\u0027],"},{"line_number":61,"context_line":"                            \u0027cidr\u0027: str(subnet.cidr)}"},{"line_number":62,"context_line":"                    sa \u003d models_v2.SubnetAllocation(**args)"},{"line_number":63,"context_line":"                    self._context.session.add(sa)"},{"line_number":64,"context_line":"                    gateway_ip \u003d request.gateway_ip"},{"line_number":65,"context_line":"                    if not gateway_ip:"},{"line_number":66,"context_line":"                        gateway_ip \u003d subnet.network + 1"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_69a1f394","line":63,"updated":"2015-03-17 15:41:58.000000000","message":"Storing a database session in the object instance might be dangerous.\nThe use you make it here seems fairly safe, but this can become source of errors in the future. If it were me, I\u0027d pass the session object to each method of the allocator to avoid potential issues with transactions\u0027 scopes.","commit_id":"6b4ddd3025773fa2843ae653949bed871c04aac7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def _get_allocated_cidrs(self, session):"},{"line_number":37,"context_line":"        query \u003d session.query("},{"line_number":38,"context_line":"            models_v2.SubnetAllocation).with_lockmode(\u0027update\u0027)"},{"line_number":39,"context_line":"        allocs \u003d query.filter_by(subnetpool_id\u003dself._subnetpool[\u0027id\u0027]).all()"},{"line_number":40,"context_line":"        return (x.cidr for x in allocs)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _get_available_prefix_list(self, session):"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_2f596435","line":39,"updated":"2015-03-19 05:26:59.000000000","message":"I don\u0027t think you need .all() at the end.  I think you can just iterate over the query directly.  It looks simpler and there is an added benefit of not having to create a list to iterate over.\n\n  allocs \u003d query.filter_by(subnetpool_id\u003dself._subnetpool[\u0027id\u0027])\n  return (x.cidr for x in allocs)","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f6aa69e17913c60d60fe7e4b92bcde2c891fd63c","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def _get_allocated_cidrs(self, session):"},{"line_number":37,"context_line":"        query \u003d session.query("},{"line_number":38,"context_line":"            models_v2.SubnetAllocation).with_lockmode(\u0027update\u0027)"},{"line_number":39,"context_line":"        allocs \u003d query.filter_by(subnetpool_id\u003dself._subnetpool[\u0027id\u0027]).all()"},{"line_number":40,"context_line":"        return (x.cidr for x in allocs)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def _get_available_prefix_list(self, session):"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_2a46b27b","line":39,"in_reply_to":"9a80dd14_2f596435","updated":"2015-03-19 06:24:32.000000000","message":"Done","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                                      gateway_ip\u003dgateway_ip,"},{"line_number":77,"context_line":"                                      allocation_pools\u003dNone,"},{"line_number":78,"context_line":"                                      allocation_id\u003dsa.id)"},{"line_number":79,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Insufficient prefix space \""},{"line_number":80,"context_line":"                                                  \"to allocate subnet size /\""},{"line_number":81,"context_line":"                                                  + str(request.prefixlen))"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_4f413838","line":79,"updated":"2015-03-19 05:26:59.000000000","message":"Translation?","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f6aa69e17913c60d60fe7e4b92bcde2c891fd63c","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                                      gateway_ip\u003dgateway_ip,"},{"line_number":77,"context_line":"                                      allocation_pools\u003dNone,"},{"line_number":78,"context_line":"                                      allocation_id\u003dsa.id)"},{"line_number":79,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Insufficient prefix space \""},{"line_number":80,"context_line":"                                                  \"to allocate subnet size /\""},{"line_number":81,"context_line":"                                                  + str(request.prefixlen))"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_8519517c","line":79,"in_reply_to":"9a80dd14_4f413838","updated":"2015-03-19 06:24:32.000000000","message":"Done","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                  gateway_ip\u003drequest.gateway_ip,"},{"line_number":98,"context_line":"                                  allocation_pools\u003drequest.allocation_pools,"},{"line_number":99,"context_line":"                                  allocation_id\u003dsa.id)"},{"line_number":100,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Cannot allocate requested \""},{"line_number":101,"context_line":"                                                  \"subnet from the available \""},{"line_number":102,"context_line":"                                                  \"set of prefixes\")"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_cf2c484d","line":100,"updated":"2015-03-19 05:26:59.000000000","message":"Needs translation","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f6aa69e17913c60d60fe7e4b92bcde2c891fd63c","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                                  gateway_ip\u003drequest.gateway_ip,"},{"line_number":98,"context_line":"                                  allocation_pools\u003drequest.allocation_pools,"},{"line_number":99,"context_line":"                                  allocation_id\u003dsa.id)"},{"line_number":100,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003d\"Cannot allocate requested \""},{"line_number":101,"context_line":"                                                  \"subnet from the available \""},{"line_number":102,"context_line":"                                                  \"set of prefixes\")"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_a5165547","line":100,"in_reply_to":"9a80dd14_cf2c484d","updated":"2015-03-19 06:24:32.000000000","message":"Done","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f36504665f2345ab7f0c9560e5d1f9b1d50f8586","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                                                  \"set of prefixes\")"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def allocate_subnet(self, session, request):"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        max_prefixlen \u003d int(self._subnetpool[\u0027max_prefixlen\u0027])"},{"line_number":107,"context_line":"        min_prefixlen \u003d int(self._subnetpool[\u0027min_prefixlen\u0027])"},{"line_number":108,"context_line":"        if request.prefixlen \u003e max_prefixlen:"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_4f205849","line":105,"updated":"2015-03-19 05:26:59.000000000","message":"nit:  Extra space looks strange.","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"f6aa69e17913c60d60fe7e4b92bcde2c891fd63c","unresolved":false,"context_lines":[{"line_number":102,"context_line":"                                                  \"set of prefixes\")"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def allocate_subnet(self, session, request):"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        max_prefixlen \u003d int(self._subnetpool[\u0027max_prefixlen\u0027])"},{"line_number":107,"context_line":"        min_prefixlen \u003d int(self._subnetpool[\u0027min_prefixlen\u0027])"},{"line_number":108,"context_line":"        if request.prefixlen \u003e max_prefixlen:"}],"source_content_type":"text/x-python","patch_set":39,"id":"9a80dd14_e52bed7f","line":105,"in_reply_to":"9a80dd14_4f205849","updated":"2015-03-19 06:24:32.000000000","message":"Done","commit_id":"1d2803bfeb2ce5d7d2991660f38b50cb5520a3a6"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"9138cda95f6bbbef9a12360fed7cadc282522acc","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":55,"context_line":"                      reverse\u003dTrue)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _allocate_any_subnet(self, session, request):"},{"line_number":58,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":59,"context_line":"            prefix_pool \u003d self._get_available_prefix_list(session)"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_e120ee9b","line":57,"updated":"2015-03-20 17:46:36.000000000","message":"Ugh, I just realized that the SubnetAllocator needs account for the fact that overlapping IP\u0027s might be disallowed.  We can\u0027t just create a subnet with any CIDR, we have to check whether overlapping IP\u0027s are allowed then find a subnet not allocated. This needs more thought....","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"61896755437306e856e05c585fec4833148e35b5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                      key\u003doperator.attrgetter(\u0027prefixlen\u0027),"},{"line_number":55,"context_line":"                      reverse\u003dTrue)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _allocate_any_subnet(self, session, request):"},{"line_number":58,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":59,"context_line":"            prefix_pool \u003d self._get_available_prefix_list(session)"},{"line_number":60,"context_line":"            for prefix in prefix_pool:"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_a1c0b6e0","line":57,"in_reply_to":"9a80dd14_e120ee9b","updated":"2015-03-20 18:15:19.000000000","message":"Recent comments from Salvatore on this have got me thinking about this.  Our \"implicit\" or \"null\" pools must allow overlap for backward compatibility.  However, I think this implementation should disallow overlap.  I agree with what @Salvatore said that the \"very concept of pool clashes with the idea of having overlaps among CIDRs.\" [1]\n\nI think that this implementation should raise an exception refusing to create a pool with it set to True.  We can file a new patch to discuss the fate of the allow_overlap attribute in the API.\n\n[1] https://review.openstack.org/#/c/148698/ (last comment from Salvatore on PS48, March 16, 2015.)","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            for prefix in prefix_pool:"},{"line_number":61,"context_line":"                if request.prefixlen \u003e\u003d prefix.prefixlen:"},{"line_number":62,"context_line":"                    subnet \u003d prefix.subnet(request.prefixlen).next()"},{"line_number":63,"context_line":"                    gateway_ip \u003d request.gateway_ip"},{"line_number":64,"context_line":"                    if not gateway_ip:"},{"line_number":65,"context_line":"                        gateway_ip \u003d subnet.network + 1"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_13555df9","line":63,"updated":"2015-03-20 14:59:22.000000000","message":"So we calculate gateway_ip for any_subnet request, but not for specific one. Is it intended?","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                      subnet.cidr,"},{"line_number":70,"context_line":"                                      gateway_ip\u003dgateway_ip,"},{"line_number":71,"context_line":"                                      allocation_pools\u003dNone)"},{"line_number":72,"context_line":"            msg \u003d _(\"Insufficient prefix space to allocate subnet size /\")"},{"line_number":73,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003dmsg"},{"line_number":74,"context_line":"                                              + str(request.prefixlen))"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_50426b3e","line":72,"updated":"2015-03-20 14:59:22.000000000","message":"http://www.gnu.org/software/gettext/manual/gettext.html#Preparing-Strings\n\n\"Before strings can be marked for translations, they sometimes need to be adjusted. Usually preparing a string for translation is done right before marking it, during the marking phase which is described in the next sections. What you have to keep in mind while doing that is the following.\n\n    Decent English style.\n    Entire sentences.\n    Split at paragraphs.\n    Use format strings instead of string concatenation.\n    Avoid unusual markup and unusual control characters.\"\n\nSo don\u0027t split the message, instead, use format string.\" (%s instead of +). Some languages don\u0027t follow English word ordering, so assuming prefix length is the last thing in the message is wrong.","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":78,"context_line":"            subnet \u003d request.subnet"},{"line_number":79,"context_line":"            available \u003d self._get_available_prefix_list(session)"},{"line_number":80,"context_line":"            matched \u003d netaddr.all_matching_cidrs(subnet, available)"},{"line_number":81,"context_line":"            if len(matched) is 1 and matched[0].prefixlen \u003c\u003d subnet.prefixlen:"},{"line_number":82,"context_line":"                return IpamSubnet(request.tenant_id,"},{"line_number":83,"context_line":"                                  request.subnet_id,"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_50f98b7e","line":80,"updated":"2015-03-20 14:59:22.000000000","message":"So we calculate the whole list even if the needed prefix is at the start of available prefixes. How about instead using a for loop like:\n\nfor prefix in available:\n    if subnet in prefix:\n        return IpamSubnet()","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            subnet \u003d request.subnet"},{"line_number":79,"context_line":"            available \u003d self._get_available_prefix_list(session)"},{"line_number":80,"context_line":"            matched \u003d netaddr.all_matching_cidrs(subnet, available)"},{"line_number":81,"context_line":"            if len(matched) is 1 and matched[0].prefixlen \u003c\u003d subnet.prefixlen:"},{"line_number":82,"context_line":"                return IpamSubnet(request.tenant_id,"},{"line_number":83,"context_line":"                                  request.subnet_id,"},{"line_number":84,"context_line":"                                  subnet.cidr,"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_90aa236f","line":81,"updated":"2015-03-20 14:59:22.000000000","message":"re: \u0027is 1\u0027. I don\u0027t think we should rely on the fact that cpython reuses the same object to store small int values [1]. Instead, use \u003d\u003d.\n\n[1]: http://stackoverflow.com/questions/132988/is-there-a-difference-between-and-is-in-python (see the first number)","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                                               subnet_id,"},{"line_number":131,"context_line":"                                               cidr,"},{"line_number":132,"context_line":"                                               gateway_ip\u003dgateway_ip,"},{"line_number":133,"context_line":"                                               allocation_pools\u003dNone)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def allocate(self, address_request):"},{"line_number":136,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_d07adbef","line":133,"updated":"2015-03-20 14:59:22.000000000","message":"I guess you should actually pass the allocation_pools argument here.","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"2a55f5103d2539b34fd9c6d17f0e00a2cfdb3a89","unresolved":false,"context_lines":[{"line_number":28,"context_line":"class SubnetAllocator(driver.Pool):"},{"line_number":29,"context_line":"    \u0027\u0027\u0027Leveraging IPAM interface where possible to make merging into IPAM"},{"line_number":30,"context_line":"       framework easier in future cycles."},{"line_number":31,"context_line":"    \u0027\u0027\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def __init__(self, subnetpool):"},{"line_number":34,"context_line":"        self._subnetpool \u003d subnetpool"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_d6cf9227","line":31,"updated":"2015-03-25 12:21:41.000000000","message":"super pedant note... can you please use double quotes for docstring?\n\nCan you follow the convention to have a 1st line for summary?\nThis is not mandatory (otherwise you would have had a pep8 failure for this) but rather welcome","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"5c621be79195ba595955d2718c11f2ccb9dd2a9c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"class SubnetAllocator(driver.Pool):"},{"line_number":29,"context_line":"    \u0027\u0027\u0027Leveraging IPAM interface where possible to make merging into IPAM"},{"line_number":30,"context_line":"       framework easier in future cycles."},{"line_number":31,"context_line":"    \u0027\u0027\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def __init__(self, subnetpool):"},{"line_number":34,"context_line":"        self._subnetpool \u003d subnetpool"}],"source_content_type":"text/x-python","patch_set":52,"id":"1a6ced46_6e2a702d","line":31,"in_reply_to":"1a6ced46_d6cf9227","updated":"2015-03-25 19:47:55.000000000","message":"Done","commit_id":"e96bfb6b433c6ae1f5e79def60b8fa4f47e0ee92"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"80d19de450dfb72a11f44f2d01a9995f9c1a0c19","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                                      subnet.cidr,"},{"line_number":74,"context_line":"                                      gateway_ip\u003dgateway_ip,"},{"line_number":75,"context_line":"                                      allocation_pools\u003dNone)"},{"line_number":76,"context_line":"            msg \u003d _(\"Insufficient prefix space to allocate subnet size /\")"},{"line_number":77,"context_line":"            raise n_exc.SubnetAllocationError(msg\u003dmsg"},{"line_number":78,"context_line":"                                              + str(request.prefixlen))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":54,"id":"1a6ced46_c64c2045","line":76,"updated":"2015-03-26 04:18:44.000000000","message":"This really should use the % formatting operator.","commit_id":"423ddbe2604f626b367848e47de1b7795db9f6dd"}],"neutron/tests/unit/ipam/test_subnet_alloc.py":[{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"5e329d7dc2bac3399bd77d3a5877394461cd1961","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                     \u0027min_prefixlen\u0027: min_prefixlen,"},{"line_number":51,"context_line":"                                     \u0027max_prefixlen\u0027: max_prefixlen,"},{"line_number":52,"context_line":"                                     \u0027default_prefixlen\u0027: default_prefixlen,"},{"line_number":53,"context_line":"                                     \u0027ip_version\u0027: ip_version,"},{"line_number":54,"context_line":"                                     \u0027shared\u0027: shared,"},{"line_number":55,"context_line":"                                     \u0027allow_overlap\u0027: allow_overlap}}"},{"line_number":56,"context_line":"        return plugin.create_subnetpool(ctx, subnetpool)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_4bc85555","line":53,"updated":"2015-03-12 20:07:29.000000000","message":"The ip_version is not required. We could change ip_version to be optional.","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"865b525d6429777a4a34e447dc3f360ec06c8fa7","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                     \u0027min_prefixlen\u0027: min_prefixlen,"},{"line_number":51,"context_line":"                                     \u0027max_prefixlen\u0027: max_prefixlen,"},{"line_number":52,"context_line":"                                     \u0027default_prefixlen\u0027: default_prefixlen,"},{"line_number":53,"context_line":"                                     \u0027ip_version\u0027: ip_version,"},{"line_number":54,"context_line":"                                     \u0027shared\u0027: shared,"},{"line_number":55,"context_line":"                                     \u0027allow_overlap\u0027: allow_overlap}}"},{"line_number":56,"context_line":"        return plugin.create_subnetpool(ctx, subnetpool)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_935b2453","line":53,"in_reply_to":"9a80dd14_46adace8","updated":"2015-03-13 22:37:55.000000000","message":"ip_version is a remnant of previous patch sets. It is inferred from the prefix list, so it should not be specified and tests should still run without it. I will remove this.","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":12524,"name":"Zengfa Gao","email":"zengfa.gao@hp.com","username":"zengfagao"},"change_message_id":"04b80e973cfe453391f0c50ee267c91ab43c4865","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                                     \u0027min_prefixlen\u0027: min_prefixlen,"},{"line_number":51,"context_line":"                                     \u0027max_prefixlen\u0027: max_prefixlen,"},{"line_number":52,"context_line":"                                     \u0027default_prefixlen\u0027: default_prefixlen,"},{"line_number":53,"context_line":"                                     \u0027ip_version\u0027: ip_version,"},{"line_number":54,"context_line":"                                     \u0027shared\u0027: shared,"},{"line_number":55,"context_line":"                                     \u0027allow_overlap\u0027: allow_overlap}}"},{"line_number":56,"context_line":"        return plugin.create_subnetpool(ctx, subnetpool)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9a80dd14_46adace8","line":53,"in_reply_to":"9a80dd14_4bc85555","updated":"2015-03-12 20:21:29.000000000","message":"Sorry, the ip_version is required, but can have IPv4 cidr and ip_version\u003d6, but not in this BP.","commit_id":"985d58e735951b154abd3acb5dbe5e126f8f8100"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from neutron.common import constants"},{"line_number":20,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":21,"context_line":"from neutron import context"},{"line_number":22,"context_line":"import neutron.ipam as ipam"},{"line_number":23,"context_line":"from neutron.ipam import subnet_alloc"},{"line_number":24,"context_line":"from neutron import manager"},{"line_number":25,"context_line":"from neutron.openstack.common import uuidutils"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_70692f24","line":22,"updated":"2015-03-20 14:59:22.000000000","message":"from neutron import ipam?","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        self.assertRaises(n_exc.SubnetAllocationError,"},{"line_number":111,"context_line":"                          sa.allocate_subnet, self.ctx.session, req)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test_allocate_any_subnet_gateway(self):"},{"line_number":114,"context_line":"        sp \u003d self._create_subnet_pool(self.plugin, self.ctx, \u0027test-sp\u0027,"},{"line_number":115,"context_line":"                                      [\u002710.1.0.0/16\u0027, \u0027192.168.1.0/24\u0027],"},{"line_number":116,"context_line":"                                      21, 4)"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_70accf35","line":113,"updated":"2015-03-20 14:59:22.000000000","message":"test_allocate_any_subnet_gateway -\u003e test_allocate_any_subnet_default_gateway","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            detail \u003d res.get_details()"},{"line_number":124,"context_line":"            self.assertEqual(detail.gateway_ip, detail.subnet.network + 1)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def test_allocate_specific_subnet_specific_gateway(self):"},{"line_number":127,"context_line":"        sp \u003d self._create_subnet_pool(self.plugin, self.ctx, \u0027test-sp\u0027,"},{"line_number":128,"context_line":"                                      [\u002710.1.0.0/16\u0027, \u0027192.168.1.0/24\u0027],"},{"line_number":129,"context_line":"                                      21, 4)"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_73abf9d5","line":126,"updated":"2015-03-20 14:59:22.000000000","message":"I guess you should have test cases for gateway_ip set and unset for both request types (meaning, all four cases should be covered).","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d8fb38480dd50aa9301ad0df8f5acbfe883b48fa","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            res \u003d sa.allocate_subnet(self.ctx.session, req)"},{"line_number":137,"context_line":"            detail \u003d res.get_details()"},{"line_number":138,"context_line":"            self.assertEqual(detail.gateway_ip,"},{"line_number":139,"context_line":"                             netaddr.IPAddress(\u002710.1.2.254\u0027))"}],"source_content_type":"text/x-python","patch_set":45,"id":"9a80dd14_739219a0","line":139,"updated":"2015-03-20 14:59:22.000000000","message":"Add tests for IpamSubnet. Though it seems obvious, it looks like there is a bug there (see my comment for the class).","commit_id":"b72188f81bd6ae51347e6cde9ca64589fc00a217"}],"neutron/tests/unit/test_common_utils.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"1feba27f64d4122997bf0b26c5be9505a4879bf0","unresolved":false,"context_lines":[{"line_number":622,"context_line":"class TestIpVersionFromInt(base.BaseTestCase):"},{"line_number":623,"context_line":"    def test_ip_version_from_int_ipv4(self):"},{"line_number":624,"context_line":"        self.assertEqual(utils.ip_version_from_int(4),"},{"line_number":625,"context_line":"                         constants.IPv4)"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"    def test_ip_version_from_int_ipv6(self):"},{"line_number":628,"context_line":"        self.assertEqual(utils.ip_version_from_int(6),"}],"source_content_type":"text/x-python","patch_set":61,"id":"da9b358b_be087992","line":625,"updated":"2015-03-31 17:33:00.000000000","message":"nit: these assertEqual arguments are backwards according to other code in this file and https://bugs.launchpad.net/heat/+bug/1259292\n\nThe correct order expected by testtools is:\n        def assertEqual(self, expected, observed, message\u003d\u0027\u0027)\n\nBut PS61 is not the place to fix such things, we should do a cleanup of these and all the others in a follow-up patch.","commit_id":"2d762685e7825bf207998224d88e2e4e71421117"}]}
