From 3fe9e71540e2f9ecc46b1712bf58c81fb4ca8a40 Mon Sep 17 00:00:00 2001 From: Wojciech Zyla Date: Wed, 17 Apr 2024 13:04:41 +0200 Subject: [PATCH] fix: fix a bug with values.yaml not being loaded to the UI while migrating to SC4SNMP-UI fix: update wrong variable name [run-ui-tests] fix: update CHANGELOG fix: update CHANGELOG --- CHANGELOG.md | 3 +++ splunk_connect_for_snmp/inventory/loader.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b10f2dfb2..28119c71e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ### Changed - add docker compose deployment +### Fixed +- fixed a bug with configuration from values.yaml not being transferred to the UI while migrating to SC4SNMP-UI + ## [1.10.0] ### Changed diff --git a/splunk_connect_for_snmp/inventory/loader.py b/splunk_connect_for_snmp/inventory/loader.py index ef57b21d8..3a9b773f8 100644 --- a/splunk_connect_for_snmp/inventory/loader.py +++ b/splunk_connect_for_snmp/inventory/loader.py @@ -92,6 +92,7 @@ def configure_ui_database(mongo_client): with open(INVENTORY_PATH, encoding="utf-8") as csv_file: ir_reader = DictReader(csv_file) + all_inventory_lines = [] for inventory_line in ir_reader: for key in INVENTORY_KEYS_TRANSFORM.keys(): if key in inventory_line: @@ -117,7 +118,8 @@ def configure_ui_database(mongo_client): inventory_line["port"] = port inventory_line["walk_interval"] = walk_interval if not inventory_line["address"].startswith("#"): - inventory_ui_collection.insert(inventory_line) + all_inventory_lines.append(inventory_line) + inventory_ui_collection.insert_many(all_inventory_lines) groups = {} all_profiles = {}