From 49797bc662b17b950ff27d4dcc748f96b315a839 Mon Sep 17 00:00:00 2001 From: aoen Date: Tue, 14 Apr 2020 12:21:57 -0400 Subject: [PATCH] [CX-16591] Fix regex to work with impersonated clusters like airflow_scheduler_ddavydov (#42) --- airflow/models/dag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/models/dag.py b/airflow/models/dag.py index 928321bfb6e85..3799ecfac450b 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -2782,7 +2782,7 @@ def get_local_fileloc(self): # the path the webserver uses when it tries to trigger a DAG does not match the # existing scheduler path and the DAG can not be found. # Also, fix for render code on UI by changing "/code" in views.py - path_regex = "airflow_scheduler-.-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[" \ + path_regex = "airflow_scheduler.*-.-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[" \ "0-9a-f]{12}/runs/.*/sandbox/airflow_home" path_split = re.split(path_regex, self.fileloc)[1] return os.environ.get("AIRFLOW_HOME") + path_split