)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"63ca5ab18670a7a060a0d4e004a03ceabbb8876f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"so these get mapped to their id\u0027s first and then updated in"},{"line_number":13,"context_line":"search_opts dict which is passed for retrieving instances."},{"line_number":14,"context_line":"For the admin tab this call[1] was happening prior to"},{"line_number":15,"context_line":"non-api filters mapping[2] , so in-order to work a second call"},{"line_number":16,"context_line":"with updated search_opts dict should be called."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"[1] .https://opendev.org/openstack/horizon/src/branch/master/openstack_dashboard/dashboards/admin/instances/views.py#L154"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7f6b1bfe_6cef7487","line":16,"range":{"start_line":15,"start_character":32,"end_line":16,"end_character":47},"updated":"2020-10-14 04:42:34.000000000","message":"In my idea in patch set 2, there is no second call. The commit message needs to be updated.","commit_id":"480340cb0d70a46f359d01002494edf584cc460f"}],"openstack_dashboard/dashboards/admin/instances/tests.py":[{"author":{"_account_id":29313,"name":"Vishal Manchanda","email":"manchandavishal143@gmail.com","username":"vishalmanchanda"},"change_message_id":"f84c458ba8e0b81ee384c3ff4db8ec9c8c7aa0eb","unresolved":false,"context_lines":[{"line_number":540,"context_line":"            [server.image.id for server in servers])"},{"line_number":541,"context_line":"        self.mock_flavor_list.assert_called_once_with(test.IsHttpRequest())"},{"line_number":542,"context_line":"        search_opts \u003d {\u0027marker\u0027: marker, \u0027paginate\u0027: True, \u0027all_tenants\u0027: True}"},{"line_number":543,"context_line":"        self.mock_server_list_paged.assert_has_calss(["},{"line_number":544,"context_line":"            mock.call(test.IsHttpRequest(),"},{"line_number":545,"context_line":"                      sort_dir\u003d\u0027desc\u0027,"},{"line_number":546,"context_line":"                      search_opts\u003dsearch_opts)])"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_dd005738","line":543,"range":{"start_line":543,"start_character":47,"end_line":543,"end_character":52},"updated":"2020-10-09 06:06:19.000000000","message":"It needs to calss-\u003ecalls","commit_id":"d3e2dd79de2d5942b31b619a7c9ddb82be53b12c"}],"openstack_dashboard/dashboards/admin/instances/views.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ee96efea1d60e6b27a0b7ed4de5a83f2a78409b3","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            return []"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        # Second Call to get instances with updated search_opts"},{"line_number":171,"context_line":"        instances \u003d self._get_instances(search_opts, sort_dir)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # Loop through instances to get image, flavor and tenant info."},{"line_number":174,"context_line":"        for inst in instances:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fe4a5580","line":171,"updated":"2020-10-12 09:48:45.000000000","message":"Calling the server list API twice is not a lightweight task.\n\nI wonder the first call of _get_instance() is really required. Looking at the code here, the result of the first _get_instance() is used  to determine the interested instance ID for _get_images(). The purpose of _get_images() is to get a corresponding image ID that is passed to the nova server list API.\n\nHowever, when \u0027image_name\u0027 is passed as a filter, you can get a corresponding image ID just by calling the image list API of glance with a query parameter like \u0027images?name\u003d\u003cspecified image name\u003e\u0027 [1]. At least it can be done in the glance API. I haven\u0027t checked it can be done via glanceclient and the horizon API wrapper, but avoiding the same API call twice is much appreciated.\n\nAs summary, my suggestion is if non API filter(s) are passed, let\u0027s resolve names first before calling the server list API. Otherwise let\u0027s retrieve related image information after calling the server list API.\n\n[1] https://docs.openstack.org/api-ref/image/v2/index.html?expanded\u003dlist-images-detail#list-images","commit_id":"5c56c1120389992430c0b4a487d1d2ee7a27b7aa"},{"author":{"_account_id":6914,"name":"Tatiana Ovchinnikova","email":"t.v.ovtchinnikova@gmail.com","username":"tmazur"},"change_message_id":"4367bc186c3922027cedb74907465f0a2e0f919e","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            return []"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        # Second Call to get instances with updated search_opts"},{"line_number":171,"context_line":"        instances \u003d self._get_instances(search_opts, sort_dir)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # Loop through instances to get image, flavor and tenant info."},{"line_number":174,"context_line":"        for inst in instances:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_73391740","line":171,"in_reply_to":"9f560f44_fe4a5580","updated":"2020-10-13 22:13:53.000000000","message":"+1","commit_id":"5c56c1120389992430c0b4a487d1d2ee7a27b7aa"}]}
