From 78ebd47e0b3b69fba400580a1c75a34695c7fff6 Mon Sep 17 00:00:00 2001 From: Alex Van Boxel Date: Sun, 9 Oct 2016 09:34:42 +0200 Subject: [PATCH] [AIRFLOW-550] Make ssl config check empty string safe This config check on the ssl certificate makes it safe for empty string. The empty string is provided by default configuration settings and could cause the webserver not starting up. Closes #1824 from alexvanboxel/bugfix/airflow-550 --- airflow/bin/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py index 324f869327015..a821aadc2c98d 100755 --- a/airflow/bin/cli.py +++ b/airflow/bin/cli.py @@ -695,10 +695,10 @@ def webserver(args): conf.get('webserver', 'webserver_worker_timeout')) ssl_cert = args.ssl_cert or conf.get('webserver', 'web_server_ssl_cert') ssl_key = args.ssl_key or conf.get('webserver', 'web_server_ssl_key') - if ssl_cert is None and ssl_key is not None: + if not ssl_cert and ssl_key: raise AirflowException( 'An SSL certificate must also be provided for use with ' + ssl_key) - if ssl_cert is not None and ssl_key is None: + if ssl_cert and not ssl_key: raise AirflowException( 'An SSL key must also be provided for use with ' + ssl_cert)