From 53874f88c99a7c0d9a5c8cc27d2829f0a87f5352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Sat, 4 Mar 2023 15:29:22 +0100 Subject: [PATCH 1/3] [mod] examples --- examples/{test-1.hmdl.json => file_state.hmdl.json} | 2 +- examples/{test.hmdl.json => main.hmdl.json} | 4 ++-- examples/{test-2.hmdl.json => script.hmdl.json} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename examples/{test-1.hmdl.json => file_state.hmdl.json} (89%) rename examples/{test.hmdl.json => main.hmdl.json} (82%) rename examples/{test-2.hmdl.json => script.hmdl.json} (85%) diff --git a/examples/test-1.hmdl.json b/examples/file_state.hmdl.json similarity index 89% rename from examples/test-1.hmdl.json rename to examples/file_state.hmdl.json index 7d4b159..ec3aa48 100644 --- a/examples/test-1.hmdl.json +++ b/examples/file_state.hmdl.json @@ -1,7 +1,7 @@ { "checks": [ { - "name": "test", + "name": "test1", "kind": "file_state", "parameters": { "path": "/tmp/test", diff --git a/examples/test.hmdl.json b/examples/main.hmdl.json similarity index 82% rename from examples/test.hmdl.json rename to examples/main.hmdl.json index 4682f5f..798bd49 100644 --- a/examples/test.hmdl.json +++ b/examples/main.hmdl.json @@ -14,7 +14,7 @@ ] }, "includes": [ - "test-1.hmdl.json", - "test-2.hmdl.json" + "script.hmdl.json", + "file_state.hmdl.json" ] } diff --git a/examples/test-2.hmdl.json b/examples/script.hmdl.json similarity index 85% rename from examples/test-2.hmdl.json rename to examples/script.hmdl.json index 60fc349..f22ca47 100644 --- a/examples/test-2.hmdl.json +++ b/examples/script.hmdl.json @@ -1,7 +1,7 @@ { "checks": [ { - "name": "test", + "name": "test1", "kind": "script", "parameters": { "path": "/tmp/script", From 96a059382e78a7821e2061d91539d8efd5d9aa0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Sat, 4 Mar 2023 15:29:37 +0100 Subject: [PATCH 2/3] [fix] tools:build --- tools/build | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/build b/tools/build index 621c89f..9cc49d7 100755 --- a/tools/build +++ b/tools/build @@ -47,7 +47,6 @@ def main(): _os.path.join(dir_source, "logic", "checks", "script.py"), _os.path.join(dir_source, "logic", "checks", "file_state.py"), _os.path.join(dir_source, "logic", "checks", "http_request.py"), - _os.path.join(dir_source, "logic", "checks", "generic_remote.py"), _os.path.join(dir_source, "logic", "channels", "_interface.py"), _os.path.join(dir_source, "logic", "channels", "console.py"), _os.path.join(dir_source, "logic", "channels", "email.py"), @@ -67,7 +66,6 @@ def main(): _os.path.join(dir_source, "logic", "checks", "script.py"), _os.path.join(dir_source, "logic", "checks", "file_state.py"), _os.path.join(dir_source, "logic", "checks", "http_request.py"), - _os.path.join(dir_source, "logic", "checks", "generic_remote.py"), _os.path.join(dir_source, "logic", "channels", "_interface.py"), _os.path.join(dir_source, "logic", "channels", "console.py"), _os.path.join(dir_source, "logic", "channels", "email.py"), From 326d79b6668d6be7f8264e231eaf139914f316f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Sat, 4 Mar 2023 15:29:53 +0100 Subject: [PATCH 3/3] [mod] inclusion prefixing --- source/logic/conf.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/source/logic/conf.py b/source/logic/conf.py index 3bb50f3..4b56a8d 100644 --- a/source/logic/conf.py +++ b/source/logic/conf.py @@ -321,24 +321,6 @@ def conf_normalize_check( if True: node__["parameters"] = check_kind_implementations[node_["kind"]].normalize_conf_node(node_["parameters"]) return node__ - ''' - return { - "name": node_["name"], - "title": node_["title"], - "active": node_["active"], - "threshold": node_["threshold"], - "annoy": node_["annoy"], - "schedule": conf_normalize_schedule(node_["schedule"]), - "notifications": list( - map( - lambda x: conf_normalize_notification(notification_channel_implementations, x), - node_["notifications"] - ) - ), - "kind": node_["kind"], - "parameters": check_kind_implementations[node_["kind"]].normalize_conf_node(node_["parameters"]), - } - ''' def conf_normalize_root( @@ -455,9 +437,9 @@ def conf_load( check, { "name": string_coin( - "x{{number}}.{{original_name}}", + "{{prefix}}.{{original_name}}", { - "number": ("%u" % (index + 1)), + "prefix": _os.path.basename(path_).split(".")[0], "original_name": check["name"], } ),