)]}'
{"nova/conductor/manager.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b3558b7e573bc310c72aefdb30f1d3cf719626c5","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            # the trouble of calling the network API."},{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"},{"line_number":277,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_314a1fc6","line":274,"range":{"start_line":274,"start_character":24,"end_line":274,"end_character":42},"updated":"2016-06-03 18:47:26.000000000","message":"maybe \nnot (requested_networks and requested_networks.no_allocate) easier to read?","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"25ccd4c78c2f6eadc48a96d9911199e86a191aa4","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            # If we were told not to allocate networks let\u0027s save ourselves"},{"line_number":271,"context_line":"            # the trouble of calling the network API."},{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_90a39bff","line":273,"range":{"start_line":273,"start_character":20,"end_line":273,"end_character":46},"updated":"2016-06-14 15:32:18.000000000","message":"You don\u0027t need this do you? If \"not requested_networks\" is true, it won\u0027t evaluate the other side of the or operation. If it\u0027s false, then that means it\u0027s not None, so you can go straight to checking no_allocate ?","commit_id":"2d93ef8e630eba06983e1eafb31321e5408e47dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1aaca2dc20f4669b44ca5c8c5d404a02d505dcb2","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            # If we were told not to allocate networks let\u0027s save ourselves"},{"line_number":271,"context_line":"            # the trouble of calling the network API."},{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_da1b8171","line":273,"range":{"start_line":273,"start_character":20,"end_line":273,"end_character":46},"in_reply_to":"7aa08908_90a39bff","updated":"2016-06-14 15:41:31.000000000","message":"Yeah looks correct, I can change it.","commit_id":"2d93ef8e630eba06983e1eafb31321e5408e47dc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"25ccd4c78c2f6eadc48a96d9911199e86a191aa4","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"},{"line_number":277,"context_line":"        except Exception:"},{"line_number":278,"context_line":"            msg \u003d _LE(\u0027Failed to deallocate networks\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_35361903","line":275,"updated":"2016-06-14 15:32:18.000000000","message":"Seems like putting this logic in the network_api deallocate itself would be better, but..","commit_id":"2d93ef8e630eba06983e1eafb31321e5408e47dc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a7dc27af8bb1b963aa75d0fb430ab3f5108b808b","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"},{"line_number":277,"context_line":"        except Exception:"},{"line_number":278,"context_line":"            msg \u003d _LE(\u0027Failed to deallocate networks\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_fa863d63","line":275,"in_reply_to":"7aa08908_30cc6734","updated":"2016-06-14 15:43:08.000000000","message":"Yeah, I guess that\u0027s a good point.","commit_id":"2d93ef8e630eba06983e1eafb31321e5408e47dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1aaca2dc20f4669b44ca5c8c5d404a02d505dcb2","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            if (not requested_networks or ("},{"line_number":273,"context_line":"                    requested_networks and not"},{"line_number":274,"context_line":"                        requested_networks.no_allocate)):"},{"line_number":275,"context_line":"                self.network_api.deallocate_for_instance("},{"line_number":276,"context_line":"                    context, instance, requested_networks\u003drequested_networks)"},{"line_number":277,"context_line":"        except Exception:"},{"line_number":278,"context_line":"            msg \u003d _LE(\u0027Failed to deallocate networks\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_30cc6734","line":275,"in_reply_to":"7aa08908_35361903","updated":"2016-06-14 15:41:31.000000000","message":"Yeah I thought about it, but it would have to be in both the neutron and nova-network APIs and I wanted to be consistent with skipping \u0027none\u0027 for allocate_for_instance, which I didn\u0027t want to handle in the nova-network manager because it would mean casting to that just to do nothing. I can see benefits both ways, but would have to look at it closer again to see what the changes would look like if we really cared.","commit_id":"2d93ef8e630eba06983e1eafb31321e5408e47dc"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":18320,"name":"Dao Cong Tien","email":"tiendc@vn.fujitsu.com","username":"TienDC"},"change_message_id":"64dace48c331c22c1ba7513bb8c7a6950741a933","unresolved":false,"context_lines":[{"line_number":1736,"context_line":"            self.context, expected_attrs\u003d[\u0027system_metadata\u0027])"},{"line_number":1737,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":1738,"context_line":"            objects\u003d[objects.NetworkRequest(network_id\u003d\u0027none\u0027)])"},{"line_number":1739,"context_line":"        with mock.patch.object(self.conductor.network_api,"},{"line_number":1740,"context_line":"                               \u0027deallocate_for_instance\u0027) as deallocate:"},{"line_number":1741,"context_line":"            with mock.patch.object(fake_inst, \u0027save\u0027) as mock_save:"},{"line_number":1742,"context_line":"                self.conductor._cleanup_allocated_networks("},{"line_number":1743,"context_line":"                    self.context, fake_inst, requested_networks)"},{"line_number":1744,"context_line":"        self.assertFalse(deallocate.called)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_f21e465e","line":1741,"range":{"start_line":1739,"start_character":0,"end_line":1741,"end_character":67},"updated":"2016-06-02 08:03:20.000000000","message":"I think, with more than 1 mocks, use test.nested() is better.","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f343f0609b93bf44c07cad05a7bf9d00f472a7ee","unresolved":false,"context_lines":[{"line_number":1736,"context_line":"            self.context, expected_attrs\u003d[\u0027system_metadata\u0027])"},{"line_number":1737,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":1738,"context_line":"            objects\u003d[objects.NetworkRequest(network_id\u003d\u0027none\u0027)])"},{"line_number":1739,"context_line":"        with mock.patch.object(self.conductor.network_api,"},{"line_number":1740,"context_line":"                               \u0027deallocate_for_instance\u0027) as deallocate:"},{"line_number":1741,"context_line":"            with mock.patch.object(fake_inst, \u0027save\u0027) as mock_save:"},{"line_number":1742,"context_line":"                self.conductor._cleanup_allocated_networks("},{"line_number":1743,"context_line":"                    self.context, fake_inst, requested_networks)"},{"line_number":1744,"context_line":"        self.assertFalse(deallocate.called)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_87811f92","line":1741,"range":{"start_line":1739,"start_character":0,"end_line":1741,"end_character":67},"in_reply_to":"9abb7d3a_f21e465e","updated":"2016-06-03 14:39:08.000000000","message":"This is a style preference, I wouldn\u0027t -1 for this. There are several different ways this could be done.","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"},{"author":{"_account_id":18320,"name":"Dao Cong Tien","email":"tiendc@vn.fujitsu.com","username":"TienDC"},"change_message_id":"64dace48c331c22c1ba7513bb8c7a6950741a933","unresolved":false,"context_lines":[{"line_number":1741,"context_line":"            with mock.patch.object(fake_inst, \u0027save\u0027) as mock_save:"},{"line_number":1742,"context_line":"                self.conductor._cleanup_allocated_networks("},{"line_number":1743,"context_line":"                    self.context, fake_inst, requested_networks)"},{"line_number":1744,"context_line":"        self.assertFalse(deallocate.called)"},{"line_number":1745,"context_line":"        self.assertEqual(\u0027False\u0027,"},{"line_number":1746,"context_line":"                         fake_inst.system_metadata[\u0027network_allocated\u0027],"},{"line_number":1747,"context_line":"                         fake_inst.system_metadata)"},{"line_number":1748,"context_line":"        mock_save.assert_called_once_with()"},{"line_number":1749,"context_line":""},{"line_number":1750,"context_line":"    def test_cleanup_allocated_networks_auto_or_none_provided(self):"},{"line_number":1751,"context_line":"        # Tests that we deallocate networks if auto-allocating networks or"}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_7261b6d3","line":1748,"range":{"start_line":1744,"start_character":0,"end_line":1748,"end_character":43},"updated":"2016-06-02 08:03:20.000000000","message":"I suggest moving these code into \u0027with\u0027 block.","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"},{"author":{"_account_id":18320,"name":"Dao Cong Tien","email":"tiendc@vn.fujitsu.com","username":"TienDC"},"change_message_id":"64dace48c331c22c1ba7513bb8c7a6950741a933","unresolved":false,"context_lines":[{"line_number":1755,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":1756,"context_line":"            objects\u003d[objects.NetworkRequest(network_id\u003d\u0027auto\u0027)])"},{"line_number":1757,"context_line":"        for req_net in (requested_networks, None):"},{"line_number":1758,"context_line":"            with mock.patch.object(self.conductor.network_api,"},{"line_number":1759,"context_line":"                                   \u0027deallocate_for_instance\u0027) as deallocate:"},{"line_number":1760,"context_line":"                with mock.patch.object(fake_inst, \u0027save\u0027) as mock_save:"},{"line_number":1761,"context_line":"                    self.conductor._cleanup_allocated_networks("},{"line_number":1762,"context_line":"                        self.context, fake_inst, req_net)"},{"line_number":1763,"context_line":"        deallocate.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_32ae0ee8","line":1760,"range":{"start_line":1758,"start_character":0,"end_line":1760,"end_character":71},"updated":"2016-06-02 08:03:20.000000000","message":"Ditto","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"},{"author":{"_account_id":18320,"name":"Dao Cong Tien","email":"tiendc@vn.fujitsu.com","username":"TienDC"},"change_message_id":"64dace48c331c22c1ba7513bb8c7a6950741a933","unresolved":false,"context_lines":[{"line_number":1760,"context_line":"                with mock.patch.object(fake_inst, \u0027save\u0027) as mock_save:"},{"line_number":1761,"context_line":"                    self.conductor._cleanup_allocated_networks("},{"line_number":1762,"context_line":"                        self.context, fake_inst, req_net)"},{"line_number":1763,"context_line":"        deallocate.assert_called_once_with("},{"line_number":1764,"context_line":"            self.context, fake_inst, requested_networks\u003dreq_net)"},{"line_number":1765,"context_line":"        self.assertEqual(\u0027False\u0027,"},{"line_number":1766,"context_line":"                         fake_inst.system_metadata[\u0027network_allocated\u0027],"},{"line_number":1767,"context_line":"                         fake_inst.system_metadata)"},{"line_number":1768,"context_line":"        mock_save.assert_called_once_with()"},{"line_number":1769,"context_line":""},{"line_number":1770,"context_line":""},{"line_number":1771,"context_line":"class ConductorTaskRPCAPITestCase(_BaseTaskTestCase,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9abb7d3a_f27ac676","line":1768,"range":{"start_line":1763,"start_character":0,"end_line":1768,"end_character":43},"updated":"2016-06-02 08:03:20.000000000","message":"Ditto","commit_id":"8f6c2c9afc1a5781ec877711e430536222dbcdad"}]}
