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-3.hmdl.json b/examples/generic_remote.hmdl.json similarity index 100% rename from examples/test-3.hmdl.json rename to examples/generic_remote.hmdl.json diff --git a/examples/test.hmdl.json b/examples/main.hmdl.json similarity index 72% rename from examples/test.hmdl.json rename to examples/main.hmdl.json index 0b5f1fc..0ea0fb2 100644 --- a/examples/test.hmdl.json +++ b/examples/main.hmdl.json @@ -14,8 +14,8 @@ ] }, "includes": [ - "test-1.hmdl.json", - "test-2.hmdl.json", - "test-3.hmdl.json" + "script.hmdl.json", + "file_state.hmdl.json", + "generic_remote.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", 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"], } ), 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"),