From d6e55af9f2421641a5d4c8945869a1463b353272 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sat, 19 Oct 2024 12:07:12 +0200 Subject: search for processes in /usr/bin instead of using wildcard --- __main__.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index 79d6a23..bae42ce 100644 --- a/__main__.py +++ b/__main__.py @@ -1,3 +1,4 @@ +import os import sys import yaml @@ -15,7 +16,19 @@ def main(): yaml_path = Path(sys.argv[1]) yaml_file_paths = yaml_path.glob("*.yaml") - slot_lists = {} + processes = [] + bin_dir = "/usr/bin" + for file in os.listdir(bin_dir): + if file == "[": + continue + + full_path = os.path.join(bin_dir, file) + if os.path.isfile(full_path) or os.path.islink(full_path): + processes.append(file) + + slot_lists = { + "process": TextSlotList.from_strings(processes) + } for yaml_file_path in yaml_file_paths: with open(yaml_file_path, "r", encoding="utf-8") as yaml_file: -- cgit v1.2.3-70-g09d2