)]}'
{"rally/plugins/openstack/context/network/networks.py":[{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"1aaddcff9a61af0c54f5965a9c35f2553c9be1e4","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                networks_id_list \u003d []"},{"line_number":100,"context_line":"                list_networks \u003d net_wrapper.list_networks()"},{"line_number":101,"context_line":"                for index in xrange(len(list_networks)):"},{"line_number":102,"context_line":"                    networks_id_list.append(list_networks[index][\"id\"])"},{"line_number":103,"context_line":"                LOG.debug(\"Networks exist in neutron is %s\" % networks_id_list)"},{"line_number":104,"context_line":"                if network[\"id\"] and network[\"id\"] in networks_id_list:"},{"line_number":105,"context_line":"                    with logging.ExceptionLogger("}],"source_content_type":"text/x-python","patch_set":1,"id":"bab6814e_11d31fd6","line":102,"updated":"2016-05-23 13:18:39.000000000","message":"a) Please don\u0027t do this list inside the loop. You can list the networks once and get a pretty significant performance boost.\n\nb) These four lines can be done much more succinctly:\n\nnetwork_id_list \u003d [n[\"id\"] for n in net_wrapper.list_networks()]\n\nc) Checking for each network ID in the list of known network IDs is racy. Eliminate this entirely and catch and inspect exceptions instead.","commit_id":"7551fd56312a369e43a543143cbb5d21c792db82"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"0eccd904493d6c6523b52394014d628c00a89e27","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            osclients.Clients(self.context[\"admin\"][\"credential\"]),"},{"line_number":95,"context_line":"            self, config\u003dself.config)"},{"line_number":96,"context_line":"        network_id_list \u003d [n[\"id\"] for n in net_wrapper.list_networks()]"},{"line_number":97,"context_line":"        LOG.debug(\"Networks exist in neutron is %s\" % network_id_list)"},{"line_number":98,"context_line":"        for tenant_id, tenant_ctx in six.iteritems(self.context[\"tenants\"]):"},{"line_number":99,"context_line":"            for network in tenant_ctx.get(\"networks\", []):"},{"line_number":100,"context_line":"                LOG.debug(\"Network to be deleted is %s\" % network[\"id\"])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_e1dad0e8","line":97,"updated":"2016-05-24 12:51:34.000000000","message":"This could potentially be a very large log message, and we\u0027ll get each network that Rally actually cares about logged individually below, so let\u0027s remove this message.","commit_id":"fceda24cbd289c6688a4fa10b8a40bf3fb141d31"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"0eccd904493d6c6523b52394014d628c00a89e27","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                            % tenant_id):"},{"line_number":106,"context_line":"                        net_wrapper.delete_network(network)"},{"line_number":107,"context_line":"                else:"},{"line_number":108,"context_line":"                    LOG.warning(\"Network %s doesn\u0027t exist\" % network[\"id\"])"},{"line_number":109,"context_line":"                    pass"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_a1e728ab","line":108,"updated":"2016-05-24 12:51:34.000000000","message":"Let\u0027s clarify this message to something like:\n\n\"Network %s has already been deleted\"","commit_id":"fceda24cbd289c6688a4fa10b8a40bf3fb141d31"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"0eccd904493d6c6523b52394014d628c00a89e27","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                        net_wrapper.delete_network(network)"},{"line_number":107,"context_line":"                else:"},{"line_number":108,"context_line":"                    LOG.warning(\"Network %s doesn\u0027t exist\" % network[\"id\"])"},{"line_number":109,"context_line":"                    pass"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_21e5f8a7","line":109,"updated":"2016-05-24 12:51:34.000000000","message":"pass isn\u0027t necessary here.","commit_id":"fceda24cbd289c6688a4fa10b8a40bf3fb141d31"}],"tests/unit/plugins/openstack/context/network/test_network.py":[{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"1aaddcff9a61af0c54f5965a9c35f2553c9be1e4","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    @mock.patch(NET + \"wrap\")"},{"line_number":92,"context_line":"    def test_cleanup(self, mock_wrap, mock_clients):"},{"line_number":93,"context_line":"        net_context \u003d network_context.Network(self.get_context())"},{"line_number":94,"context_line":"        net_context.cleanup()"}],"source_content_type":"text/x-python","patch_set":1,"id":"bab6814e_91f6ef5a","line":94,"updated":"2016-05-23 13:18:39.000000000","message":"You\u0027ve made this test a no-op, which isn\u0027t okay. It needs to actually test the cleanup() function.","commit_id":"7551fd56312a369e43a543143cbb5d21c792db82"},{"author":{"_account_id":21528,"name":"chenhb","email":"chen.haibing1@zte.com.cn","username":"chenhb"},"change_message_id":"64177cb8cf316753707c5f4f51d067ab2d887d66","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    def test_cleanup(self, mock_wrap, mock_clients):"},{"line_number":93,"context_line":"        net_context \u003d network_context.Network(self.get_context())"},{"line_number":94,"context_line":"        net_context.cleanup()"},{"line_number":95,"context_line":"        for tenant_id, tenant_ctx in net_context.context[\"tenants\"].items():"},{"line_number":96,"context_line":"            self.assertNotEqual(\"bar_tenant-net\", tenant_ctx[\"networks\"])"},{"line_number":97,"context_line":"            self.assertNotEqual(\"foo_tenant-net\", tenant_ctx[\"networks\"])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_a9c3a089","line":95,"updated":"2016-05-24 08:35:51.000000000","message":"I think they should be all tested that network_id_list contains network[\"id\"] and not.","commit_id":"fceda24cbd289c6688a4fa10b8a40bf3fb141d31"},{"author":{"_account_id":11748,"name":"Chris St. Pierre","email":"cstpierr@cisco.com","username":"stpierre"},"change_message_id":"0eccd904493d6c6523b52394014d628c00a89e27","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        net_context.cleanup()"},{"line_number":95,"context_line":"        for tenant_id, tenant_ctx in net_context.context[\"tenants\"].items():"},{"line_number":96,"context_line":"            self.assertNotEqual(\"bar_tenant-net\", tenant_ctx[\"networks\"])"},{"line_number":97,"context_line":"            self.assertNotEqual(\"foo_tenant-net\", tenant_ctx[\"networks\"])"}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_a111e85f","line":97,"updated":"2016-05-24 12:51:34.000000000","message":"This unit test is still woefully incomplete. You need to ensure that all of the networks that the network context cares about are deleted as the original unit test did. In order to test your new functionality, you\u0027ll also want to mock out list_networks() and return a list of fake networks so that we\u0027re also testing that a) networks not created by the context are not deleted; and b) networks that have already been deleted are handled gracefully.","commit_id":"fceda24cbd289c6688a4fa10b8a40bf3fb141d31"}]}
