From 1a00be09c54a84d937cb975939df604ab6477320 Mon Sep 17 00:00:00 2001 From: kangwork Date: Tue, 13 Aug 2024 16:59:38 +0900 Subject: [PATCH] fix: change option field name 'options.default_filters' --> 'options.default_filter' to sync with console-api Signed-off-by: kangwork --- .../inventory/plugin/collector/lib/metadata_generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spaceone/inventory/plugin/collector/lib/metadata_generator.py b/src/spaceone/inventory/plugin/collector/lib/metadata_generator.py index 0a571d8..f2073fb 100644 --- a/src/spaceone/inventory/plugin/collector/lib/metadata_generator.py +++ b/src/spaceone/inventory/plugin/collector/lib/metadata_generator.py @@ -56,8 +56,8 @@ def _generate_table(self, table_meta: dict) -> dict: "Main Table", "query-search-table" ) if "options" in table_meta: - if "default_filters" in table_meta["options"]: - table_metadata["options"]["default_filters"] = self._generate_filters(table_meta) + if "default_filter" in table_meta["options"]: + table_metadata["options"]["default_filter"] = self._generate_filter(table_meta) if "sort" in table_meta: table_metadata["options"]["default_sort"] = self._generate_sort(table_meta) @@ -146,9 +146,9 @@ def _generate_default_dynamic_view(name, view_type="list", options=None): return {"name": name, "type": view_type, "options": options} @staticmethod - def _generate_filters(table: dict) -> list: + def _generate_filter(table: dict) -> list: filters = [] - filters_field = table["options"]["default_filters"] + filters_field = table["options"]["default_filter"] for filter_dict in filters_field: filter_options = { "key": filter_dict["key"],