From 6f995d1fb2f97f4221053ff9edda6b1ab0409b00 Mon Sep 17 00:00:00 2001 From: Bryan Strassner Date: Wed, 17 Apr 2019 08:36:35 -0500 Subject: [PATCH] Update upgrade_airflow_worker.sh script The current script is fragile to the introduction of a DEBUG logging level. This change addresses the specifics of logging records being returned when invoking the airflow command enough to make the dag_status result end up being the last result as the script desires, so the script is returned to working order, even if the logging level is set to DEBUG. This change goes a little further to the point of removing all records that indicate a logging level of DEBUG|INFO|WARN|ERROR. Change-Id: Ic72358097e3a476e20fa3713008d0d0bcd35463e --- images/airflow/script/upgrade_airflow_worker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/airflow/script/upgrade_airflow_worker.sh b/images/airflow/script/upgrade_airflow_worker.sh index cde1238c..328cfee0 100755 --- a/images/airflow/script/upgrade_airflow_worker.sh +++ b/images/airflow/script/upgrade_airflow_worker.sh @@ -63,7 +63,8 @@ do cd "${0%/*}" # Get current state of dag using Airflow CLI - check_dag_state=`airflow dag_state ${dag_id} ${dag_execution_date}` + # Use grep to remove logging messages that can pollute the status response + check_dag_state=`airflow dag_state ${dag_id} ${dag_execution_date} | grep -vE "DEBUG|INFO|WARN|ERROR"` echo -e ${check_dag_state} >> /usr/local/airflow/upgrade_airflow_worker.log # We will need to extract the last word in the 'check_dag_state'