Invalid config should be a nonzero exit
This commit is contained in:
parent
17034424c2
commit
b18edf1c4a
1 changed files with 2 additions and 2 deletions
|
@ -169,7 +169,6 @@ if __name__ == "__main__":
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# Read configruation file
|
# Read configruation file
|
||||||
#
|
|
||||||
config = {}
|
config = {}
|
||||||
if os.path.isfile("/etc/default/clusterctrl"):
|
if os.path.isfile("/etc/default/clusterctrl"):
|
||||||
with open ("/etc/default/clusterctrl") as configfile:
|
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 we're not a controller of some sort exit cleanly
|
||||||
if ("type" not in config or not (config["type"] == "c" or config["type"] == "cnat")):
|
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
|
# Functions
|
||||||
# Send command to ClusterCTRL via I2C
|
# Send command to ClusterCTRL via I2C
|
||||||
|
|
Loading…
Reference in a new issue