From ea112210873204d8dab67c58b7cb9dbf995228af Mon Sep 17 00:00:00 2001 From: Ignatious Johnson Date: Sun, 30 Aug 2020 10:20:00 -0700 Subject: [PATCH] object_list method, when listing all objects of a resource type without filters calls filter_rows_no_anchor method unnecessarily when there is no filters in the request. Fixed it by returning early with count of columns read from the OBJ_FQ_NAME_TABLE. Closes-Jira-Bug: CEM-18858 Signed-off-by: Ignatious Johnson Change-Id: I9975d0b23d72277fbf60abcad4f57101296ce6c3 --- src/config/common/cfgm_common/vnc_cassandra.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config/common/cfgm_common/vnc_cassandra.py b/src/config/common/cfgm_common/vnc_cassandra.py index 7f04713fdca..bfa0f64a7ff 100644 --- a/src/config/common/cfgm_common/vnc_cassandra.py +++ b/src/config/common/cfgm_common/vnc_cassandra.py @@ -1007,6 +1007,10 @@ def filter_rows_no_anchor(): return list(filt_obj_infos.values()), marker # end filter_rows_no_anchor + if count and not filters: + # when listing all objects of a type + # return early if only count query is in request + return (True, sum(1 for col in cols), None) filtered_rows, ret_marker = filter_rows_no_anchor() children_fq_names_uuids.extend(filtered_rows)