Skip to content

Commit

Permalink
[CX-16591] Fix regex to work with impersonated clusters like airflow_…
Browse files Browse the repository at this point in the history
…scheduler_ddavydov (twitter-forks#42)
  • Loading branch information
aoen authored and K Sampreeth Prem committed Apr 26, 2022
1 parent ac1562c commit 49797bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49797bc

Please sign in to comment.