This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new d7899ecfaf Bring back automated airflow home dir creation (#32755)
d7899ecfaf is described below

commit d7899ecfafb20cc58f8fb43e287d1c6778b8fa9f
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Jul 21 23:22:21 2023 +0200

    Bring back automated airflow home dir creation (#32755)
    
    The #32604 moved initialization of airflow config to after config
    initialization but webserver config is still in initialization
    part. Previously when the AIRFLOW_HOME folder was missing, it was
    created during config writing but it needs to be created now
    before webserver config is written.
---
 airflow/configuration.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/airflow/configuration.py b/airflow/configuration.py
index 86d3ca5252..317c10c013 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -2008,6 +2008,7 @@ def initialize_config() -> AirflowConfigParser:
     if not os.path.isfile(WEBSERVER_CONFIG):
         import shutil
 
+        pathlib.Path(WEBSERVER_CONFIG).parent.mkdir(parents=True, 
exist_ok=True)
         log.info("Creating new FAB webserver config file in: %s", 
WEBSERVER_CONFIG)
         shutil.copy(_default_config_file_path("default_webserver_config.py"), 
WEBSERVER_CONFIG)
     return airflow_config_parser

Reply via email to