)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f799c7b9a9afdb0e6018cc43e0e6eedcb0e53002","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":153,"context_line":"        else:"},{"line_number":154,"context_line":"            # (1) Retrieve non-public network list owned by the tenant."},{"line_number":155,"context_line":"            search_opts \u003d {\u0027tenant_id\u0027: project_id, \u0027shared\u0027: False}"},{"line_number":156,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":157,"context_line":"            # (2) Retrieve public network list."},{"line_number":158,"context_line":"            search_opts \u003d {\u0027shared\u0027: True}"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_043526da","line":155,"updated":"2016-06-16 19:19:39.000000000","message":"Given https://review.openstack.org/#/c/329006/ we might want to filter private tenant networks (or maybe all networks) on admin_state_up\u003dTrue when doing this query, so we filter out anything that we can\u0027t create a port on.\n\nWe could limit the impact of this by only doing that filter if the uesr requested \u0027auto\u0027 for network.","commit_id":"8b8337a70bfa81104ecd334138a9d6f2ca4ff1e0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f799c7b9a9afdb0e6018cc43e0e6eedcb0e53002","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # bug/1267723 - if no network is requested and more"},{"line_number":573,"context_line":"            # than one is available then raise NetworkAmbiguous Exception"},{"line_number":574,"context_line":"            if len(nets) \u003e 1:"},{"line_number":575,"context_line":"                msg \u003d _(\"Multiple possible networks found, use a Network \""},{"line_number":576,"context_line":"                         \"ID to be more specific.\")"},{"line_number":577,"context_line":"                raise exception.NetworkAmbiguous(msg)"},{"line_number":578,"context_line":"            ordered_networks.append("}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_644b4a5a","line":575,"updated":"2016-06-16 19:19:39.000000000","message":"Alternatively, for https://review.openstack.org/#/c/329006/ - we could check if requested_networks.auto_allocate and then filter out any networks that have admin_state_up\u003dFalse, and if there is one left we use that, although it\u0027s probably better to just do that upfront when we get the networks.","commit_id":"8b8337a70bfa81104ecd334138a9d6f2ca4ff1e0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"89e5035cc882666281322821081b8a41212f56d2","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"        LOG.debug(\u0027Automatically allocating a network for project %s.\u0027,"},{"line_number":1148,"context_line":"                  project_id, instance\u003dinstance)"},{"line_number":1149,"context_line":"        try:"},{"line_number":1150,"context_line":"            topology \u003d neutron.get_auto_allocated_topology("},{"line_number":1151,"context_line":"                project_id)[\u0027auto_allocated_topology\u0027]"},{"line_number":1152,"context_line":"        except neutron_client_exc.Conflict:"},{"line_number":1153,"context_line":"            raise exception.UnableToAutoAllocateNetwork(project_id\u003dproject_id)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_05723d7c","line":1150,"range":{"start_line":1150,"start_character":12,"end_line":1150,"end_character":20},"updated":"2016-06-16 21:50:18.000000000","message":"We should log this for debugging.","commit_id":"8b8337a70bfa81104ecd334138a9d6f2ca4ff1e0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2fcfecc81425ecdd7aaea58d2343aea0505ef716","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # bug/1267723 - if no network is requested and more"},{"line_number":573,"context_line":"            # than one is available then raise NetworkAmbiguous Exception"},{"line_number":574,"context_line":"            if len(nets) \u003e 1:"},{"line_number":575,"context_line":"                msg \u003d _(\"Multiple possible networks found, use a Network \""},{"line_number":576,"context_line":"                         \"ID to be more specific.\")"},{"line_number":577,"context_line":"                raise exception.NetworkAmbiguous(msg)"},{"line_number":578,"context_line":"            ordered_networks.append("}],"source_content_type":"text/x-python","patch_set":14,"id":"7aa08908_a1fd1670","line":575,"updated":"2016-06-17 02:27:43.000000000","message":"Yup, I recreated this with the latest version of the test:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/8337f93/logs/screen-n-cpu.txt.gz#_2016-06-17_00_27_53_228\n\nThe test now creates 3 servers, the first two are calling auto-allocated-topology and get the same network back which has admin_state_up\u003dTrue. The third gets more than one network back, which one should have admin_state_up\u003dFalse, and then fails. So I need to filter out networks that have admin_state_up\u003dFalse when listing available networks if we\u0027ve requested \u0027auto\u0027.","commit_id":"cea064796813df1fbb1cb70f05b6232f6a0b7aae"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a7a22b1b5c00d890bcc245d0cd432134006ddec9","unresolved":false,"context_lines":[{"line_number":574,"context_line":"                    project_id\u003dinstance.project_id)"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"            if len(nets) \u003e 1:"},{"line_number":577,"context_line":"                # Check to see if we auto-allocated a network."},{"line_number":578,"context_line":"                if auto_allocated_network:"},{"line_number":579,"context_line":"                    # We are here because there is a race when booting more"},{"line_number":580,"context_line":"                    # than two servers concurrently for the first time for"},{"line_number":581,"context_line":"                    # a tenant. The auto-allocated-topology API in neutron will"},{"line_number":582,"context_line":"                    # create the \u0027real\u0027 network for the first request, and"},{"line_number":583,"context_line":"                    # create a duplicate network for the second request, but"},{"line_number":584,"context_line":"                    # that network will deleted and it\u0027s admin_state_up"},{"line_number":585,"context_line":"                    # value is False, and the \u0027real\u0027 first network is returned"},{"line_number":586,"context_line":"                    # from the API for the second call. So the first two server"},{"line_number":587,"context_line":"                    # create requests are OK and use the same network. The"},{"line_number":588,"context_line":"                    # problem is a third concurrent server request might get"},{"line_number":589,"context_line":"                    # both networks back when listing networks in"},{"line_number":590,"context_line":"                    # _get_available_networks. So we have to filter out the"},{"line_number":591,"context_line":"                    # network with admin_state_up\u003dFalse."},{"line_number":592,"context_line":"                    LOG.debug(\u0027%i networks found after automatically \u0027"},{"line_number":593,"context_line":"                              \u0027allocating a network. Filtering out networks \u0027"},{"line_number":594,"context_line":"                              \u0027with admin_state_up\u003dFalse.\u0027, len(nets),"},{"line_number":595,"context_line":"                              instance\u003dinstance)"},{"line_number":596,"context_line":"                    for index, net in enumerate(nets):"},{"line_number":597,"context_line":"                        if net[\u0027admin_state_up\u0027] is False:"},{"line_number":598,"context_line":"                            skip \u003d nets.pop(index)"},{"line_number":599,"context_line":"                            LOG.debug(\u0027Skipping network: %s\u0027, skip[\u0027id\u0027],"},{"line_number":600,"context_line":"                                      instance\u003dinstance)"},{"line_number":601,"context_line":"                    if len(nets) !\u003d 1:"},{"line_number":602,"context_line":"                        raise exception.NetworkAmbiguous()"},{"line_number":603,"context_line":"                else:"},{"line_number":604,"context_line":"                    # bug/1267723 - if no network is requested and more"},{"line_number":605,"context_line":"                    # than one is available then raise NetworkAmbiguous"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_3b52d5de","line":602,"range":{"start_line":577,"start_character":16,"end_line":602,"end_character":58},"updated":"2016-06-17 15:29:16.000000000","message":"Need to move this to _get_available_networks when networks aren\u0027t requested and auto is specified so when listing private tenant networks we filter out those with admin_state_up\u003dFalse.","commit_id":"1f47444295c0050997992a1d97be4a4a318e58ad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b5cc39293662dadbce710ad49f8faa32912b591","unresolved":false,"context_lines":[{"line_number":640,"context_line":"                if not network.get(\u0027subnets\u0027):"},{"line_number":641,"context_line":"                    # Neutron can\u0027t apply security groups to a port"},{"line_number":642,"context_line":"                    # for a network without L3 assignments."},{"line_number":643,"context_line":"                    raise exception.SecurityGroupCannotBeApplied()"},{"line_number":644,"context_line":"            else:"},{"line_number":645,"context_line":"                if security_group_ids:"},{"line_number":646,"context_line":"                    # We don\u0027t want to apply security groups on port"}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_00cb2454","line":643,"updated":"2016-06-17 15:16:37.000000000","message":"Failing here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_22_617\n\nThe detailed tracing of the logs is below. I think we must be picking up the wrong network that has admin_state_up\u003dFalse which doesn\u0027t have a subnet yet, OR...we got the admin_state_up\u003dTrue network but it\u0027s subnet wasn\u0027t created yet.\n\nStill, the network shouldn\u0027t be admin_state_up\u003dTrue until the end of the auto-allocated-network API is done where the subnet is created. I\u0027ll have to ask Armando.","commit_id":"1f47444295c0050997992a1d97be4a4a318e58ad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b5cc39293662dadbce710ad49f8faa32912b591","unresolved":false,"context_lines":[{"line_number":1173,"context_line":"        :raises: nova.exception.NetworkNotFound"},{"line_number":1174,"context_line":"        \"\"\""},{"line_number":1175,"context_line":"        project_id \u003d instance.project_id"},{"line_number":1176,"context_line":"        LOG.debug(\u0027Automatically allocating a network for project %s.\u0027,"},{"line_number":1177,"context_line":"                  project_id, instance\u003dinstance)"},{"line_number":1178,"context_line":"        try:"},{"line_number":1179,"context_line":"            topology \u003d neutron.get_auto_allocated_topology("}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_953758af","line":1176,"updated":"2016-06-17 15:16:37.000000000","message":"So we failed a job run but I can\u0027t really tell why we\u0027re not getting logging.\n\nI see that we log this when creating the network:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_20_682","commit_id":"1f47444295c0050997992a1d97be4a4a318e58ad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3b5cc39293662dadbce710ad49f8faa32912b591","unresolved":false,"context_lines":[{"line_number":1188,"context_line":"            # handle it anyway."},{"line_number":1189,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1192,"context_line":"                  instance\u003dinstance)"},{"line_number":1193,"context_line":"        return network"},{"line_number":1194,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_154c0841","line":1191,"updated":"2016-06-17 15:16:37.000000000","message":"I see the first time we start allocating here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_20_519\n\nFor instance 6aa9df28-5847-426c-8f8c-d813d88085ce.\n\nThen the next is:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_20_682\n\nFor instance ab197aa6-af5b-49cc-a6a5-8c564dd0d8ba.\n\n--\n\nThen we get a response back from neutron and a network 5 seconds later here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_25_488\n\nThat\u0027s for ab197aa6-af5b-49cc-a6a5-8c564dd0d8ba.\n\nAnd then 5 seconds after that we get another response from neutron:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_30_059\n\nThat\u0027s for 6aa9df28-5847-426c-8f8c-d813d88085ce.\n\nThey got the same network ID:\n\n2625306c-2090-44b2-b9a9-34941d9b1a9c\n\nThe instance that failed is: f1280792-04b4-4d5a-8ff8-e75861f72f17\n\nWe started allocating networking for that instance here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_20_626\n\nThat\u0027s in between the time the time that we first call auto-allocated-topology and the 2nd time, so it must have gotten a network back, but maybe it was the bad one with admin_state_up\u003dFalse?\n\nIt then fails here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-n-cpu.txt.gz#_2016-06-17_03_42_22_617\n\nThat\u0027s 3 seconds before we got a response back from auto-allocated-topology with the network that the other 2 instances used.\n\nSo I\u0027m going to have to add more debug logging to figure out what networks are coming back and then being used which fail. We might need to do an up-front filter on admin_state_up\u003dTrue if auto-allocating.","commit_id":"1f47444295c0050997992a1d97be4a4a318e58ad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"05bf718b2615002c04057974fcd775884d1f646d","unresolved":false,"context_lines":[{"line_number":1188,"context_line":"            # handle it anyway."},{"line_number":1189,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1192,"context_line":"                  instance\u003dinstance)"},{"line_number":1193,"context_line":"        return network"},{"line_number":1194,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7aa08908_db6591e1","line":1191,"in_reply_to":"7aa08908_154c0841","updated":"2016-06-17 15:26:52.000000000","message":"The duplicate network was detected on the neutron side here:\n\nhttp://logs.openstack.org/01/327901/1/check/gate-tempest-dsvm-neutron-full/bba2fe4/logs/screen-q-svc.txt.gz#_2016-06-17_03_42_26_433\n\nWhich is in between our 2 responses from auto-allocated-topology, which makes sense.\n\nSo we must have failed because we got the first network back but it didn\u0027t have subnets yet...or they weren\u0027t \u0027up\u0027, I don\u0027t really know, but I\u0027m pretty sure we have to filter on admin_state_up\u003dTrue when filtering private tenant networks in _get_available_networks if \u0027auto\u0027 is specified.","commit_id":"1f47444295c0050997992a1d97be4a4a318e58ad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6c53749301295f0ae2a42f427da8cca9b92f9a6","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                # don\u0027t want to use them since they will get deleted along with"},{"line_number":168,"context_line":"                # their subnets and router. When creating more than two servers"},{"line_number":169,"context_line":"                # concurrently we could also hit a window where listing tenant"},{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_0c6b5a1f","line":170,"range":{"start_line":170,"start_character":62,"end_line":170,"end_character":72},"updated":"2016-06-17 18:06:25.000000000","message":"s/to failing/fail/","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ec79aaf6f36f2528a93e08187a6df377616188ba","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                # concurrently we could also hit a window where listing tenant"},{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":174,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":175,"context_line":"            # (2) Retrieve public network list."}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_53f6a55d","line":172,"updated":"2016-06-17 16:50:26.000000000","message":"This is spot on, however it does expose a number of internal details associated to the current implementation of the auto-allocated-topology API that may or may not be subject to change in the future.\n\nThis could be summed up by saying that the auto-allocated-topology extension may create complex network topologies and it does so in a non-transactional fashion. Therefore API users may be exposed to resources that are transient or partially built. A client should use resources that are meant to be ready and this can be done by checking their admin_status_up flag.\n\nI am almost thinking this should be done regardless of the auto_allocate flag, but I cannot be 100% sure if it may end breaking some weird case where VMs are booted of disabled networks.","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6c53749301295f0ae2a42f427da8cca9b92f9a6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                # concurrently we could also hit a window where listing tenant"},{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":174,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":175,"context_line":"            # (2) Retrieve public network list."}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_4c48c2b3","line":172,"in_reply_to":"7aa08908_53f6a55d","updated":"2016-06-17 18:06:25.000000000","message":"\"I am almost thinking this should be done regardless of the auto_allocate flag, but I cannot be 100% sure if it may end breaking some weird case where VMs are booted of disabled networks.\"\n\nYeah I wasn\u0027t sure about that either, I was asking about it in the neutron channel yesterday and didn\u0027t get any firm responses, so I wanted to make it an edge case to start.","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f97920d3b2ec3e84a2eb44ed791b8324405a2d58","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                # concurrently we could also hit a window where listing tenant"},{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":174,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":175,"context_line":"            # (2) Retrieve public network list."}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_8c729c48","line":172,"in_reply_to":"7aa08908_53f6a55d","updated":"2016-06-18 01:49:39.000000000","message":"Done","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"37f68f3589b4369011de4d2c397368693c129e8c","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":174,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":175,"context_line":"            # (2) Retrieve public network list."},{"line_number":176,"context_line":"            search_opts \u003d {\u0027shared\u0027: True}"}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_69de42db","line":173,"updated":"2016-06-18 00:42:47.000000000","message":"TODO: unit test for this.","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f97920d3b2ec3e84a2eb44ed791b8324405a2d58","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                # networks returns more than one, which would to failing with"},{"line_number":171,"context_line":"                # a NetworkAmbiguous error. So the up front filtering here is"},{"line_number":172,"context_line":"                # needed for that case also."},{"line_number":173,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":174,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":175,"context_line":"            # (2) Retrieve public network list."},{"line_number":176,"context_line":"            search_opts \u003d {\u0027shared\u0027: True}"}],"source_content_type":"text/x-python","patch_set":16,"id":"7aa08908_ac93184e","line":173,"in_reply_to":"7aa08908_69de42db","updated":"2016-06-18 01:49:39.000000000","message":"Done","commit_id":"2762a4be955b23a6ef930adf54bada6120878ad7"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a28cffe6957dd7de1625fe146f0b5a6b57ff04f5","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"            topology \u003d neutron.get_auto_allocated_topology("},{"line_number":1162,"context_line":"                project_id)[\u0027auto_allocated_topology\u0027]"},{"line_number":1163,"context_line":"        except neutron_client_exc.Conflict:"},{"line_number":1164,"context_line":"            raise exception.UnableToAutoAllocateNetwork(project_id\u003dproject_id)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        try:"},{"line_number":1167,"context_line":"            network \u003d neutron.show_network(topology[\u0027id\u0027])[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_3a823a53","line":1164,"updated":"2016-06-22 08:35:09.000000000","message":"We should catch this exception in the compute manager, and decided it should be reschedule or abort. In default it will rescheduler https://github.com/openstack/nova/blob/51fdeaf5e057dd7b41ba839e32d8710d40cba599/nova/compute/manager.py#L1916\n\nIn this case, i think we should abort the build.","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"20c64074e1af4aa4829bdd75c40a6e5d408df12c","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"            topology \u003d neutron.get_auto_allocated_topology("},{"line_number":1162,"context_line":"                project_id)[\u0027auto_allocated_topology\u0027]"},{"line_number":1163,"context_line":"        except neutron_client_exc.Conflict:"},{"line_number":1164,"context_line":"            raise exception.UnableToAutoAllocateNetwork(project_id\u003dproject_id)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        try:"},{"line_number":1167,"context_line":"            network \u003d neutron.show_network(topology[\u0027id\u0027])[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_536436e4","line":1164,"in_reply_to":"3aaa91ec_3a823a53","updated":"2016-06-22 15:45:06.000000000","message":"Yeah good point, it should probably be handled here:\n\nhttps://github.com/openstack/nova/blob/51fdeaf5e057dd7b41ba839e32d8710d40cba599/nova/compute/manager.py#L1888\n\nWhich will then get processed here:\n\nhttps://github.com/openstack/nova/blob/51fdeaf5e057dd7b41ba839e32d8710d40cba599/nova/compute/manager.py#L1789\n\nTo deallocate any networking and set the instance to error state, which is what I said we should do in the spec:\n\nhttps://review.openstack.org/#/c/283206/18/specs/newton/approved/get-me-a-network.rst@125","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3cff12976c612b5cae6ba30d08448b6b7daf231b","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"            topology \u003d neutron.get_auto_allocated_topology("},{"line_number":1162,"context_line":"                project_id)[\u0027auto_allocated_topology\u0027]"},{"line_number":1163,"context_line":"        except neutron_client_exc.Conflict:"},{"line_number":1164,"context_line":"            raise exception.UnableToAutoAllocateNetwork(project_id\u003dproject_id)"},{"line_number":1165,"context_line":""},{"line_number":1166,"context_line":"        try:"},{"line_number":1167,"context_line":"            network \u003d neutron.show_network(topology[\u0027id\u0027])[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_736e9230","line":1164,"in_reply_to":"3aaa91ec_536436e4","updated":"2016-06-22 15:52:00.000000000","message":"Thinking about nova-network, it can also raise this if no networks were allocated, and rescheduling for nova-network might actually work...but that\u0027s probably an edge case we don\u0027t really need to worry about too much, especially given nova-network is deprecated.","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a28cffe6957dd7de1625fe146f0b5a6b57ff04f5","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"        except neutron_client_exc.NetworkNotFoundClient:"},{"line_number":1169,"context_line":"            # This shouldn\u0027t happen since we just created the network, but"},{"line_number":1170,"context_line":"            # handle it anyway."},{"line_number":1171,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1172,"context_line":""},{"line_number":1173,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1174,"context_line":"                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_5a81064a","line":1171,"updated":"2016-06-22 08:35:09.000000000","message":"ditto","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"20c64074e1af4aa4829bdd75c40a6e5d408df12c","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"        except neutron_client_exc.NetworkNotFoundClient:"},{"line_number":1169,"context_line":"            # This shouldn\u0027t happen since we just created the network, but"},{"line_number":1170,"context_line":"            # handle it anyway."},{"line_number":1171,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1172,"context_line":""},{"line_number":1173,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1174,"context_line":"                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_d3d3065e","line":1171,"in_reply_to":"3aaa91ec_5a81064a","updated":"2016-06-22 15:45:06.000000000","message":"I\u0027m not sure about this one, it shouldn\u0027t actually happen. Rescheduling in this case could maybe be useful to retry, but it\u0027s also probably a pretty serious bug so yeah maybe failing out of this is good. To keep the changes in the compute manager simple, I\u0027ll probably log this and then raise exception.UnableToAutoAllocateNetwork.","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0116cf994aa61e979fd68ab970ef4ef4f4887789","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"        except neutron_client_exc.NetworkNotFoundClient:"},{"line_number":1169,"context_line":"            # This shouldn\u0027t happen since we just created the network, but"},{"line_number":1170,"context_line":"            # handle it anyway."},{"line_number":1171,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1172,"context_line":""},{"line_number":1173,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1174,"context_line":"                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_63bdf667","line":1171,"in_reply_to":"3aaa91ec_d3d3065e","updated":"2016-06-23 11:50:02.000000000","message":"emm...there may have case user delete the network in neutron side. But yea, it is pretty edge case.","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f3f735fb413bba37bd76622fbff44bebeb71d3b6","unresolved":false,"context_lines":[{"line_number":1181,"context_line":"        except neutron_client_exc.NetworkNotFoundClient:"},{"line_number":1182,"context_line":"            # This shouldn\u0027t happen since we just created the network, but"},{"line_number":1183,"context_line":"            # handle it anyway."},{"line_number":1184,"context_line":"            raise exception.NetworkNotFound(network_id\u003dtopology[\u0027id\u0027])"},{"line_number":1185,"context_line":""},{"line_number":1186,"context_line":"        LOG.debug(\u0027Automatically allocated network: %s\u0027, network,"},{"line_number":1187,"context_line":"                  instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":19,"id":"3aaa91ec_a63997f4","line":1184,"range":{"start_line":1184,"start_character":28,"end_line":1184,"end_character":43},"updated":"2016-06-23 16:37:37.000000000","message":"need to change this still","commit_id":"ea4b2032d7cb76b088213f5b2bd97c7a72025ce5"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"43d50dca490a7ca22935b1b16984156e2e00349e","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                # are transient or partially built. A client should use"},{"line_number":162,"context_line":"                # resources that are meant to be ready and this can be done by"},{"line_number":163,"context_line":"                # checking their admin_status_up flag."},{"line_number":164,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":165,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":166,"context_line":"            # (2) Retrieve public network list."},{"line_number":167,"context_line":"            search_opts \u003d {\u0027shared\u0027: True}"}],"source_content_type":"text/x-python","patch_set":20,"id":"3aaa91ec_3c1936d8","line":164,"updated":"2016-06-23 17:08:29.000000000","message":"Is the comment wrong or the search opt? admin_status_up !\u003d admin_state_up.","commit_id":"ac567e474aa953f85f307c56796b8d9d6f6dc19a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f1d8dc6d9b4bbafada1937613aaccb281ee4df87","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                # are transient or partially built. A client should use"},{"line_number":162,"context_line":"                # resources that are meant to be ready and this can be done by"},{"line_number":163,"context_line":"                # checking their admin_status_up flag."},{"line_number":164,"context_line":"                search_opts[\u0027admin_state_up\u0027] \u003d True"},{"line_number":165,"context_line":"            nets \u003d neutron.list_networks(**search_opts).get(\u0027networks\u0027, [])"},{"line_number":166,"context_line":"            # (2) Retrieve public network list."},{"line_number":167,"context_line":"            search_opts \u003d {\u0027shared\u0027: True}"}],"source_content_type":"text/x-python","patch_set":20,"id":"3aaa91ec_3292fdf6","line":164,"in_reply_to":"3aaa91ec_3c1936d8","updated":"2016-06-23 17:50:57.000000000","message":"The comment. I can fix it quick.","commit_id":"ac567e474aa953f85f307c56796b8d9d6f6dc19a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6396ef418e443a21ccb76f7f145a78cac5cfc786","unresolved":false,"context_lines":[{"line_number":1173,"context_line":"        :param neutron: neutron client"},{"line_number":1174,"context_line":"        :returns: Details of the network that was created."},{"line_number":1175,"context_line":"        :raises: nova.exception.UnableToAutoAllocateNetwork"},{"line_number":1176,"context_line":"        :raises: nova.exception.NetworkNotFound"},{"line_number":1177,"context_line":"        \"\"\""},{"line_number":1178,"context_line":"        project_id \u003d instance.project_id"},{"line_number":1179,"context_line":"        LOG.debug(\u0027Automatically allocating a network for project %s.\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"3aaa91ec_65e5a1a6","line":1176,"updated":"2016-06-24 20:23:27.000000000","message":"Oops, this is wrong, but I\u0027ll clean it up later.","commit_id":"6b668f4c31817f7af743b93fb3663a08e24b9fa1"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ebeaa530c9ae3baf31ca14710c848cb676fbadd4","unresolved":false,"context_lines":[{"line_number":4818,"context_line":"        @mock.patch.object(self.api, \u0027_check_external_network_attach\u0027)"},{"line_number":4819,"context_line":"        @mock.patch.object(self.api, \u0027_populate_neutron_extension_values\u0027)"},{"line_number":4820,"context_line":"        @mock.patch.object(self.api, \u0027_populate_mac_address\u0027)"},{"line_number":4821,"context_line":"        @mock.patch.object(self.api, \u0027_create_port\u0027,"},{"line_number":4822,"context_line":"                           return_value\u003duuids.port_id)"},{"line_number":4823,"context_line":"        @mock.patch.object(self.api, \u0027_update_port_dns_name\u0027)"},{"line_number":4824,"context_line":"        @mock.patch.object(self.api, \u0027get_instance_nw_info\u0027,"},{"line_number":4825,"context_line":"                           fake_get_instance_nw_info)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_4020c149","line":4822,"range":{"start_line":4821,"start_character":27,"end_line":4822,"end_character":54},"updated":"2016-06-10 18:21:15.000000000","message":"Should probably set a spec for this since we\u0027re asserting the call.","commit_id":"456ce71e106ccd9b48f550d9728b8c2c78d9e051"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a28cffe6957dd7de1625fe146f0b5a6b57ff04f5","unresolved":false,"context_lines":[{"line_number":4745,"context_line":"            can_alloc.assert_called_once_with("},{"line_number":4746,"context_line":"                self.context, mock.sentinel.neutron)"},{"line_number":4747,"context_line":""},{"line_number":4748,"context_line":"    def test__process_requested_networks_auto_allocate(self):"},{"line_number":4749,"context_line":"        # Tests that _process_requested_networks doesn\u0027t really do anything"},{"line_number":4750,"context_line":"        # if there is an auto-allocate network request."},{"line_number":4751,"context_line":"        net_req \u003d objects.NetworkRequest("}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_7adde241","line":4748,"range":{"start_line":4748,"start_character":12,"end_line":4748,"end_character":14},"updated":"2016-06-22 08:35:09.000000000","message":"why we have double \u0027_\u0027 at here?","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6826cecb0fbd01a30d30c0d222ee4fee20e3df39","unresolved":false,"context_lines":[{"line_number":4745,"context_line":"            can_alloc.assert_called_once_with("},{"line_number":4746,"context_line":"                self.context, mock.sentinel.neutron)"},{"line_number":4747,"context_line":""},{"line_number":4748,"context_line":"    def test__process_requested_networks_auto_allocate(self):"},{"line_number":4749,"context_line":"        # Tests that _process_requested_networks doesn\u0027t really do anything"},{"line_number":4750,"context_line":"        # if there is an auto-allocate network request."},{"line_number":4751,"context_line":"        net_req \u003d objects.NetworkRequest("}],"source_content_type":"text/x-python","patch_set":18,"id":"3aaa91ec_33e88ab4","line":4748,"range":{"start_line":4748,"start_character":12,"end_line":4748,"end_character":14},"in_reply_to":"3aaa91ec_7adde241","updated":"2016-06-22 15:50:22.000000000","message":"Just a style, it\u0027s testing a private method and the usual naming convention on tests is test_\u003cmethod\u003e and the method name starts with _.","commit_id":"ec04702ff7a718708fc915d9fb6a5c9d7961a2f2"}]}
