)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"30791360b20d4858135cc7c0eae55eabe00d9701","unresolved":false,"context_lines":[{"line_number":1604,"context_line":"            client \u003d get_client(context, admin\u003dTrue)"},{"line_number":1605,"context_line":"        else:"},{"line_number":1606,"context_line":"            client \u003d admin_client"},{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":1609,"context_line":""},{"line_number":1610,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_49cd33b6","line":1607,"updated":"2015-05-28 10:57:47.000000000","message":"So this basically means that we call back to neutron to ask it for ports, inside a callback that runs when we receive nitice from neutron that the ports are ready (among other places).\n\nThat\u0027s really not ideal :) just saying - even if we did pass in the ports from the event - we\u0027d still end up making this call.\n\nThis is not related to this bug - just a general comment on the overcomplexity of these interactions.","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"30791360b20d4858135cc7c0eae55eabe00d9701","unresolved":false,"context_lines":[{"line_number":1623,"context_line":"            current_neutron_port_map[current_neutron_port[\u0027id\u0027]] \u003d ("},{"line_number":1624,"context_line":"                current_neutron_port)"},{"line_number":1625,"context_line":""},{"line_number":1626,"context_line":"        # Bug lp#1407664 introduces a race conditon between Nova and"},{"line_number":1627,"context_line":"        # Neutron which make instance\u0027s info_cache empty. In that case"},{"line_number":1628,"context_line":"        # we should repopulate ports from the state of Neutron."},{"line_number":1629,"context_line":"        if not port_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_c6ec70f5","line":1626,"updated":"2015-05-28 10:57:47.000000000","message":"\"The bug introduces\" is kind of an awkward thing to write but no matter","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"577197887a64ab3bfac6ef9ee715e54398a7f7b3","unresolved":false,"context_lines":[{"line_number":1623,"context_line":"            current_neutron_port_map[current_neutron_port[\u0027id\u0027]] \u003d ("},{"line_number":1624,"context_line":"                current_neutron_port)"},{"line_number":1625,"context_line":""},{"line_number":1626,"context_line":"        # Bug lp#1407664 introduces a race conditon between Nova and"},{"line_number":1627,"context_line":"        # Neutron which make instance\u0027s info_cache empty. In that case"},{"line_number":1628,"context_line":"        # we should repopulate ports from the state of Neutron."},{"line_number":1629,"context_line":"        if not port_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_f566c9b9","line":1626,"in_reply_to":"7a016987_b099987b","updated":"2015-05-29 09:22:03.000000000","message":"@Gary - there are places where this is being called without passing in the ports so we need to make sure they are accounted for.\n\nThis in turn manifests it self if that call (so without the ports) wins the race - that\u0027s why the race condition is mentioned\n\nTBH - I would just drop that comment - it is clear what the code does","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ecf36dc6114e076319b859d18ca2807bde37f8d7","unresolved":false,"context_lines":[{"line_number":1623,"context_line":"            current_neutron_port_map[current_neutron_port[\u0027id\u0027]] \u003d ("},{"line_number":1624,"context_line":"                current_neutron_port)"},{"line_number":1625,"context_line":""},{"line_number":1626,"context_line":"        # Bug lp#1407664 introduces a race conditon between Nova and"},{"line_number":1627,"context_line":"        # Neutron which make instance\u0027s info_cache empty. In that case"},{"line_number":1628,"context_line":"        # we should repopulate ports from the state of Neutron."},{"line_number":1629,"context_line":"        if not port_ids:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_b099987b","line":1626,"in_reply_to":"7a016987_c6ec70f5","updated":"2015-05-28 18:12:01.000000000","message":"i am sorry but I really do not understand what is going one here. can you please provide some extra details","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"a4712e71889c66c7e47039852862862b43734769","unresolved":false,"context_lines":[{"line_number":1623,"context_line":"            current_neutron_port_map[current_neutron_port[\u0027id\u0027]] \u003d ("},{"line_number":1624,"context_line":"                current_neutron_port)"},{"line_number":1625,"context_line":""},{"line_number":1626,"context_line":"        # Bug lp#1407664 introduces a race conditon between Nova and"},{"line_number":1627,"context_line":"        # Neutron which make instance\u0027s info_cache empty. In that case"},{"line_number":1628,"context_line":"        # we should repopulate ports from the state of Neutron."},{"line_number":1629,"context_line":"        if not port_ids:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_2f7dfb6c","line":1626,"updated":"2015-06-01 07:56:09.000000000","message":"Forgot to address comment from Nikola here. I think you are right it is not necessary to refer the bug here. A good comment should be enough. I will update the code soon.","commit_id":"662415b6a0173238d48edf41332c7bef6e740622"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f6ed4b3e9e91087314a39ff3e160ac65eab67a4","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        data \u003d client.list_ports(**search_opts)"},{"line_number":1616,"context_line":""},{"line_number":1617,"context_line":"        current_neutron_ports \u003d data.get(\u0027ports\u0027, [])"},{"line_number":1618,"context_line":"        nw_info_refresh \u003d networks is None and port_ids is None"},{"line_number":1619,"context_line":"        networks, port_ids \u003d self._gather_port_ids_and_networks("},{"line_number":1620,"context_line":"                context, instance, networks, port_ids)"},{"line_number":1621,"context_line":"        nw_info \u003d network_model.NetworkInfo()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_410d7e8d","line":1618,"updated":"2015-06-24 22:33:39.000000000","message":"ports_ids are refreshed from the instance_info_cache.network_info here if port_ids is None, which wouldn\u0027t be the case for allocate_for_instance, since that should pass in ports_ids (at least one - either pre-existing port passed in on boot or nova created one).\n\nSo I guess port_ids would only come into this method as None from another call (I guess the external event callback or the heal instance info cache periodic task?) and _gather_port_ids_and_networks would return an empty list if one of those things hit this method at the same time that allocate_for_instance is happening - which is what the bug report is claiming.","commit_id":"3a850ac72d60b3823c5cb4a971eaf02c580a4a20"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"9fd2e32c11e4969d16d41d075fe3243f678c9f06","unresolved":false,"context_lines":[{"line_number":1630,"context_line":"            current_neutron_port_map[current_neutron_port[\u0027id\u0027]] \u003d ("},{"line_number":1631,"context_line":"                current_neutron_port)"},{"line_number":1632,"context_line":""},{"line_number":1633,"context_line":"        # In that case we should repopulate ports from the state of"},{"line_number":1634,"context_line":"        # Neutron."},{"line_number":1635,"context_line":"        if not port_ids:"},{"line_number":1636,"context_line":"            port_ids \u003d current_neutron_port_map.keys()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_200aa820","line":1633,"updated":"2015-06-01 09:34:33.000000000","message":"Well, maybe \"in that case\" is not necessary IMHO, but that\u0027s mergeable anyway","commit_id":"3a850ac72d60b3823c5cb4a971eaf02c580a4a20"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2f6ed4b3e9e91087314a39ff3e160ac65eab67a4","unresolved":false,"context_lines":[{"line_number":1632,"context_line":""},{"line_number":1633,"context_line":"        # In that case we should repopulate ports from the state of"},{"line_number":1634,"context_line":"        # Neutron."},{"line_number":1635,"context_line":"        if not port_ids:"},{"line_number":1636,"context_line":"            port_ids \u003d current_neutron_port_map.keys()"},{"line_number":1637,"context_line":""},{"line_number":1638,"context_line":"        for port_id in port_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_016bf61e","line":1635,"updated":"2015-06-24 22:33:39.000000000","message":"Given the above, I guess if we get to this point and we still haven\u0027t figured out the ports to use (there were none in the cache because this is the first time building the cache while the instance is being alloocated), then I guess it doesn\u0027t hurt to just take what neutron already has for ports attached to this instance and put those in the nw info model cache.","commit_id":"3a850ac72d60b3823c5cb4a971eaf02c580a4a20"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ecf36dc6114e076319b859d18ca2807bde37f8d7","unresolved":false,"context_lines":[{"line_number":2678,"context_line":"        self.assertFalse(nw_infos[4][\u0027preserve_on_delete\u0027])"},{"line_number":2679,"context_line":"        self.assertTrue(nw_infos[5][\u0027preserve_on_delete\u0027])"},{"line_number":2680,"context_line":""},{"line_number":2681,"context_line":"    def test_build_network_info_model_empty(self):"},{"line_number":2682,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2683,"context_line":""},{"line_number":2684,"context_line":"        fake_inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_50a8248c","line":2681,"updated":"2015-05-28 18:12:01.000000000","message":"can we write this test just using mock? at the moment the tests are really difficult to understand, write and debug. there is a section below that has the option of writing mock tests","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"e2a98958a379c8666def787abb8edc39d4cf30e5","unresolved":false,"context_lines":[{"line_number":2678,"context_line":"        self.assertFalse(nw_infos[4][\u0027preserve_on_delete\u0027])"},{"line_number":2679,"context_line":"        self.assertTrue(nw_infos[5][\u0027preserve_on_delete\u0027])"},{"line_number":2680,"context_line":""},{"line_number":2681,"context_line":"    def test_build_network_info_model_empty(self):"},{"line_number":2682,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2683,"context_line":""},{"line_number":2684,"context_line":"        fake_inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_b58e112c","line":2681,"in_reply_to":"7a016987_50a8248c","updated":"2015-05-29 09:25:49.000000000","message":"you are probably right - tho I know them feels when you are in the middle of a test class that uses only mox and you need to add a test, and you know you should be using mock now - but is it really that much better to break suit... :)","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"233984c9d0479b069f1ffa47ee7ee37ba5de381e","unresolved":false,"context_lines":[{"line_number":2678,"context_line":"        self.assertFalse(nw_infos[4][\u0027preserve_on_delete\u0027])"},{"line_number":2679,"context_line":"        self.assertTrue(nw_infos[5][\u0027preserve_on_delete\u0027])"},{"line_number":2680,"context_line":""},{"line_number":2681,"context_line":"    def test_build_network_info_model_empty(self):"},{"line_number":2682,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2683,"context_line":""},{"line_number":2684,"context_line":"        fake_inst \u003d objects.Instance()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_efd94d57","line":2681,"in_reply_to":"7a016987_b58e112c","updated":"2015-05-29 13:45:43.000000000","message":"Actually the test is big but not really difficult to understand. The important things are:\n\n - _build_network_info_model: we do not pass port_ids and networks\n - self._gather_port_ids_and_networks: returns None for networks and port_ids\n - client.list_ports: returns ports form Neutron\n\nSo the return should be the ports returned by Neutron.","commit_id":"54d5ced9c7d696c2c9d60c949ba3b1e8fba94114"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"72615d414a6dc7f97428c3a455671dc09bf32ea7","unresolved":false,"context_lines":[{"line_number":2711,"context_line":"            ]"},{"line_number":2712,"context_line":"        fake_subnets \u003d [model.Subnet(cidr\u003d\u00271.0.0.0/8\u0027)]"},{"line_number":2713,"context_line":""},{"line_number":2714,"context_line":"        neutronapi.get_client(mox.IgnoreArg(), admin\u003dTrue).MultipleTimes("},{"line_number":2715,"context_line":"        ).AndReturn(self.moxed_client)"},{"line_number":2716,"context_line":"        self.moxed_client.list_ports("},{"line_number":2717,"context_line":"            tenant_id\u003d\u0027fake\u0027, device_id\u003d\u0027uuid\u0027).AndReturn("}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_c43d538f","line":2714,"updated":"2015-05-29 14:36:22.000000000","message":"Unfortunately we do a mox stub in the setup of this test class so i was not able to remove this. OR i should update too many things.","commit_id":"662415b6a0173238d48edf41332c7bef6e740622"}]}
