diff --git a/clusterman/utils.py b/clusterman/utils.py index 8c24498..a0095b3 100755 --- a/clusterman/utils.py +++ b/clusterman/utils.py @@ -7,6 +7,9 @@ def ssh_exec(host,command,use_key=True): if use_key and len(key_path) > 0: output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "-o", "PasswordAuthentication=no", "-i", CONF["ssh"]["key_path"],"{}@{}".format(user,host), command]) return output.decode("utf-8") + else if use_key: + print("Configuration variable \"key_path\" is not set") + sys.exit(1) else: output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "{}@{}".format(user,host), command]) return output.decode("utf-8")