)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"241bc0cecf8a0c07414e96b9bdc57653ce34d34d","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Add net \u0026 utils methods for routed nets \u0026 segments"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Before adding a prefilter, we need to add new methods for asking Neutron"},{"line_number":10,"context_line":"about the related aggregates we need to ask Placement if the user creates"},{"line_number":11,"context_line":"or moves an instance with a requested network or a port."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"NOTE(sbauza): Given we need to lookup at segments by neutronclient, let\u0027s"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"3927fd92_46a27cd9","line":10,"updated":"2021-02-18 12:03:04.000000000","message":"super nit: wrap at 72 chars?","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add net \u0026 utils methods for routed nets \u0026 segments"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Before adding a prefilter, we need to add new methods for asking Neutron"},{"line_number":10,"context_line":"about the related aggregates we need to ask Placement if the user creates"},{"line_number":11,"context_line":"or moves an instance with a requested network or a port."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"NOTE(sbauza): Given we need to lookup at segments by neutronclient, let\u0027s"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"e06a107d_1ca00193","line":10,"in_reply_to":"3927fd92_46a27cd9","updated":"2021-02-18 14:12:05.000000000","message":"Ack","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"}],"nova/exception.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":769,"context_line":"    msg_fmt \u003d _(\"Physical network is missing for network %(network_uuid)s\")"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"64651a1b_6ba90e8f","line":772,"range":{"start_line":772,"start_character":40,"end_line":772,"end_character":53},"updated":"2021-02-17 14:22:25.000000000","message":"/me notes to check that we\u0027re handling this properly\n\nLater: We\u0027re not. You\u0027ve documented that this can be raised at [1], but we only handle \u0027RequestFilterFailed\u0027 [2]. afaict, this will mean an end user will see a HTTP 500 if the request fails\n\n[1] https://review.opendev.org/c/openstack/nova/+/749068/16/nova/scheduler/request_filter.py#287\n[2] https://github.com/openstack/nova/blob/2e8d87098c9b714cf347dfe1ffdd9cbca3175c1a/nova/scheduler/manager.py#L150","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":769,"context_line":"    msg_fmt \u003d _(\"Physical network is missing for network %(network_uuid)s\")"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"0d186453_6f4f5159","line":772,"range":{"start_line":772,"start_character":40,"end_line":772,"end_character":53},"in_reply_to":"64651a1b_6ba90e8f","updated":"2021-02-17 18:18:41.000000000","message":"Excellent catch, thanks !","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ac35d309_234613c6","line":773,"range":{"start_line":773,"start_character":68,"end_line":773,"end_character":69},"updated":"2021-02-17 14:22:25.000000000","message":"drop","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"73dda123f3a7a5d27f5fc205bc80040aa91b995b","unresolved":true,"context_lines":[{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"876d5d53_fe85d642","line":773,"range":{"start_line":773,"start_character":55,"end_line":773,"end_character":60},"updated":"2021-02-17 12:07:20.000000000","message":"so much confidence :D","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"c0a2b638_5eba2435","line":773,"range":{"start_line":773,"start_character":55,"end_line":773,"end_character":60},"in_reply_to":"876d5d53_fe85d642","updated":"2021-02-17 14:22:25.000000000","message":"Yes, let\u0027s replace this with \"is\" 😊","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"30411e1b_35492cb3","line":773,"range":{"start_line":773,"start_character":68,"end_line":773,"end_character":69},"in_reply_to":"ac35d309_234613c6","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"class InvalidRoutedNetworkConfiguration(NovaException):"},{"line_number":773,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration seems invalid : \""},{"line_number":774,"context_line":"                \"%(reason)s.\")"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"a0ca646b_af57d6f6","line":773,"range":{"start_line":773,"start_character":55,"end_line":773,"end_character":60},"in_reply_to":"c0a2b638_5eba2435","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"241bc0cecf8a0c07414e96b9bdc57653ce34d34d","unresolved":true,"context_lines":[{"line_number":1195,"context_line":"    msg_fmt \u003d _(\"Scheduling failed: %(reason)s\")"},{"line_number":1196,"context_line":""},{"line_number":1197,"context_line":""},{"line_number":1198,"context_line":"class InvalidRoutedNetworkConfiguration(RequestFilterFailed):"},{"line_number":1199,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration is invalid: \""},{"line_number":1200,"context_line":"                \"%(reason)s.\")"},{"line_number":1201,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"c0ae0100_fae5f735","line":1198,"updated":"2021-02-18 12:03:04.000000000","message":"This seems a bit weird. The only place that raises this is in \u0027nova.network.neutron\u0027 but you\u0027re raising a scheduler-specific exception. IMO it would be better to use a network-specific exception (or the generic \u0027NovaException\u0027 you were previously using) and simply catch and reraise it in the scheduler code","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":true,"context_lines":[{"line_number":1195,"context_line":"    msg_fmt \u003d _(\"Scheduling failed: %(reason)s\")"},{"line_number":1196,"context_line":""},{"line_number":1197,"context_line":""},{"line_number":1198,"context_line":"class InvalidRoutedNetworkConfiguration(RequestFilterFailed):"},{"line_number":1199,"context_line":"    msg_fmt \u003d _(\"Neutron routed networks configuration is invalid: \""},{"line_number":1200,"context_line":"                \"%(reason)s.\")"},{"line_number":1201,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"b6acdb79_8b71a6a3","line":1198,"in_reply_to":"c0ae0100_fae5f735","updated":"2021-02-18 14:12:05.000000000","message":"No, we also raise it in the scheduler.utils module https://review.opendev.org/c/openstack/nova/+/773976/7/nova/scheduler/utils.py#1370","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"}],"nova/network/constants.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ea66e3e28ad53fb3d0ff83e86b7155d81ce6d970","unresolved":true,"context_lines":[{"line_number":29,"context_line":"L3_NETWORK_TYPES \u003d [\u0027vxlan\u0027, \u0027gre\u0027, \u0027geneve\u0027]"},{"line_number":30,"context_line":"ALLOCATION \u003d \u0027allocation\u0027"},{"line_number":31,"context_line":"RESOURCE_REQUEST \u003d \u0027resource_request\u0027"},{"line_number":32,"context_line":"SEGMENT \u003d \u0027segment\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"1af79b7e_c0efd870","line":32,"updated":"2021-02-19 11:00:21.000000000","message":"This seems wrong. Looking at the self.segments value in the neutron.py in my devstack (with turned on segments service_plugin) I see this as \"Segment\". http://paste.openstack.org/show/802810/","commit_id":"60e20632f93edbf104c0cd2f03a2931aad3721c5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"18aa27ae222d57989feb5e48f061f30ceaf695d3","unresolved":false,"context_lines":[{"line_number":29,"context_line":"L3_NETWORK_TYPES \u003d [\u0027vxlan\u0027, \u0027gre\u0027, \u0027geneve\u0027]"},{"line_number":30,"context_line":"ALLOCATION \u003d \u0027allocation\u0027"},{"line_number":31,"context_line":"RESOURCE_REQUEST \u003d \u0027resource_request\u0027"},{"line_number":32,"context_line":"SEGMENT \u003d \u0027segment\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"141e7f2b_e15ad028","line":32,"in_reply_to":"1af79b7e_c0efd870","updated":"2021-02-19 14:50:24.000000000","message":"Ack","commit_id":"60e20632f93edbf104c0cd2f03a2931aad3721c5"}],"nova/network/neutron.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":3494,"context_line":"        :param context: The request context."},{"line_number":3495,"context_line":"        :param network_id: The UUID of the network to be queried"},{"line_number":3496,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3497,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3498,"context_line":"        \"\"\""},{"line_number":3499,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3500,"context_line":"            client \u003d _get_ksa_client(context, admin\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"95c574af_91f14f14","line":3497,"range":{"start_line":3497,"start_character":45,"end_line":3497,"end_character":55},"updated":"2021-02-08 10:46:01.000000000","message":"isn\u0027t enabled","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":3494,"context_line":"        :param context: The request context."},{"line_number":3495,"context_line":"        :param network_id: The UUID of the network to be queried"},{"line_number":3496,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3497,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3498,"context_line":"        \"\"\""},{"line_number":3499,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3500,"context_line":"            client \u003d _get_ksa_client(context, admin\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"85bef981_c8278b17","line":3497,"range":{"start_line":3497,"start_character":45,"end_line":3497,"end_character":55},"in_reply_to":"95c574af_91f14f14","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":3528,"context_line":""},{"line_number":3529,"context_line":"        :param context: The request context."},{"line_number":3530,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3531,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3532,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3533,"context_line":"        \"\"\""},{"line_number":3534,"context_line":"        if self._has_segment_extension(context):"}],"source_content_type":"text/x-python","patch_set":2,"id":"6bf8245d_5e9dc1a1","line":3531,"range":{"start_line":3531,"start_character":51,"end_line":3531,"end_character":58},"updated":"2021-02-08 10:46:01.000000000","message":"subnet","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":3528,"context_line":""},{"line_number":3529,"context_line":"        :param context: The request context."},{"line_number":3530,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3531,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3532,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3533,"context_line":"        \"\"\""},{"line_number":3534,"context_line":"        if self._has_segment_extension(context):"}],"source_content_type":"text/x-python","patch_set":2,"id":"d472faa5_538cab90","line":3531,"range":{"start_line":3531,"start_character":51,"end_line":3531,"end_character":58},"in_reply_to":"6bf8245d_5e9dc1a1","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":3529,"context_line":"        :param context: The request context."},{"line_number":3530,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3531,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3532,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3533,"context_line":"        \"\"\""},{"line_number":3534,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3535,"context_line":"            client \u003d get_client(context)"}],"source_content_type":"text/x-python","patch_set":2,"id":"58e2cef0_a844f3f3","line":3532,"range":{"start_line":3532,"start_character":45,"end_line":3532,"end_character":56},"updated":"2021-02-08 10:46:01.000000000","message":"isn\u0027t enabled","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":3529,"context_line":"        :param context: The request context."},{"line_number":3530,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3531,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3532,"context_line":"            Multi Provider Network extension is enabled in Neutron."},{"line_number":3533,"context_line":"        \"\"\""},{"line_number":3534,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3535,"context_line":"            client \u003d get_client(context)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3e64c64f_89e56703","line":3532,"range":{"start_line":3532,"start_character":45,"end_line":3532,"end_character":56},"in_reply_to":"58e2cef0_a844f3f3","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f30a6595e0ce5118d8520f6238d52bca0e0b293b","unresolved":true,"context_lines":[{"line_number":3523,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3524,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3525,"context_line":""},{"line_number":3526,"context_line":"    def get_segment_ids_for_subnet(self, context, subnet_id):"},{"line_number":3527,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3528,"context_line":""},{"line_number":3529,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":3,"id":"74379515_b7547f98","line":3526,"range":{"start_line":3526,"start_character":8,"end_line":3526,"end_character":34},"updated":"2021-02-09 02:54:56.000000000","message":"this should be singualar.\n\nget_setment_id_by_subnet.","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"38efa8d1ae7b5a8083fd6dd0a63c587a0471829d","unresolved":false,"context_lines":[{"line_number":3523,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3524,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3525,"context_line":""},{"line_number":3526,"context_line":"    def get_segment_ids_for_subnet(self, context, subnet_id):"},{"line_number":3527,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3528,"context_line":""},{"line_number":3529,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":3,"id":"8c9fc211_88192ed8","line":3526,"range":{"start_line":3526,"start_character":8,"end_line":3526,"end_character":34},"in_reply_to":"74379515_b7547f98","updated":"2021-02-09 09:09:10.000000000","message":"Ack","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f30a6595e0ce5118d8520f6238d52bca0e0b293b","unresolved":true,"context_lines":[{"line_number":3540,"context_line":"                    \u0027Subnet %s not found\u0027 % subnet_id)"},{"line_number":3541,"context_line":"            if \u0027segment_id\u0027 in subnet:"},{"line_number":3542,"context_line":"                return [subnet[\u0027segment_id\u0027]]"},{"line_number":3543,"context_line":"            raise exception.NovaException("},{"line_number":3544,"context_line":"                \u0027Failed to get segment ID for subnet %s\u0027 % subnet_id)"},{"line_number":3545,"context_line":"        else:"},{"line_number":3546,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":3,"id":"c0c5997a_ccd0204b","line":3543,"range":{"start_line":3543,"start_character":0,"end_line":3543,"end_character":3},"updated":"2021-02-09 02:54:56.000000000","message":"i dont know if this is correct. just because neuton has the segments extention dose not me all networks are routed.\nso i dont know if all subnets will have a segment id in that case.\nwe might want to retrun none here\n\n\ndid you check what neutron does in this case?","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"38efa8d1ae7b5a8083fd6dd0a63c587a0471829d","unresolved":false,"context_lines":[{"line_number":3540,"context_line":"                    \u0027Subnet %s not found\u0027 % subnet_id)"},{"line_number":3541,"context_line":"            if \u0027segment_id\u0027 in subnet:"},{"line_number":3542,"context_line":"                return [subnet[\u0027segment_id\u0027]]"},{"line_number":3543,"context_line":"            raise exception.NovaException("},{"line_number":3544,"context_line":"                \u0027Failed to get segment ID for subnet %s\u0027 % subnet_id)"},{"line_number":3545,"context_line":"        else:"},{"line_number":3546,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":3,"id":"bab238ee_84ae58a4","line":3543,"range":{"start_line":3543,"start_character":0,"end_line":3543,"end_character":3},"in_reply_to":"c0c5997a_ccd0204b","updated":"2021-02-09 09:09:10.000000000","message":"as discussed on IRC, I\u0027ll return None instead.","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f30a6595e0ce5118d8520f6238d52bca0e0b293b","unresolved":true,"context_lines":[{"line_number":3543,"context_line":"            raise exception.NovaException("},{"line_number":3544,"context_line":"                \u0027Failed to get segment ID for subnet %s\u0027 % subnet_id)"},{"line_number":3545,"context_line":"        else:"},{"line_number":3546,"context_line":"            return []"},{"line_number":3547,"context_line":""},{"line_number":3548,"context_line":""},{"line_number":3549,"context_line":"def _ensure_requested_network_ordering(accessor, unordered, preferred):"}],"source_content_type":"text/x-python","patch_set":3,"id":"b85d5e1e_364835df","line":3546,"range":{"start_line":3546,"start_character":19,"end_line":3546,"end_character":21},"updated":"2021-02-09 02:54:56.000000000","message":"this should really be None not a list since a subnet will only have 1 segment unlike a network which can have many.\nwe can have may subnets per segment but only 1 segment per subnet.","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"38efa8d1ae7b5a8083fd6dd0a63c587a0471829d","unresolved":false,"context_lines":[{"line_number":3543,"context_line":"            raise exception.NovaException("},{"line_number":3544,"context_line":"                \u0027Failed to get segment ID for subnet %s\u0027 % subnet_id)"},{"line_number":3545,"context_line":"        else:"},{"line_number":3546,"context_line":"            return []"},{"line_number":3547,"context_line":""},{"line_number":3548,"context_line":""},{"line_number":3549,"context_line":"def _ensure_requested_network_ordering(accessor, unordered, preferred):"}],"source_content_type":"text/x-python","patch_set":3,"id":"4f781508_b2b0c9e5","line":3546,"range":{"start_line":3546,"start_character":19,"end_line":3546,"end_character":21},"in_reply_to":"b85d5e1e_364835df","updated":"2021-02-09 09:09:10.000000000","message":"Ack","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3488,"context_line":"                                  \u0027for port %s.\u0027,"},{"line_number":3489,"context_line":"                                  vif[\u0027id\u0027], instance\u003dinstance)"},{"line_number":3490,"context_line":""},{"line_number":3491,"context_line":"    def get_segment_ids_for_network(self, context, network_id):"},{"line_number":3492,"context_line":"        \"\"\"Query the segmentation ids for the given network."},{"line_number":3493,"context_line":""},{"line_number":3494,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":5,"id":"0e38757f_8716db93","line":3491,"range":{"start_line":3491,"start_character":36,"end_line":3491,"end_character":61},"updated":"2021-02-09 17:59:50.000000000","message":"Type hints would be nice and would save me having to add them myself later. I think\n\n  def get_segment_ids_for_network(\n      self,\n      context: nova_context.RequestContext,\n      network_id: str,\n  ) -\u003e ty.List[str]:\n\nought to do the trick","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3488,"context_line":"                                  \u0027for port %s.\u0027,"},{"line_number":3489,"context_line":"                                  vif[\u0027id\u0027], instance\u003dinstance)"},{"line_number":3490,"context_line":""},{"line_number":3491,"context_line":"    def get_segment_ids_for_network(self, context, network_id):"},{"line_number":3492,"context_line":"        \"\"\"Query the segmentation ids for the given network."},{"line_number":3493,"context_line":""},{"line_number":3494,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":5,"id":"294260ab_e6b5aa82","line":3491,"range":{"start_line":3491,"start_character":36,"end_line":3491,"end_character":61},"in_reply_to":"0e38757f_8716db93","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3497,"context_line":"            either Multi Provider Network extension isn\u0027t enabled in Neutron or"},{"line_number":3498,"context_line":"            if the network isn\u0027t configured for routing."},{"line_number":3499,"context_line":"        \"\"\""},{"line_number":3500,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3501,"context_line":"            client \u003d _get_ksa_client(context, admin\u003dTrue)"},{"line_number":3502,"context_line":"            resp \u003d self._get_segment_ids_for_network("},{"line_number":3503,"context_line":"                context, client, network_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"66bb505a_cc413ace","line":3500,"updated":"2021-02-09 17:59:50.000000000","message":"nit:\n\n  if not self._has_segment_extension(context):\n      return []\n\n  client \u003d ...","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3497,"context_line":"            either Multi Provider Network extension isn\u0027t enabled in Neutron or"},{"line_number":3498,"context_line":"            if the network isn\u0027t configured for routing."},{"line_number":3499,"context_line":"        \"\"\""},{"line_number":3500,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3501,"context_line":"            client \u003d _get_ksa_client(context, admin\u003dTrue)"},{"line_number":3502,"context_line":"            resp \u003d self._get_segment_ids_for_network("},{"line_number":3503,"context_line":"                context, client, network_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"4417f118_2bf7fb43","line":3500,"in_reply_to":"66bb505a_cc413ace","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3512,"context_line":"        return []"},{"line_number":3513,"context_line":""},{"line_number":3514,"context_line":"    @staticmethod"},{"line_number":3515,"context_line":"    def _get_segment_ids_for_network(context, client, network_id):"},{"line_number":3516,"context_line":"        \"\"\"Queries the list of segment ids for a network"},{"line_number":3517,"context_line":""},{"line_number":3518,"context_line":"        :param context: The request context for the operation."}],"source_content_type":"text/x-python","patch_set":5,"id":"5668573a_6bb3fab7","line":3515,"updated":"2021-02-09 17:59:50.000000000","message":"Type hints? I think:\n\n  def _get_segment_ids_for_network(\n      context: nova_context.RequestContext,\n      client: keystoneauth1.adapter.Adapter,\n      network_id,\n  ) -\u003e ty.Dict[str, ty.Any]:\n\nwill do here, though perhaps we should adjust that per below.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3512,"context_line":"        return []"},{"line_number":3513,"context_line":""},{"line_number":3514,"context_line":"    @staticmethod"},{"line_number":3515,"context_line":"    def _get_segment_ids_for_network(context, client, network_id):"},{"line_number":3516,"context_line":"        \"\"\"Queries the list of segment ids for a network"},{"line_number":3517,"context_line":""},{"line_number":3518,"context_line":"        :param context: The request context for the operation."}],"source_content_type":"text/x-python","patch_set":5,"id":"7b0e5f69_781dd974","line":3515,"in_reply_to":"5668573a_6bb3fab7","updated":"2021-02-12 13:53:13.000000000","message":"I won\u0027t add those since this private method will be deleted.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3522,"context_line":"        \"\"\""},{"line_number":3523,"context_line":"        return client.get("},{"line_number":3524,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3525,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3526,"context_line":""},{"line_number":3527,"context_line":"    def get_segment_id_for_subnet(self, context, subnet_id):"},{"line_number":3528,"context_line":"        \"\"\"Query the segmentation id for the given subnet."}],"source_content_type":"text/x-python","patch_set":5,"id":"c2b1cdb9_4c21e1d2","line":3525,"updated":"2021-02-09 17:59:50.000000000","message":"neutronclient supports this and has done so since I85b8e7b3fb84e7e9fd133edffc300a83eeb7c56d so we really should offload to them.\n\n  neutron_client.list_segments(network_id\u003dnetwork_id, fields\u003d\u0027id\u0027)\n\nshould do the trick?","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3522,"context_line":"        \"\"\""},{"line_number":3523,"context_line":"        return client.get("},{"line_number":3524,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3525,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3526,"context_line":""},{"line_number":3527,"context_line":"    def get_segment_id_for_subnet(self, context, subnet_id):"},{"line_number":3528,"context_line":"        \"\"\"Query the segmentation id for the given subnet."}],"source_content_type":"text/x-python","patch_set":5,"id":"3e7f84ca_1af59d3b","line":3525,"in_reply_to":"c2b1cdb9_4c21e1d2","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3524,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3525,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3526,"context_line":""},{"line_number":3527,"context_line":"    def get_segment_id_for_subnet(self, context, subnet_id):"},{"line_number":3528,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3529,"context_line":""},{"line_number":3530,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":5,"id":"ef710c8e_eb378e3b","line":3527,"updated":"2021-02-09 17:59:50.000000000","message":"type hints?","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3524,"context_line":"            \u0027/v2.0/segments?network_id\u003d%s\u0026fields\u003did\u0027 % network_id,"},{"line_number":3525,"context_line":"            raise_exc\u003dFalse, global_request_id\u003dcontext.global_id)"},{"line_number":3526,"context_line":""},{"line_number":3527,"context_line":"    def get_segment_id_for_subnet(self, context, subnet_id):"},{"line_number":3528,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3529,"context_line":""},{"line_number":3530,"context_line":"        :param context: The request context."}],"source_content_type":"text/x-python","patch_set":5,"id":"8537e0c1_67e08647","line":3527,"in_reply_to":"ef710c8e_eb378e3b","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":3534,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"},{"line_number":3535,"context_line":"            configured for routing)"},{"line_number":3536,"context_line":"        \"\"\""},{"line_number":3537,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3538,"context_line":"            client \u003d get_client(context)"},{"line_number":3539,"context_line":"            try:"},{"line_number":3540,"context_line":"                subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"958a202c_de1e014f","line":3537,"updated":"2021-02-09 17:59:50.000000000","message":"nit:\n\n  if not self._has_segment_extension(context):\n      return None","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":3534,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"},{"line_number":3535,"context_line":"            configured for routing)"},{"line_number":3536,"context_line":"        \"\"\""},{"line_number":3537,"context_line":"        if self._has_segment_extension(context):"},{"line_number":3538,"context_line":"            client \u003d get_client(context)"},{"line_number":3539,"context_line":"            try:"},{"line_number":3540,"context_line":"                subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"c510a521_7170147f","line":3537,"in_reply_to":"958a202c_de1e014f","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":3497,"context_line":"        \"\"\"Query the segmentation ids for the given network."},{"line_number":3498,"context_line":""},{"line_number":3499,"context_line":"        :param context: The request context."},{"line_number":3500,"context_line":"        :param network_id: The UUID of the network to be queried"},{"line_number":3501,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3502,"context_line":"            either Multi Provider Network extension isn\u0027t enabled in Neutron or"},{"line_number":3503,"context_line":"            if the network isn\u0027t configured for routing."}],"source_content_type":"text/x-python","patch_set":6,"id":"e89bc51b_e00db3fc","line":3500,"updated":"2021-02-17 14:22:25.000000000","message":"nit: trailing full stop","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":3497,"context_line":"        \"\"\"Query the segmentation ids for the given network."},{"line_number":3498,"context_line":""},{"line_number":3499,"context_line":"        :param context: The request context."},{"line_number":3500,"context_line":"        :param network_id: The UUID of the network to be queried"},{"line_number":3501,"context_line":"        :returns: The list of segment UUIDs of the network or an empty list if"},{"line_number":3502,"context_line":"            either Multi Provider Network extension isn\u0027t enabled in Neutron or"},{"line_number":3503,"context_line":"            if the network isn\u0027t configured for routing."}],"source_content_type":"text/x-python","patch_set":6,"id":"3c910312_f44d047c","line":3500,"in_reply_to":"e89bc51b_e00db3fc","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"73dda123f3a7a5d27f5fc205bc80040aa91b995b","unresolved":true,"context_lines":[{"line_number":3510,"context_line":"                                            fields\u003d\u0027id\u0027)[\u0027segments\u0027]"},{"line_number":3511,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":3512,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3513,"context_line":"                \u0027Failed to get segment IDs for network %s\u0027 % network_id)"},{"line_number":3514,"context_line":"        # The segment list could be empty for an unconfigured network"},{"line_number":3515,"context_line":"        return [segment[\u0027id\u0027] for segment in segments]"},{"line_number":3516,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fc724581_c3580c27","line":3513,"updated":"2021-02-17 12:07:20.000000000","message":"I would chain the NeutronClientException to the new InvalidRoutedNetworkConfiguration so that it will be visible in the log what error Neutron returned to us. \n\nI.e.: \n    \n        except neutron_client_exc.NeutronClientException as e:\n            raise exception.InvalidRoutedNetworkConfiguration(\n                \u0027Failed to get segment IDs for network %s\u0027 % network_id) from e\n\nThis can be done in a follow up","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":3510,"context_line":"                                            fields\u003d\u0027id\u0027)[\u0027segments\u0027]"},{"line_number":3511,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":3512,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3513,"context_line":"                \u0027Failed to get segment IDs for network %s\u0027 % network_id)"},{"line_number":3514,"context_line":"        # The segment list could be empty for an unconfigured network"},{"line_number":3515,"context_line":"        return [segment[\u0027id\u0027] for segment in segments]"},{"line_number":3516,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"430fcd1e_72833caf","line":3513,"in_reply_to":"45f034a3_d1bb74b2","updated":"2021-02-17 18:18:41.000000000","message":"Well, I usually hate to use py3-only PEPs but here I\u0027m enough lazy to not argue and do what you want (just remember that we have other way to do exception chaining in OpenStack that is both respectful for py2 and py3)","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":3510,"context_line":"                                            fields\u003d\u0027id\u0027)[\u0027segments\u0027]"},{"line_number":3511,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":3512,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3513,"context_line":"                \u0027Failed to get segment IDs for network %s\u0027 % network_id)"},{"line_number":3514,"context_line":"        # The segment list could be empty for an unconfigured network"},{"line_number":3515,"context_line":"        return [segment[\u0027id\u0027] for segment in segments]"},{"line_number":3516,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"45f034a3_d1bb74b2","line":3513,"in_reply_to":"fc724581_c3580c27","updated":"2021-02-17 14:22:25.000000000","message":"+1\n\n\u003c3 Python 3","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":3522,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3523,"context_line":""},{"line_number":3524,"context_line":"        :param context: The request context."},{"line_number":3525,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3526,"context_line":"        :returns: The segment UUID of the subnet or None if either"},{"line_number":3527,"context_line":"            Multi Provider Network extension isn\u0027t enabled in Neutron or the"},{"line_number":3528,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"}],"source_content_type":"text/x-python","patch_set":6,"id":"c4ece04e_06f915e3","line":3525,"range":{"start_line":3525,"start_character":15,"end_line":3525,"end_character":22},"updated":"2021-02-17 14:22:25.000000000","message":"subnet. Also trailing full stop","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":3522,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3523,"context_line":""},{"line_number":3524,"context_line":"        :param context: The request context."},{"line_number":3525,"context_line":"        :param network_id: The UUID of the subnet to be queried"},{"line_number":3526,"context_line":"        :returns: The segment UUID of the subnet or None if either"},{"line_number":3527,"context_line":"            Multi Provider Network extension isn\u0027t enabled in Neutron or the"},{"line_number":3528,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"}],"source_content_type":"text/x-python","patch_set":6,"id":"188f7c04_0ad02256","line":3525,"range":{"start_line":3525,"start_character":15,"end_line":3525,"end_character":22},"in_reply_to":"c4ece04e_06f915e3","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"73dda123f3a7a5d27f5fc205bc80040aa91b995b","unresolved":true,"context_lines":[{"line_number":3529,"context_line":"            configured for routing)"},{"line_number":3530,"context_line":"        \"\"\""},{"line_number":3531,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3532,"context_line":"            return"},{"line_number":3533,"context_line":"        client \u003d get_client(context)"},{"line_number":3534,"context_line":"        try:"},{"line_number":3535,"context_line":"            subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"22a342bd_6e44ee0a","line":3532,"updated":"2021-02-17 12:07:20.000000000","message":"This should be a mypy error. The signature states we always return a string but it returns None here.\n\nLater: ohh you have to add network/neutron.py to the mypy-files.txt in the root of the repot to trigger mypy on this file","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":3529,"context_line":"            configured for routing)"},{"line_number":3530,"context_line":"        \"\"\""},{"line_number":3531,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3532,"context_line":"            return"},{"line_number":3533,"context_line":"        client \u003d get_client(context)"},{"line_number":3534,"context_line":"        try:"},{"line_number":3535,"context_line":"            subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"c0bf84da_06340f15","line":3532,"in_reply_to":"22a342bd_6e44ee0a","updated":"2021-02-17 14:22:25.000000000","message":"I\u0027d also add a newline after this","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":3529,"context_line":"            configured for routing)"},{"line_number":3530,"context_line":"        \"\"\""},{"line_number":3531,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3532,"context_line":"            return"},{"line_number":3533,"context_line":"        client \u003d get_client(context)"},{"line_number":3534,"context_line":"        try:"},{"line_number":3535,"context_line":"            subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"829f8874_37f42775","line":3532,"in_reply_to":"c0bf84da_06340f15","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"73dda123f3a7a5d27f5fc205bc80040aa91b995b","unresolved":true,"context_lines":[{"line_number":3534,"context_line":"        try:"},{"line_number":3535,"context_line":"            subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"},{"line_number":3536,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":3537,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3538,"context_line":"                \u0027Subnet %s not found\u0027 % subnet_id)"},{"line_number":3539,"context_line":"        if \u0027segment_id\u0027 in subnet:"},{"line_number":3540,"context_line":"            return subnet[\u0027segment_id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"1fc3bbd2_aa014d85","line":3537,"updated":"2021-02-17 12:07:20.000000000","message":"I would chain this to the original exception in a follow up","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":3534,"context_line":"        try:"},{"line_number":3535,"context_line":"            subnet \u003d client.show_subnet(subnet_id)[\u0027subnet\u0027]"},{"line_number":3536,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":3537,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3538,"context_line":"                \u0027Subnet %s not found\u0027 % subnet_id)"},{"line_number":3539,"context_line":"        if \u0027segment_id\u0027 in subnet:"},{"line_number":3540,"context_line":"            return subnet[\u0027segment_id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"90a2baa5_b91ffd8b","line":3537,"in_reply_to":"1fc3bbd2_aa014d85","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c240305ee541692382e907b5d8abbbb32b007d44","unresolved":true,"context_lines":[{"line_number":1250,"context_line":"        self._refresh_neutron_extensions_cache(context)"},{"line_number":1251,"context_line":"        return constants.SUBSTR_PORT_FILTERING in self.extensions"},{"line_number":1252,"context_line":""},{"line_number":1253,"context_line":"    def _has_segment_extension(self, context, neutron\u003dNone):"},{"line_number":1254,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dneutron)"},{"line_number":1255,"context_line":"        return constants.SEGMENT in self.extensions"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"09e81906_02a393b2","line":1253,"updated":"2021-02-18 12:03:44.000000000","message":"you know, type hints would be lovely here\n\n/me hides 😉","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":true,"context_lines":[{"line_number":1250,"context_line":"        self._refresh_neutron_extensions_cache(context)"},{"line_number":1251,"context_line":"        return constants.SUBSTR_PORT_FILTERING in self.extensions"},{"line_number":1252,"context_line":""},{"line_number":1253,"context_line":"    def _has_segment_extension(self, context, neutron\u003dNone):"},{"line_number":1254,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dneutron)"},{"line_number":1255,"context_line":"        return constants.SEGMENT in self.extensions"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"6e37494a_b2c655c2","line":1253,"in_reply_to":"09e81906_02a393b2","updated":"2021-02-18 14:12:05.000000000","message":"Sure... But it\u0027s not the only one method looking at extensions ;)","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"241bc0cecf8a0c07414e96b9bdc57653ce34d34d","unresolved":true,"context_lines":[{"line_number":3523,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3524,"context_line":""},{"line_number":3525,"context_line":"        :param context: The request context."},{"line_number":3526,"context_line":"        :param network_id: The UUID of the subnet to be queried."},{"line_number":3527,"context_line":"        :returns: The segment UUID of the subnet or None if either"},{"line_number":3528,"context_line":"            Multi Provider Network extension isn\u0027t enabled in Neutron or the"},{"line_number":3529,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"}],"source_content_type":"text/x-python","patch_set":7,"id":"b5276577_f1fc674c","line":3526,"range":{"start_line":3526,"start_character":15,"end_line":3526,"end_character":22},"updated":"2021-02-18 12:03:04.000000000","message":"Missed this one. \u0027subnet_id\u0027","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":false,"context_lines":[{"line_number":3523,"context_line":"        \"\"\"Query the segmentation id for the given subnet."},{"line_number":3524,"context_line":""},{"line_number":3525,"context_line":"        :param context: The request context."},{"line_number":3526,"context_line":"        :param network_id: The UUID of the subnet to be queried."},{"line_number":3527,"context_line":"        :returns: The segment UUID of the subnet or None if either"},{"line_number":3528,"context_line":"            Multi Provider Network extension isn\u0027t enabled in Neutron or the"},{"line_number":3529,"context_line":"            provided subnet doesn\u0027t have segments (if the related network isn\u0027t"}],"source_content_type":"text/x-python","patch_set":7,"id":"214e97ed_f9e3e9fb","line":3526,"range":{"start_line":3526,"start_character":15,"end_line":3526,"end_character":22},"in_reply_to":"b5276577_f1fc674c","updated":"2021-02-18 14:12:05.000000000","message":"Ack","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"241bc0cecf8a0c07414e96b9bdc57653ce34d34d","unresolved":true,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"43753b10_08bb600a","line":3533,"updated":"2021-02-18 12:03:04.000000000","message":"Missed this one too. \u0027return None\u0027","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":true,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"97492eae_bdf558a6","line":3533,"in_reply_to":"43753b10_08bb600a","updated":"2021-02-18 14:12:05.000000000","message":"Well, isn\u0027t it the same ? I mean, \"return\" returns a None, right ?","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":true,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"e33e2c69_c59ec3de","line":3533,"in_reply_to":"43753b10_08bb600a","updated":"2021-02-18 14:12:05.000000000","message":"Well, isn\u0027t it the same ? I mean, \"return\" returns a None, right ?\n\n  \u003e\u003e\u003e def meth():\n  ...     return\n  ... \n  \u003e\u003e\u003e None is meth()\n  True","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":true,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"a475d983_4018a5da","line":3533,"in_reply_to":"43753b10_08bb600a","updated":"2021-02-18 14:12:05.000000000","message":"Well, isn\u0027t it the same ? I mean, \"return\" returns a None, right ?\n\n\u003e\u003e\u003e def meth():\n...     return\n... \n\u003e\u003e\u003e None is meth()\nTrue","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fd300910e2e506f2a9ac315dcb6d986647e50a0","unresolved":false,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"514a47d0_410cc26c","line":3533,"in_reply_to":"d4362050_f39dd33f","updated":"2021-02-18 15:07:03.000000000","message":"Gosh, I can\u0027t publicly say how much I hate those sorts of opiniated answers from the mypy developers (although I loudly expressed my concerns in the nova IRC channel) but if that prevents my code to merge, fair enough, I\u0027ll need to stick with it ( and I hate this situation)","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"9fe76af607fdd1d5963bd9066c379c4976883fcb","unresolved":true,"context_lines":[{"line_number":3530,"context_line":"            configured for routing)"},{"line_number":3531,"context_line":"        \"\"\""},{"line_number":3532,"context_line":"        if not self._has_segment_extension(context):"},{"line_number":3533,"context_line":"            return"},{"line_number":3534,"context_line":""},{"line_number":3535,"context_line":"        client \u003d get_client(context)"},{"line_number":3536,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"d4362050_f39dd33f","line":3533,"in_reply_to":"e33e2c69_c59ec3de","updated":"2021-02-18 14:18:06.000000000","message":"Not for mypy. I know you think this is daft and so do I tbh, but the mypy devs consider it a code smell [1] so we\u0027re stuck with it. fwiw, there is at least some merit to their argument, since implicit None returns can mask accidental return paths (i.e. you forgot an else in an if-elif chain) and also the \"explicit is better than implicit\" thing from zen of Python\n\n[1] https://github.com/python/mypy/issues/7511","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"241bc0cecf8a0c07414e96b9bdc57653ce34d34d","unresolved":true,"context_lines":[{"line_number":3539,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3540,"context_line":"                \u0027Subnet %s not found\u0027 % subnet_id) from e"},{"line_number":3541,"context_line":"        if \u0027segment_id\u0027 in subnet:"},{"line_number":3542,"context_line":"            return subnet[\u0027segment_id\u0027]"},{"line_number":3543,"context_line":""},{"line_number":3544,"context_line":""},{"line_number":3545,"context_line":"def _ensure_requested_network_ordering(accessor, unordered, preferred):"}],"source_content_type":"text/x-python","patch_set":7,"id":"39380cae_24396b21","line":3542,"updated":"2021-02-18 12:03:04.000000000","message":"nit:\n\n  return subnet.get(\u0027segment_id\u0027)\n\n(keeps mypy happy too since this will explicitly return None)","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8f79c8b3e046606b13fa2a080410ba6ead001bf2","unresolved":false,"context_lines":[{"line_number":3539,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3540,"context_line":"                \u0027Subnet %s not found\u0027 % subnet_id) from e"},{"line_number":3541,"context_line":"        if \u0027segment_id\u0027 in subnet:"},{"line_number":3542,"context_line":"            return subnet[\u0027segment_id\u0027]"},{"line_number":3543,"context_line":""},{"line_number":3544,"context_line":""},{"line_number":3545,"context_line":"def _ensure_requested_network_ordering(accessor, unordered, preferred):"}],"source_content_type":"text/x-python","patch_set":7,"id":"69252ae5_c1fe5aa3","line":3542,"in_reply_to":"39380cae_24396b21","updated":"2021-02-18 14:12:05.000000000","message":"Ack","commit_id":"5bbc20b406def77bce38fb7f689382dd2e419924"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bc634f4579c2bb6ba3c7d056850af5ab88b21f69","unresolved":true,"context_lines":[{"line_number":1231,"context_line":"            self.extensions.clear()"},{"line_number":1232,"context_line":"            self.extensions \u003d {ext[\u0027name\u0027]: ext for ext in extensions_list}"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"    def _has_multi_provider_extension(self, context, neutron\u003dNone):"},{"line_number":1235,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dneutron)"},{"line_number":1236,"context_line":"        return constants.MULTI_NET_EXT in self.extensions"},{"line_number":1237,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"abfc7e9b_af4c7328","line":1234,"updated":"2021-02-19 11:06:47.000000000","message":"This seems to be checking similar things than _has_segment_extension() and it is already used in as a guard to getting segments out of networks.","commit_id":"60e20632f93edbf104c0cd2f03a2931aad3721c5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bc634f4579c2bb6ba3c7d056850af5ab88b21f69","unresolved":true,"context_lines":[{"line_number":1250,"context_line":"        self._refresh_neutron_extensions_cache(context)"},{"line_number":1251,"context_line":"        return constants.SUBSTR_PORT_FILTERING in self.extensions"},{"line_number":1252,"context_line":""},{"line_number":1253,"context_line":"    def _has_segment_extension(self, context, neutron\u003dNone):"},{"line_number":1254,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dneutron)"},{"line_number":1255,"context_line":"        return constants.SEGMENT in self.extensions"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"d90c3d70_30be5275","line":1253,"updated":"2021-02-19 11:06:47.000000000","message":"this is always false now in my devstack even with segments service_plugin enabled","commit_id":"60e20632f93edbf104c0cd2f03a2931aad3721c5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bc634f4579c2bb6ba3c7d056850af5ab88b21f69","unresolved":true,"context_lines":[{"line_number":1995,"context_line":"                # is to find a first segment that provides a physical network."},{"line_number":1996,"context_line":"                # TODO(vladikr): Additional work will be required to handle the"},{"line_number":1997,"context_line":"                # case of multiple vlan segments associated with different"},{"line_number":1998,"context_line":"                # physical networks."},{"line_number":1999,"context_line":"                physnet_name \u003d net.get(\u0027provider:physical_network\u0027)"},{"line_number":2000,"context_line":"                if physnet_name:"},{"line_number":2001,"context_line":"                    return physnet_name, False"}],"source_content_type":"text/x-python","patch_set":9,"id":"e1315df9_3d5ee694","line":1998,"updated":"2021-02-19 11:06:47.000000000","message":"Here we also handling segments to get physnets out of a network.","commit_id":"60e20632f93edbf104c0cd2f03a2931aad3721c5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b15851ee70288c87aca31f1d46c50755f7e77ad7","unresolved":true,"context_lines":[{"line_number":3507,"context_line":""},{"line_number":3508,"context_line":"        client \u003d get_client(context)"},{"line_number":3509,"context_line":"        try:"},{"line_number":3510,"context_line":"            segments \u003d client.list_segments(network_id\u003dnetwork_id,"},{"line_number":3511,"context_line":"                                            fields\u003d\u0027id\u0027)[\u0027segments\u0027]"},{"line_number":3512,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":3513,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("}],"source_content_type":"text/x-python","patch_set":10,"id":"7c968944_ea958af9","line":3510,"updated":"2021-02-19 15:32:27.000000000","message":"Unfortunately this list segments for a network even if the subnets of the network was created without any segment_id. In this case (subnets without segment_id) neutron does not create the aggregates. So I think we have to consider this case as a non multisegment case somehow.","commit_id":"1e3af9eb64d8e4790a77f7a27fa4683b317186ac"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b775f5568340a27b2d45df577d1acf04abf5a8c","unresolved":false,"context_lines":[{"line_number":3507,"context_line":""},{"line_number":3508,"context_line":"        client \u003d get_client(context)"},{"line_number":3509,"context_line":"        try:"},{"line_number":3510,"context_line":"            segments \u003d client.list_segments(network_id\u003dnetwork_id,"},{"line_number":3511,"context_line":"                                            fields\u003d\u0027id\u0027)[\u0027segments\u0027]"},{"line_number":3512,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":3513,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("}],"source_content_type":"text/x-python","patch_set":10,"id":"ef231cd0_14187823","line":3510,"in_reply_to":"7c968944_ea958af9","updated":"2021-02-22 16:25:20.000000000","message":"Done","commit_id":"1e3af9eb64d8e4790a77f7a27fa4683b317186ac"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b775f5568340a27b2d45df577d1acf04abf5a8c","unresolved":true,"context_lines":[{"line_number":3509,"context_line":"        try:"},{"line_number":3510,"context_line":"            # NOTE(sbauza): We can\u0027t use list_segments() directly because the"},{"line_number":3511,"context_line":"            # API is borked and returns both segments but also segmentation IDs"},{"line_number":3512,"context_line":"            # of a provider network if any."},{"line_number":3513,"context_line":"            subnets \u003d client.list_subnets(network_id\u003dnetwork_id,"},{"line_number":3514,"context_line":"                                          fields\u003d\u0027segment_id\u0027)[\u0027subnets\u0027]"},{"line_number":3515,"context_line":"        except neutron_client_exc.NeutronClientException as e:"}],"source_content_type":"text/x-python","patch_set":12,"id":"60eb76d3_64610ff6","line":3512,"updated":"2021-02-22 16:25:20.000000000","message":"This is not fully correct. I think the problem for us is that the API returns segment uuids regardless if that segment is connected to any subnet of the network or not. (Note segmentation id is an int, while segment uuid is a uuid)","commit_id":"c4b28a5496e9e679c72cd6fa403fd6b82b0eceb1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b775f5568340a27b2d45df577d1acf04abf5a8c","unresolved":true,"context_lines":[{"line_number":3514,"context_line":"                                          fields\u003d\u0027segment_id\u0027)[\u0027subnets\u0027]"},{"line_number":3515,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":3516,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":3517,"context_line":"                \u0027Failed to get segment IDs for network %s\u0027 % network_id) from e"},{"line_number":3518,"context_line":"        # The segment field of an unconfigured subnet could be None"},{"line_number":3519,"context_line":"        return [subnet[\u0027segment_id\u0027] for subnet in subnets"},{"line_number":3520,"context_line":"                                     if subnet[\u0027segment_id\u0027] is not None]"}],"source_content_type":"text/x-python","patch_set":12,"id":"fed80d48_3e140a83","line":3517,"range":{"start_line":3517,"start_character":27,"end_line":3517,"end_character":42},"updated":"2021-02-22 16:25:20.000000000","message":"actually now we failed to get subnets for the given network","commit_id":"c4b28a5496e9e679c72cd6fa403fd6b82b0eceb1"}],"nova/scheduler/utils.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f30a6595e0ce5118d8520f6238d52bca0e0b293b","unresolved":true,"context_lines":[{"line_number":1367,"context_line":"    \"\"\""},{"line_number":1368,"context_line":"    aggregates \u003d []"},{"line_number":1369,"context_line":""},{"line_number":1370,"context_line":"    segment_ids \u003d network_api.get_segment_ids_for_subnet("},{"line_number":1371,"context_line":"        context, subnet_id)"},{"line_number":1372,"context_line":"    for segment_id in segment_ids:"},{"line_number":1373,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."}],"source_content_type":"text/x-python","patch_set":3,"id":"f04539b2_3e05b28e","line":1370,"range":{"start_line":1370,"start_character":30,"end_line":1370,"end_character":56},"updated":"2021-02-09 02:54:56.000000000","message":"this should always be 1 id","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"38efa8d1ae7b5a8083fd6dd0a63c587a0471829d","unresolved":false,"context_lines":[{"line_number":1367,"context_line":"    \"\"\""},{"line_number":1368,"context_line":"    aggregates \u003d []"},{"line_number":1369,"context_line":""},{"line_number":1370,"context_line":"    segment_ids \u003d network_api.get_segment_ids_for_subnet("},{"line_number":1371,"context_line":"        context, subnet_id)"},{"line_number":1372,"context_line":"    for segment_id in segment_ids:"},{"line_number":1373,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."}],"source_content_type":"text/x-python","patch_set":3,"id":"27f6a15b_e9067673","line":1370,"range":{"start_line":1370,"start_character":30,"end_line":1370,"end_character":56},"in_reply_to":"f04539b2_3e05b28e","updated":"2021-02-09 09:09:10.000000000","message":"Ack","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f30a6595e0ce5118d8520f6238d52bca0e0b293b","unresolved":true,"context_lines":[{"line_number":1369,"context_line":""},{"line_number":1370,"context_line":"    segment_ids \u003d network_api.get_segment_ids_for_subnet("},{"line_number":1371,"context_line":"        context, subnet_id)"},{"line_number":1372,"context_line":"    for segment_id in segment_ids:"},{"line_number":1373,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."},{"line_number":1374,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1375,"context_line":"        if agg_info is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9e657e7e_ab73a87e","line":1372,"range":{"start_line":1372,"start_character":2,"end_line":1372,"end_character":34},"updated":"2021-02-09 02:54:56.000000000","message":"so this loop is not needed","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"38efa8d1ae7b5a8083fd6dd0a63c587a0471829d","unresolved":false,"context_lines":[{"line_number":1369,"context_line":""},{"line_number":1370,"context_line":"    segment_ids \u003d network_api.get_segment_ids_for_subnet("},{"line_number":1371,"context_line":"        context, subnet_id)"},{"line_number":1372,"context_line":"    for segment_id in segment_ids:"},{"line_number":1373,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."},{"line_number":1374,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1375,"context_line":"        if agg_info is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"4ee00287_db1960f3","line":1372,"range":{"start_line":1372,"start_character":2,"end_line":1372,"end_character":34},"in_reply_to":"9e657e7e_ab73a87e","updated":"2021-02-09 09:09:10.000000000","message":"Ack","commit_id":"fd221e35affc6bc68f6e5705cea712193dc9a254"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"6f170e0e_a031933c","updated":"2021-02-09 17:59:50.000000000","message":"Why are these going into utils? Unless they\u0027re used in multiple places, it seems more sensible to put them into the same location as their caller. Giant catch-all utils modules are generally an anti-pattern, IMO.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"52fe7603_2f5f0272","in_reply_to":"6f170e0e_a031933c","updated":"2021-02-12 13:53:13.000000000","message":"That\u0027s a good call but adding those in the prefilter module is fatty too. If you don\u0027t disagree, we could discuss on the opportunity to have a prefilter per module in a later patch so we could put those utils methods within this single file.\nMarking it as FIXME.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":""},{"line_number":1312,"context_line":"def get_aggregates_for_routed_network("},{"line_number":1313,"context_line":"        context, network_api, report_client, network_uuid):"},{"line_number":1314,"context_line":"    \"\"\"Collects the aggregate UUIDs describing the segmentation of a routed"},{"line_number":1315,"context_line":"    network from Nova perspective."},{"line_number":1316,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"6ac6ea27_dd84a1f8","line":1313,"updated":"2021-02-09 17:59:50.000000000","message":"type hints? Note that you can avoid circular imports with something like e.g. \u0027nova.network.neutron.API\u0027 by doing the following:\n\n  if ty.TYPE_CHECKING:\n      from nova.network import neutron\n      from nova.scheduler.client import report\n\nand then typing like so:\n\n  def get_aggregates_for_routed_network(\n      context: nova_context.RequestContext,\n      network_api: \u0027neutron.API\u0027,   # \u003c-- note the quotes to defer parsing\n      report_client: \u0027report.SchedulerReportClient\u0027,\n      network_uuid: str,\n  ):","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":true,"context_lines":[{"line_number":1310,"context_line":""},{"line_number":1311,"context_line":""},{"line_number":1312,"context_line":"def get_aggregates_for_routed_network("},{"line_number":1313,"context_line":"        context, network_api, report_client, network_uuid):"},{"line_number":1314,"context_line":"    \"\"\"Collects the aggregate UUIDs describing the segmentation of a routed"},{"line_number":1315,"context_line":"    network from Nova perspective."},{"line_number":1316,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"4dfa0227_231a6b73","line":1313,"in_reply_to":"6ac6ea27_dd84a1f8","updated":"2021-02-12 13:53:13.000000000","message":"Note that I don\u0027t want to be relunctant to adding type hints here, but I think we are adding extra code complexity for an unnecessary need. That\u0027s excellent you remarked the circular import and I like the fact you proposed a workaround, but I won\u0027t add those type hints and leave them to be written once we pull those methods in the same prefilter module.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":1338,"context_line":"    # NOTE(sbauza): In case of a network with non-configured routed segments,"},{"line_number":1339,"context_line":"    # we will get an empty list of segment UUIDs, so we won\u0027t enter the loop."},{"line_number":1340,"context_line":"    for segment_id in segment_ids:"},{"line_number":1341,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."},{"line_number":1342,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1343,"context_line":"        if agg_info is None:"},{"line_number":1344,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"9656ca99_bff2b0a1","line":1341,"updated":"2021-02-09 17:59:50.000000000","message":"This should be follow-up, if you can","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":true,"context_lines":[{"line_number":1338,"context_line":"    # NOTE(sbauza): In case of a network with non-configured routed segments,"},{"line_number":1339,"context_line":"    # we will get an empty list of segment UUIDs, so we won\u0027t enter the loop."},{"line_number":1340,"context_line":"    for segment_id in segment_ids:"},{"line_number":1341,"context_line":"        # TODO(sbauza): Don\u0027t use a private method."},{"line_number":1342,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1343,"context_line":"        if agg_info is None:"},{"line_number":1344,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"27f38e0f_4e40634f","line":1341,"in_reply_to":"9656ca99_bff2b0a1","updated":"2021-02-12 13:53:13.000000000","message":"\u003e This should be follow-up, if you can\n\nWill do.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":1342,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1343,"context_line":"        if agg_info is None:"},{"line_number":1344,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"},{"line_number":1345,"context_line":"                                          \u0027to segment %s\u0027 % segment_id)"},{"line_number":1346,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1347,"context_line":"    return aggregates"},{"line_number":1348,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"a6f33798_f8bb62d5","line":1345,"updated":"2021-02-09 17:59:50.000000000","message":"Don\u0027t we want something more specific than this?","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":1348,"context_line":""},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"def get_aggregates_for_routed_subnet("},{"line_number":1351,"context_line":"        context, network_api, report_client, subnet_id):"},{"line_number":1352,"context_line":"    \"\"\"Collects the aggregate UUIDs matching the segment that relates to a"},{"line_number":1353,"context_line":"    particular subnet from a routed network."},{"line_number":1354,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"573cb039_62ac51b0","line":1351,"updated":"2021-02-09 17:59:50.000000000","message":"type hints? Pretty please? 😊","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":true,"context_lines":[{"line_number":1348,"context_line":""},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"def get_aggregates_for_routed_subnet("},{"line_number":1351,"context_line":"        context, network_api, report_client, subnet_id):"},{"line_number":1352,"context_line":"    \"\"\"Collects the aggregate UUIDs matching the segment that relates to a"},{"line_number":1353,"context_line":"    particular subnet from a routed network."},{"line_number":1354,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"b5a847ea_ebb06d29","line":1351,"in_reply_to":"573cb039_62ac51b0","updated":"2021-02-12 13:53:13.000000000","message":"Same remark as above","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1ad33d8b2024ce7bba86d35f7915e8bedaa9c2d7","unresolved":true,"context_lines":[{"line_number":1374,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1375,"context_line":"        if agg_info is None:"},{"line_number":1376,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"},{"line_number":1377,"context_line":"                                          \u0027to segment %s\u0027 % segment_id)"},{"line_number":1378,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1379,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":5,"id":"9c4c436d_db6616ba","line":1377,"updated":"2021-02-09 17:59:50.000000000","message":"Do we want a more specific exception type?","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"        agg_info \u003d report_client._get_provider_aggregates(context, segment_id)"},{"line_number":1375,"context_line":"        if agg_info is None:"},{"line_number":1376,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"},{"line_number":1377,"context_line":"                                          \u0027to segment %s\u0027 % segment_id)"},{"line_number":1378,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1379,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":5,"id":"44a14533_6153e076","line":1377,"in_reply_to":"9c4c436d_db6616ba","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"37d21ae0319ecb1cba26cef62a58f5f2628951ef","unresolved":true,"context_lines":[{"line_number":1375,"context_line":"        if agg_info is None:"},{"line_number":1376,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"},{"line_number":1377,"context_line":"                                          \u0027to segment %s\u0027 % segment_id)"},{"line_number":1378,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1379,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":5,"id":"c69a2953_079d03f3","line":1378,"range":{"start_line":1378,"start_character":8,"end_line":1378,"end_character":46},"updated":"2021-02-09 11:53:51.000000000","message":"nit: now that it is not a loop you don\u0027t have to have a local aggregates variable that is extended at most once. \n\nBut it is not a blocker to me.","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"69f8adb944194e429508e27704528cec2f9870b5","unresolved":false,"context_lines":[{"line_number":1375,"context_line":"        if agg_info is None:"},{"line_number":1376,"context_line":"            raise exception.NovaException(\u0027Failed to find aggregate related \u0027"},{"line_number":1377,"context_line":"                                          \u0027to segment %s\u0027 % segment_id)"},{"line_number":1378,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1379,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":5,"id":"05fd6b86_cedc77e3","line":1378,"range":{"start_line":1378,"start_character":8,"end_line":1378,"end_character":46},"in_reply_to":"c69a2953_079d03f3","updated":"2021-02-12 13:53:13.000000000","message":"Ack","commit_id":"2ca94651dee420204f32f8a34c5a78f07c6d53e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b15851ee70288c87aca31f1d46c50755f7e77ad7","unresolved":true,"context_lines":[{"line_number":1367,"context_line":"        # @safe_connect can return None but we also want to hard-stop here if"},{"line_number":1368,"context_line":"        # we can\u0027t find the aggregate that Neutron created for the segment."},{"line_number":1369,"context_line":"        if agg_info is None or not agg_info.aggregates:"},{"line_number":1370,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":1371,"context_line":"                \u0027Failed to find aggregate related to segment %s\u0027 % segment_id)"},{"line_number":1372,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1373,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":10,"id":"48985383_75053a4d","line":1370,"updated":"2021-02-19 15:32:27.000000000","message":"This is problematic. In a simple provider net the network will have a segment in neutron. But the subnets on that network might or might not assigned to that segment. If there is no subnet assigned to that segment then the neutron segment plugin did not created placement aggregate configuration so we will end up here. \n\nImagine the situation:\n1) there is a normal net without any fancy multi-segmentation\n\n  $ openstack network create net3 --share --provider-network-type vlan --provider-physical-network physnet0 --provider-segment 103\n  $ openstack subnet create subnet3 --network net3 --subnet-range 10.0.7.0/24 \n\nthis is a valid neutron configuration\n\n2) then there is another network with with multiple segments configured accordingly\n\n  $ openstack network create net4 --share --provider-network-type vlan --provider-physical-network physnet0 --provider-segment 104\n  $ openstack network segment create --physical-network physnet1 --network-type vlan --segment 3004 --network net4 other-segment\n  $ openstack subnet create subnet4 --network net4 --subnet-range 10.0.8.0/24 --network-segment other-segment\n\nthis is also a valid neutron configuration\n\n3) now the user boots a VM connected to both network\n\n  $ openstack server create --image cirros-0.5.1-x86_64-disk --flavor c1 --nic net-id\u003dnet3 --nic net-id\u003dnet4  vm1 --wait\n\nThis boot will now fail as nova considers both net3 and net4 having a segment but neutron only created aggregates for net4 but not for net3 and therefore we end up with this exception.\n\n///\n\nI\u0027m not sure if this is bug in the segments plugin in neutron but today the segments plugin only triggered for subnets that has explicit segment_id set. However this prefilter in nova is triggered for any network having a segment even if there is no subnet with that segment.","commit_id":"1e3af9eb64d8e4790a77f7a27fa4683b317186ac"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6b775f5568340a27b2d45df577d1acf04abf5a8c","unresolved":false,"context_lines":[{"line_number":1367,"context_line":"        # @safe_connect can return None but we also want to hard-stop here if"},{"line_number":1368,"context_line":"        # we can\u0027t find the aggregate that Neutron created for the segment."},{"line_number":1369,"context_line":"        if agg_info is None or not agg_info.aggregates:"},{"line_number":1370,"context_line":"            raise exception.InvalidRoutedNetworkConfiguration("},{"line_number":1371,"context_line":"                \u0027Failed to find aggregate related to segment %s\u0027 % segment_id)"},{"line_number":1372,"context_line":"        aggregates.extend(agg_info.aggregates)"},{"line_number":1373,"context_line":"    return aggregates"}],"source_content_type":"text/x-python","patch_set":10,"id":"2d83b069_a037e919","line":1370,"in_reply_to":"48985383_75053a4d","updated":"2021-02-22 16:25:20.000000000","message":"Re-tested these scenarios with PS22 and now the result looks good to me (except the neutron specific bug https://bugs.launchpad.net/neutron/+bug/1916276)","commit_id":"1e3af9eb64d8e4790a77f7a27fa4683b317186ac"}],"nova/tests/unit/network/test_neutron.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":6271,"context_line":"    def test_get_segment_ids_for_network_no_segment_ext(self):"},{"line_number":6272,"context_line":"        with mock.patch.object(self.api, \u0027_has_segment_extension\u0027,"},{"line_number":6273,"context_line":"                               return_value\u003dFalse):"},{"line_number":6274,"context_line":"            self.assertEqual([],"},{"line_number":6275,"context_line":"                             self.api.get_segment_ids_for_network("},{"line_number":6276,"context_line":"                                self.context, uuids.network_id))"},{"line_number":6277,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ee379107_c9ca38bf","line":6274,"range":{"start_line":6274,"start_character":28,"end_line":6274,"end_character":30},"updated":"2021-02-08 10:46:01.000000000","message":"nit: I would wrap the line here","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":6271,"context_line":"    def test_get_segment_ids_for_network_no_segment_ext(self):"},{"line_number":6272,"context_line":"        with mock.patch.object(self.api, \u0027_has_segment_extension\u0027,"},{"line_number":6273,"context_line":"                               return_value\u003dFalse):"},{"line_number":6274,"context_line":"            self.assertEqual([],"},{"line_number":6275,"context_line":"                             self.api.get_segment_ids_for_network("},{"line_number":6276,"context_line":"                                self.context, uuids.network_id))"},{"line_number":6277,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf46c35c_4378fa9c","line":6274,"range":{"start_line":6274,"start_character":28,"end_line":6274,"end_character":30},"in_reply_to":"ee379107_c9ca38bf","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":6320,"context_line":"                               return_value\u003dFalse):"},{"line_number":6321,"context_line":"            self.assertEqual([],"},{"line_number":6322,"context_line":"                             self.api.get_segment_ids_for_subnet("},{"line_number":6323,"context_line":"                                self.context, uuids.subnet_id))"},{"line_number":6324,"context_line":""},{"line_number":6325,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027)"},{"line_number":6326,"context_line":"    def test_get_segment_ids_for_subnet_passes(self, mock_client):"}],"source_content_type":"text/x-python","patch_set":2,"id":"c4aeeb97_ac2711ef","line":6323,"range":{"start_line":6323,"start_character":29,"end_line":6323,"end_character":32},"updated":"2021-02-08 10:46:01.000000000","message":"this indent feels wrong","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":6320,"context_line":"                               return_value\u003dFalse):"},{"line_number":6321,"context_line":"            self.assertEqual([],"},{"line_number":6322,"context_line":"                             self.api.get_segment_ids_for_subnet("},{"line_number":6323,"context_line":"                                self.context, uuids.subnet_id))"},{"line_number":6324,"context_line":""},{"line_number":6325,"context_line":"    @mock.patch.object(neutronapi, \u0027get_client\u0027)"},{"line_number":6326,"context_line":"    def test_get_segment_ids_for_subnet_passes(self, mock_client):"}],"source_content_type":"text/x-python","patch_set":2,"id":"235002ff_7f1ab918","line":6323,"range":{"start_line":6323,"start_character":29,"end_line":6323,"end_character":32},"in_reply_to":"c4aeeb97_ac2711ef","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ea6bf42462e14ba659cb2441873ebdeff122847d","unresolved":true,"context_lines":[{"line_number":6270,"context_line":""},{"line_number":6271,"context_line":"    def test_get_segment_ids_for_network_no_segment_ext(self):"},{"line_number":6272,"context_line":"        with mock.patch.object(self.api, \u0027_has_segment_extension\u0027,"},{"line_number":6273,"context_line":"                               return_value\u003dFalse):"},{"line_number":6274,"context_line":"            self.assertEqual("},{"line_number":6275,"context_line":"                [], self.api.get_segment_ids_for_network(self.context,"},{"line_number":6276,"context_line":"                                                         uuids.network_id))"}],"source_content_type":"text/x-python","patch_set":6,"id":"ef270fba_8cc76ba6","line":6273,"updated":"2021-02-17 14:22:25.000000000","message":"style nit:\n\n  with mock.patch.object(\n      self.api, \u0027_has_segment_extension\u0027, return_value\u003dFalse,\n  ):\n\nHere and below","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2f1595b93aa7d7d0097f2a163fb73c7fa059e94a","unresolved":false,"context_lines":[{"line_number":6270,"context_line":""},{"line_number":6271,"context_line":"    def test_get_segment_ids_for_network_no_segment_ext(self):"},{"line_number":6272,"context_line":"        with mock.patch.object(self.api, \u0027_has_segment_extension\u0027,"},{"line_number":6273,"context_line":"                               return_value\u003dFalse):"},{"line_number":6274,"context_line":"            self.assertEqual("},{"line_number":6275,"context_line":"                [], self.api.get_segment_ids_for_network(self.context,"},{"line_number":6276,"context_line":"                                                         uuids.network_id))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5dce316d_6f2d4636","line":6273,"in_reply_to":"ef270fba_8cc76ba6","updated":"2021-02-17 18:18:41.000000000","message":"Ack","commit_id":"207f34b5c91c323e147e1a4c0782dacaf7c9aa21"}],"nova/tests/unit/scheduler/test_scheduler_utils.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5230bc421da9691bbd7b1bde8f269bd3d3b942bb","unresolved":true,"context_lines":[{"line_number":425,"context_line":"                side_effect\u003dfake_get_provider_aggregates) as mock_get_aggs:"},{"line_number":426,"context_line":"            res \u003d scheduler_utils.get_aggregates_for_routed_network("},{"line_number":427,"context_line":"                self.context, network_api, report_client,"},{"line_number":428,"context_line":"                uuids.network1)"},{"line_number":429,"context_line":"        self.assertEqual([uuids.agg1, uuids.agg2], res)"},{"line_number":430,"context_line":"        mock_get_segment_ids.assert_called_once_with("},{"line_number":431,"context_line":"            self.context, uuids.network1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"761da778_bb6c677a","line":428,"range":{"start_line":428,"start_character":16,"end_line":428,"end_character":30},"updated":"2021-02-08 10:46:01.000000000","message":"nit: I think it fits to the previous line","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8114a8d27954e8886b5251191f84b9bef49b7919","unresolved":false,"context_lines":[{"line_number":425,"context_line":"                side_effect\u003dfake_get_provider_aggregates) as mock_get_aggs:"},{"line_number":426,"context_line":"            res \u003d scheduler_utils.get_aggregates_for_routed_network("},{"line_number":427,"context_line":"                self.context, network_api, report_client,"},{"line_number":428,"context_line":"                uuids.network1)"},{"line_number":429,"context_line":"        self.assertEqual([uuids.agg1, uuids.agg2], res)"},{"line_number":430,"context_line":"        mock_get_segment_ids.assert_called_once_with("},{"line_number":431,"context_line":"            self.context, uuids.network1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"55485c4e_69360e39","line":428,"range":{"start_line":428,"start_character":16,"end_line":428,"end_character":30},"in_reply_to":"761da778_bb6c677a","updated":"2021-02-08 14:18:29.000000000","message":"Done","commit_id":"39db0657ba1e150d6c8d8e0245d89506684e8638"}]}
