From 78d017223c2508327dacbdae8c43d5ecb50f5bc0 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Mon, 11 Oct 2021 22:23:53 -0600 Subject: [PATCH] Invalid config should be a nonzero exit --- projects/hatctl/src/python/hatctl/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hatctl/src/python/hatctl/__main__.py b/projects/hatctl/src/python/hatctl/__main__.py index 1816a6b..542c560 100644 --- a/projects/hatctl/src/python/hatctl/__main__.py +++ b/projects/hatctl/src/python/hatctl/__main__.py @@ -169,7 +169,6 @@ if __name__ == "__main__": sys.exit() # Read configruation file - # config = {} if os.path.isfile("/etc/default/clusterctrl"): with open ("/etc/default/clusterctrl") as configfile: @@ -180,7 +179,8 @@ if __name__ == "__main__": # If we're not a controller of some sort exit cleanly if ("type" not in config or not (config["type"] == "c" or config["type"] == "cnat")): - sys.exit() + print("Unable to load config, or invalid config loaded", file=sys.stderr) + sys.exit(1) # Functions # Send command to ClusterCTRL via I2C