From 0f275b1bf3e24f7fb62e0cf8e2abe5eb8c45d929 Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Wed, 14 May 2025 23:42:05 +0300 Subject: Revert "cleanup, comments for common module" This reverts commit 0cdd22fd88b00bc939eac7824bb1063f675cba84. --- modules/telegraf/testing.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/telegraf/testing.py (limited to 'modules') diff --git a/modules/telegraf/testing.py b/modules/telegraf/testing.py new file mode 100644 index 0000000..d049bbf --- /dev/null +++ b/modules/telegraf/testing.py @@ -0,0 +1,17 @@ +import toml + +def modify_input(template, new_pipeline_path, key, value): + data = toml.load(template) + pluggin = data["inputs"]["http"][0] + + if key in pluggin: + + print(f"Before: {key} = {http_input[key]}") + http_input[key] = value + print(f"After: {key} = {http_input[key]}") + + + with open(new_pipeline_path, "w") as f: + toml.dump(data, f) + +modify_input("templates/basic_ETL.toml", "test_pipers.toml, "urls", ["stillTesting"]) -- cgit v1.2.3