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: Ic72358097e3a476e20fa3713008d0d0bcd35463echanges/34/653434/1
parent
b36bf8abb7
commit
6f995d1fb2
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue