)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14352,"name":"Antoni Segura Puimedon","email":"celebdor@gmail.com","username":"toni"},"change_message_id":"ea4d51cc373abc836d2b382bb0bcf1230044fb2f","unresolved":false,"context_lines":[{"line_number":13,"context_line":"trunk-create and trunk-subport-add in the generic case, allowing"},{"line_number":14,"context_line":"neutron server to choose the type and id if needed.\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The proposed change makes not mandatory to have to specify the type"},{"line_number":17,"context_line":"and the id, similarly to how IPs are selected right now when creating"},{"line_number":18,"context_line":"a port. If a segmentation_type and segmentation_id are provided, they"},{"line_number":19,"context_line":"are used as before. However, if no segmentation info is provided, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a3c09a3_e4df970a","line":16,"updated":"2017-01-18 13:16:20.000000000","message":"it","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"trunk-create and trunk-subport-add in the generic case, allowing"},{"line_number":14,"context_line":"neutron server to choose the type and id if needed.\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The proposed change makes not mandatory to have to specify the type"},{"line_number":17,"context_line":"and the id, similarly to how IPs are selected right now when creating"},{"line_number":18,"context_line":"a port. If a segmentation_type and segmentation_id are provided, they"},{"line_number":19,"context_line":"are used as before. However, if no segmentation info is provided, the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a3c09a3_d95512fa","line":16,"in_reply_to":"7a3c09a3_e4df970a","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"69b4e3effd62fef38df7e16eb5ec5332a1379f78","unresolved":false,"context_lines":[{"line_number":13,"context_line":"trunk-create and trunk-subport-add in the generic case, allowing"},{"line_number":14,"context_line":"neutron server to choose the type and id if needed.\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The proposed change makes it not mandatory to have to specify the type"},{"line_number":17,"context_line":"and the id, similarly to how IPs are selected right now when creating"},{"line_number":18,"context_line":"a port. If a segmentation_type and segmentation_id are provided, they"},{"line_number":19,"context_line":"are used as before. However, if no segmentation info is provided, the"},{"line_number":20,"context_line":"default one (in this case the only one available: vlan) is used,"},{"line_number":21,"context_line":"and an available segmentation_id within the defined interval is chosen."},{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5a3905b3_f92b3092","line":24,"range":{"start_line":16,"start_character":0,"end_line":24,"end_character":23},"updated":"2017-01-20 23:25:48.000000000","message":"This approach is problematic. See [1] for feedback.\n\n[1] https://review.openstack.org/#/c/409778/","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"6637afefbf78bd3226ab3b798575258353c2265a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"trunk-create and trunk-subport-add in the generic case, allowing"},{"line_number":14,"context_line":"neutron server to choose the type and id if needed.\""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The proposed change makes it not mandatory to have to specify the type"},{"line_number":17,"context_line":"and the id, similarly to how IPs are selected right now when creating"},{"line_number":18,"context_line":"a port. If a segmentation_type and segmentation_id are provided, they"},{"line_number":19,"context_line":"are used as before. However, if no segmentation info is provided, the"},{"line_number":20,"context_line":"default one (in this case the only one available: vlan) is used,"},{"line_number":21,"context_line":"and an available segmentation_id within the defined interval is chosen."},{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"5a3905b3_d8eaa9da","line":24,"range":{"start_line":16,"start_character":0,"end_line":24,"end_character":23},"in_reply_to":"5a3905b3_f92b3092","updated":"2017-01-23 16:58:46.000000000","message":"Could you elaborate a bit more on this? I\u0027m not sure about the TrunkPort support for Ironic, but that should be a different issue, right? As far as I know (at least for non-ironic case), the vlan id is just local to the OVS-TrunkPort, and it is not related to the actual vlan id used for the Neutron subnets (or vxlan or whatever segmentation being used). Not sure how this is handled in Ironic.\n\nOn the other hand, you mention I should reference this bug: \nhttps://bugs.launchpad.net/neutron/+bug/1648129\n\nBut that is about including Ironic support, right? Should I include this one instead? https://bugs.launchpad.net/neutron/+bug/1649531","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"63dbf056f49d3ba63cb2a8f6a6f417d3d56df7c1","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I093e1cc1b6ba2b8227ecbe9a8cb57f57096252f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7ffa3b31_0c45cab3","line":25,"updated":"2017-04-14 23:25:27.000000000","message":"It is a change from what was released in Newton and Ocata. We need an APIImpact and a new extension so users can tell ahead of time by looking at the extension list if the server will require them to specify the details.","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a8af8325d47cff6017ef219a233416804a29a887","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I093e1cc1b6ba2b8227ecbe9a8cb57f57096252f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a30ddce_a047d949","line":25,"updated":"2017-03-08 14:25:47.000000000","message":"This is a change in the API and behavior. Please have an APIImpact flag here. Please also add a release note","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"cd01edab0b84b15e19156cfb3ada17d725181226","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I093e1cc1b6ba2b8227ecbe9a8cb57f57096252f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7ffa3b31_b178f4c3","line":25,"in_reply_to":"7ffa3b31_0c45cab3","updated":"2017-04-20 07:31:49.000000000","message":"I still don\u0027t see why this is an API change. This takes the same parameters as before and it will work just like in Newton and Ocata if the seg-type and seg-id are passed. The only different is that it fixes the gap between the current implementation and what is described in the spec, where it is said that they are not mandatory","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I093e1cc1b6ba2b8227ecbe9a8cb57f57096252f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3f4b6375_b2ac63ed","line":25,"in_reply_to":"7ffa3b31_b178f4c3","updated":"2017-11-02 22:01:41.000000000","message":"As per our own spec and api-ref, those attributes are optional: https://developer.openstack.org/api-ref/network/v2/index.html#trunk-networking I don\u0027t think we need an extension for a bug in implementation we have. (Besides, other implementations besides our own service plugin may have the use case covered already since it was always documented that way.)\n\nThat being said, I think we should still add APIImpact here, and DocImpact to update https://developer.openstack.org/api-ref/network/v2/index.html#trunk-networking error code list with a new case for an error.\n\nAlso a release note would make sense, since it\u0027s a micro-feature.","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ae770825d02bcbef22e073ee25bf3b43a4bb1913","unresolved":false,"context_lines":[{"line_number":22,"context_line":"Note there is a random shuffle among the available segmentation"},{"line_number":23,"context_line":"ids to reduce collision probability as well as to speed up the"},{"line_number":24,"context_line":"segmentation_id search."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[1] https://specs.openstack.org/openstack/neutron-specs/specs/newton/vlan-aware-vms.html#proposed-change"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: I093e1cc1b6ba2b8227ecbe9a8cb57f57096252f4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a30ddce_20b849e5","line":25,"in_reply_to":"9a30ddce_a047d949","updated":"2017-03-08 14:37:40.000000000","message":"This is not changing the API. And it is not changing the behavior, but rather making it behaving as it is described in the spec:\n\"SEGMENTATION-TYPE and SEGMENTATION-ID are optional in both trunk-create and trunk-subport-add in the generic case, allowing neutron server to choose the type and id if needed.\"","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"}],"neutron/services/trunk/constants.py":[{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"8e35cec43d86bc43da01bcf28fc98f738b917bcc","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"},{"line_number":85,"context_line":"MIN_SEG_ID \u003d 1"},{"line_number":86,"context_line":"MAX_SEG_ID \u003d 4094"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_64b3a798","line":86,"range":{"start_line":85,"start_character":0,"end_line":86,"end_character":17},"updated":"2017-01-18 14:30:23.000000000","message":"why not use neutron constants?https://github.com/openstack/neutron/blob/master/neutron/plugins/common/constants.py#L80","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"},{"line_number":85,"context_line":"MIN_SEG_ID \u003d 1"},{"line_number":86,"context_line":"MAX_SEG_ID \u003d 4094"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_5ee4a8aa","line":86,"range":{"start_line":85,"start_character":0,"end_line":86,"end_character":17},"in_reply_to":"7a3c09a3_64b3a798","updated":"2017-01-18 19:41:36.000000000","message":"Right now there is only vlan seg_driver, but in the future there could be others, so this seg_id min and max may not be the same as max/min vlan ids","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"62e4e7c69473aea61e4324e6ad03ae0478a999f6","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"},{"line_number":85,"context_line":"MIN_SEG_ID \u003d 1"},{"line_number":86,"context_line":"MAX_SEG_ID \u003d 4094"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a3905b3_f6c9f1ad","line":85,"updated":"2017-01-19 06:15:42.000000000","message":"I think this should be seg. type specific values","commit_id":"381c38352a3b1af3b127a322f9bf14530de8ffbe"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":81,"context_line":"VLAN \u003d \u0027vlan\u0027"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_f27f7b63","line":84,"range":{"start_line":84,"start_character":19,"end_line":84,"end_character":25},"updated":"2017-11-02 22:01:41.000000000","message":"I guess semantically it better point to VLAN constant if we already have it.","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"a8af8325d47cff6017ef219a233416804a29a887","unresolved":false,"context_lines":[{"line_number":81,"context_line":"VLAN \u003d \u0027vlan\u0027"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a30ddce_e002b108","line":84,"range":{"start_line":84,"start_character":8,"end_line":84,"end_character":11},"updated":"2017-03-08 14:25:47.000000000","message":"can we use SEGMENTATION here?","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ae770825d02bcbef22e073ee25bf3b43a4bb1913","unresolved":false,"context_lines":[{"line_number":81,"context_line":"VLAN \u003d \u0027vlan\u0027"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Default segmentation type if not provided"},{"line_number":84,"context_line":"DEFAULT_SEG_TYPE \u003d \u0027vlan\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a30ddce_00ac259f","line":84,"range":{"start_line":84,"start_character":8,"end_line":84,"end_character":11},"in_reply_to":"9a30ddce_e002b108","updated":"2017-03-08 14:37:40.000000000","message":"Yes, I\u0027ll update this","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"}],"neutron/services/trunk/plugin.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"51deeb649151738b9a267930a2f3c08260218de9","unresolved":false,"context_lines":[{"line_number":290,"context_line":"            for subport in subports:"},{"line_number":291,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_84d973f5","line":293,"range":{"start_line":293,"start_character":56,"end_line":293,"end_character":57},"updated":"2017-01-18 13:18:42.000000000","message":"Parenthesis () are usually used in Neutron codebase for wrapping long lines","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":290,"context_line":"            for subport in subports:"},{"line_number":291,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_3938d6d2","line":293,"range":{"start_line":293,"start_character":56,"end_line":293,"end_character":57},"in_reply_to":"7a3c09a3_84d973f5","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":14352,"name":"Antoni Segura Puimedon","email":"celebdor@gmail.com","username":"toni"},"change_message_id":"ea4d51cc373abc836d2b382bb0bcf1230044fb2f","unresolved":false,"context_lines":[{"line_number":290,"context_line":"            for subport in subports:"},{"line_number":291,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"},{"line_number":297,"context_line":"            subports_validator \u003d rules.SubPortsValidator("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_846b331d","line":294,"range":{"start_line":293,"start_character":16,"end_line":294,"end_character":78},"updated":"2017-01-18 13:16:20.000000000","message":"Parenthesis are preferred over end-of-line escaping.","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":290,"context_line":"            for subport in subports:"},{"line_number":291,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"},{"line_number":297,"context_line":"            subports_validator \u003d rules.SubPortsValidator("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_5933e2f5","line":294,"range":{"start_line":293,"start_character":16,"end_line":294,"end_character":78},"in_reply_to":"7a3c09a3_846b331d","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"51deeb649151738b9a267930a2f3c08260218de9","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"},{"line_number":297,"context_line":"            subports_validator \u003d rules.SubPortsValidator("},{"line_number":298,"context_line":"                self._segmentation_types, subports, trunk[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_57e01f29","line":295,"range":{"start_line":295,"start_character":54,"end_line":295,"end_character":65},"updated":"2017-01-18 13:18:42.000000000","message":"Doesn\u0027t it introduce a race where two API requests for add_subports is called? Both APIs call get_subports() on L397 and both pick the same seg_id as the result from one API won\u0027t be reflected to the second API.","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":292,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":293,"context_line":"                if \u0027segmentation_id\u0027 not in subport and \\"},{"line_number":294,"context_line":"                   subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_id\u0027] \u003d self._get_seg_id(context,"},{"line_number":296,"context_line":"                                                                  trunk_id)"},{"line_number":297,"context_line":"            subports_validator \u003d rules.SubPortsValidator("},{"line_number":298,"context_line":"                self._segmentation_types, subports, trunk[\u0027port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_39c29685","line":295,"range":{"start_line":295,"start_character":54,"end_line":295,"end_character":65},"in_reply_to":"7a3c09a3_57e01f29","updated":"2017-01-18 19:41:36.000000000","message":"Same as if the user chooses the same vlan id, right? The next SubPortValidator calls should detected, otherwise the race is already there. That said, I will think about how to modify get_seg_id so that it returns a different value.","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"51deeb649151738b9a267930a2f3c08260218de9","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        return trunk"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def _get_seg_id(self, context, trunk_id):"},{"line_number":394,"context_line":"        seg_ids \u003d [x for x in range(constants.MIN_SEG_ID,"},{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_04502331","line":394,"range":{"start_line":394,"start_character":8,"end_line":394,"end_character":15},"updated":"2017-01-18 13:18:42.000000000","message":"This is a constant and you make a list-comprehension here from another list :)","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        return trunk"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    def _get_seg_id(self, context, trunk_id):"},{"line_number":394,"context_line":"        seg_ids \u003d [x for x in range(constants.MIN_SEG_ID,"},{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_f4d2d3cf","line":394,"range":{"start_line":394,"start_character":8,"end_line":394,"end_character":15},"in_reply_to":"7a3c09a3_04502331","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":14352,"name":"Antoni Segura Puimedon","email":"celebdor@gmail.com","username":"toni"},"change_message_id":"ea4d51cc373abc836d2b382bb0bcf1230044fb2f","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"},{"line_number":398,"context_line":"        subports_ids \u003d [x[\u0027segmentation_id\u0027] for x in subports[\u0027sub_ports\u0027]]"},{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_44b86b75","line":398,"updated":"2017-01-18 13:16:20.000000000","message":"Better make it with a set so the \u0027if seg_id not in subports_ids\u0027 check goes better when there\u0027s a lot of subports.\n\n    subports_ids \u003d frozenset(x[\u0027segmentation_id\u0027] for x in subports[\u0027sub_ports\u0027])","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"51deeb649151738b9a267930a2f3c08260218de9","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"},{"line_number":398,"context_line":"        subports_ids \u003d [x[\u0027segmentation_id\u0027] for x in subports[\u0027sub_ports\u0027]]"},{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_b72ea389","line":398,"range":{"start_line":398,"start_character":8,"end_line":398,"end_character":76},"updated":"2017-01-18 13:18:42.000000000","message":"You can use set difference to get unused value:\n\n SEG_IDS_RANGE \u003d set(range(min, max+1))\n \n ...\n\n def _get_seg_id():\n     subports \u003d self.get_subports()\n     subport_ids \u003d {int(x[\u0027segmentation_id\u0027]) for x in subports[\u0027sub_ports\u0027]}\n     if subport_ids:\n         return random.choice(list(subport_ids))","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"},{"line_number":398,"context_line":"        subports_ids \u003d [x[\u0027segmentation_id\u0027] for x in subports[\u0027sub_ports\u0027]]"},{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_94c98f28","line":398,"in_reply_to":"7a3c09a3_44b86b75","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":395,"context_line":"                                    constants.MAX_SEG_ID + 1)]"},{"line_number":396,"context_line":"        shuffle(seg_ids)"},{"line_number":397,"context_line":"        subports \u003d self.get_subports(context, trunk_id)"},{"line_number":398,"context_line":"        subports_ids \u003d [x[\u0027segmentation_id\u0027] for x in subports[\u0027sub_ports\u0027]]"},{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_b4cccb35","line":398,"range":{"start_line":398,"start_character":8,"end_line":398,"end_character":76},"in_reply_to":"7a3c09a3_b72ea389","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"51deeb649151738b9a267930a2f3c08260218de9","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"},{"line_number":402,"context_line":"        return None"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    @db_base_plugin_common.filter_fields"},{"line_number":405,"context_line":"    def get_subports(self, context, trunk_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_84009335","line":402,"range":{"start_line":402,"start_character":0,"end_line":402,"end_character":19},"updated":"2017-01-18 13:18:42.000000000","message":"This is implicit","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"dc939a1c6fe5b81631888caf4c0aba7fd02bcbc4","unresolved":false,"context_lines":[{"line_number":399,"context_line":"        for seg_id in seg_ids:"},{"line_number":400,"context_line":"            if seg_id not in subports_ids:"},{"line_number":401,"context_line":"                return seg_id"},{"line_number":402,"context_line":"        return None"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"    @db_base_plugin_common.filter_fields"},{"line_number":405,"context_line":"    def get_subports(self, context, trunk_id, fields\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_194eba3a","line":402,"range":{"start_line":402,"start_character":0,"end_line":402,"end_character":19},"in_reply_to":"7a3c09a3_84009335","updated":"2017-01-18 19:41:36.000000000","message":"Done","commit_id":"560227397f1540c9caec4a179bf24115c913e915"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"21b812d11a1758d6dbe73add834aa01a736e9741","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            # automatically validated by the API layer."},{"line_number":292,"context_line":"            subports \u003d subports[\u0027sub_ports\u0027]"},{"line_number":293,"context_line":"            for subport in subports:"},{"line_number":294,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":296,"context_line":"                if (subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE"},{"line_number":297,"context_line":"                    and \u0027segmentation_id\u0027 not in subport):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a3905b3_15fe666b","line":294,"updated":"2017-01-19 11:33:44.000000000","message":"I think this behavior should be configurable, because maybe back-end is expecting to be the one to manage seg. type and ids.\nSo we actually have 3 cases:\n1. User (caller or neutron API) manages seg. type and ids\n2. Neutron\n3. Neutron back-end.\nWith current patch 3rd case is not possible.","commit_id":"b018ebdafd3dd135328722113326da910d41106d"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"14757fca032b2d32aabdf055ed579592dd726109","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            # automatically validated by the API layer."},{"line_number":292,"context_line":"            subports \u003d subports[\u0027sub_ports\u0027]"},{"line_number":293,"context_line":"            for subport in subports:"},{"line_number":294,"context_line":"                if \u0027segmentation_type\u0027 not in subport:"},{"line_number":295,"context_line":"                    subport[\u0027segmentation_type\u0027] \u003d constants.DEFAULT_SEG_TYPE"},{"line_number":296,"context_line":"                if (subport[\u0027segmentation_type\u0027] \u003d\u003d constants.DEFAULT_SEG_TYPE"},{"line_number":297,"context_line":"                    and \u0027segmentation_id\u0027 not in subport):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a3905b3_f9b7d9f2","line":294,"in_reply_to":"5a3905b3_15fe666b","updated":"2017-01-20 09:10:24.000000000","message":"Kind of agree with you, but maybe that could be handled in a follow up patch. So far only 1 is supported (while the spec says, at least, 2 should be supported). This patch adds support for 2. And a follow up patch could address the 3rd point","commit_id":"b018ebdafd3dd135328722113326da910d41106d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b36c4fbe1ad12bcb22a19f3d45bd0c32902ea651","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5a3905b3_540a4b22","line":404,"updated":"2017-01-20 23:27:45.000000000","message":"this approach won\u0027t work to support Ironic.","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1436478f39ba45eb9ddd72ff14c53cffb5d43177","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_e5da91e7","line":404,"in_reply_to":"5a3905b3_152f9ca1","updated":"2017-02-22 21:22:17.000000000","message":"Now it is with [1]. That aside, I think we\u0027d want to move this logic into the SubPortsValidator class as the plugin is not really supposed to know about segmentation details. However, the problem I see with this approach is that in case of multiple active replicas of neutron servers we may end up hitting a DB duplicate entry error, which is not retried. That makes me slightly reluctant to accept this logic, but let\u0027s talk at the PTG if you\u0027re around. I think I can still be swayed on taking this code.\n\n[1] https://review.openstack.org/#/c/436756/","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"6637afefbf78bd3226ab3b798575258353c2265a","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5a3905b3_152f9ca1","line":404,"in_reply_to":"5a3905b3_540a4b22","updated":"2017-01-23 16:58:46.000000000","message":"But is TrunkPorts supported at all in Ironic?","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f517aef7da7bfd58a91d950e3858e3e45054cb30","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_ba97c238","line":404,"in_reply_to":"da36d5c6_b0f52b58","updated":"2017-02-23 12:54:17.000000000","message":"I suppose we can argue both ways. In fact, one can assume that a subport without segmentation details is indeed invalid, and the validator\u0027s job is to sanitize the submitted request.\n\nAgain, I am not convinced the logic is robust enough to deal with contention. Besides, making a DB lookup for every subport in the request to determine an available segmentation ID does not sound particularly efficient especially when a request is adding 1000s of subports.","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9b87e9b49d9f21144f55a9c7a466da2db78e8a0c","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_153fc124","line":404,"in_reply_to":"da36d5c6_b5db554e","updated":"2017-02-23 13:39:25.000000000","message":"Adding 1000s is not unrealistic at all, especially in NFV-driven use cases. Pulling IDs once will only increase the chance for collision, wouldn\u0027t it?","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"6e2ad0fe39e43c9557b553b5ae8f60e51af53684","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_b5db554e","line":404,"in_reply_to":"da36d5c6_ba97c238","updated":"2017-02-23 13:30:35.000000000","message":"Yep, I agree this could be also moved to SubPortValidator. That should not be a big issue.\n\nAs for the other comment, adding 1000s subports at once does not sound realistic, and in such a case, it will be much worse to have to manually select the vlan_ids. That said, I can modify this patch so that it only makes one call to get the available_ids for all the subports.","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"47d68a32b766741a0ed6a26629170169faba79bb","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        subports_ids \u003d frozenset({int(x[\u0027segmentation_id\u0027]) for x in"},{"line_number":402,"context_line":"                        subports[\u0027sub_ports\u0027]})"},{"line_number":403,"context_line":"        # Get the ids not in used"},{"line_number":404,"context_line":"        available_ids \u003d subports_ids.symmetric_difference(SEG_IDS_RANGE)"},{"line_number":405,"context_line":"        if available_ids:"},{"line_number":406,"context_line":"            return choice(list(available_ids))"},{"line_number":407,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_b0f52b58","line":404,"in_reply_to":"da36d5c6_e5da91e7","updated":"2017-02-23 08:29:43.000000000","message":"Unfortunately, I\u0027m not at the PTG :(\n\nAs regards to your comment. This patch is not to validate the subports, but to ensure the two missing fields (seg_id and seg_type) that are supposed to be optional are filled before the SubPortsValidator, i.e., ensuring the validation does not fail due to not having the optional parameters. This actually does not know about segmentation details, it just call get_subports to get the current status (the ids in use for the target trunk), and choose (randomly) one within the available range. That should limit the chances of getting the same id even with several neutron servers.","commit_id":"35bea96095279f0b4a9606fee4ac4656d0d2aef6"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                            constants.DEFAULT_SEG_TYPE)"},{"line_number":302,"context_line":"                        and \u0027segmentation_id\u0027 not in subport):"},{"line_number":303,"context_line":"                        if available_seg_ids is None:"},{"line_number":304,"context_line":"                            available_seg_ids \u003d self._get_available_seg_ids("},{"line_number":305,"context_line":"                                context, trunk_id, len(subports))"},{"line_number":306,"context_line":"                        if available_seg_ids:"},{"line_number":307,"context_line":"                            sanitized_port_seg_ids[subport[\u0027port_id\u0027]] \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_12e457df","line":304,"updated":"2017-11-02 22:01:41.000000000","message":"this will return IDs that are in db, but what about some subports that may have been passed with IDs, while others weren\u0027t? Wouldn\u0027t it leave opportunity for a clash on same ID used, one passed via API, another as seen based on database inspection?","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                               segmentation_id\u003dsubport[\u0027segmentation_id\u0027])"},{"line_number":342,"context_line":"                    try:"},{"line_number":343,"context_line":"                        obj.create()"},{"line_number":344,"context_line":"                    except trunk_exc.DuplicateSubPort:"},{"line_number":345,"context_line":"                        if sanitized_port_seg_ids.get(subport[\u0027port_id\u0027]):"},{"line_number":346,"context_line":"                            retry_subports.append(subport)"},{"line_number":347,"context_line":"                            continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_72bf0baa","line":344,"updated":"2017-11-02 22:01:41.000000000","message":"it\u0027s probably a silly question, but in which case one would get the error? we seem to maintain transaction context through the flow, so IDs fetched in line 304 should not clash with anything else being created in parallel; and line 435 guarantees that IDs used for unspecified subports don\u0027t clash with other subports.","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                    try:"},{"line_number":343,"context_line":"                        obj.create()"},{"line_number":344,"context_line":"                    except trunk_exc.DuplicateSubPort:"},{"line_number":345,"context_line":"                        if sanitized_port_seg_ids.get(subport[\u0027port_id\u0027]):"},{"line_number":346,"context_line":"                            retry_subports.append(subport)"},{"line_number":347,"context_line":"                            continue"},{"line_number":348,"context_line":"                        raise"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_52076f83","line":345,"range":{"start_line":345,"start_character":27,"end_line":345,"end_character":73},"updated":"2017-11-02 22:01:41.000000000","message":"I don\u0027t see a place where any key in sanitized_port_seg_ids is set to something that would not be False in boolean context. (the only place we set it is line 307, and we set it to an empty string there).","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"}],"neutron/tests/tempest/api/test_trunk.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9e57ff5a9908444acaf1a55d25f8daef0f1c7a3","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        self.assertEqual(1, len(observed_subports))"},{"line_number":166,"context_line":"        created_subport \u003d observed_subports[0]"},{"line_number":167,"context_line":"        self.assertEqual(subports[0], created_subport)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @decorators.idempotent_id(\u002788bae178-04cf-4eb4-a972-4cf295bf584f\u0027)"},{"line_number":170,"context_line":"    def test_add_subport_without_seg_info(self):"},{"line_number":171,"context_line":"        trunk \u003d self._create_trunk_with_network_and_parent([])"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f4b6375_d2fa3f73","line":168,"updated":"2017-11-02 22:01:41.000000000","message":"please add a test case for mixed payload - some subports with IDs, some without.\n\nanother test case that may reveal some bugs would be creating a port with subports for each vlan tag possible. it may potentially reveal some off-by-one/edge case bugs in the patch.","commit_id":"3e0d99bc5c78c97190139c5a71869d1f94768de3"}]}
