Commit 6bb258a7 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix ganeti-rapi startup with missing certificate

This patch displays a nicer error message compared to the default
stacktrace.

Reviewed-by: imsnah
parent 0f6be82a
......@@ -207,8 +207,12 @@ def main():
if options.ssl:
# Read SSL certificate
ssl_params = http.HttpSslParams(ssl_key_path=options.ssl_key,
ssl_cert_path=options.ssl_cert)
try:
ssl_params = http.HttpSslParams(ssl_key_path=options.ssl_key,
ssl_cert_path=options.ssl_cert)
except Exception, err:
sys.stderr.write("Can't load the SSL certificate/key: %s\n" % (err,))
sys.exit(1)
else:
ssl_params = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment