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

potiuk pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 662ff2db80edbe856c1a66e6070e6db3a583d79f
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Feb 3 15:43:38 2024 +0100

    Revert the sequence of initializing configuration defaults (#37155)
    
    (cherry picked from commit d987bce144ac8e42bd269e1971d0ad4f15dcff95)
---
 airflow/configuration.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/configuration.py b/airflow/configuration.py
index e4e3dab4b3..f9a5f608eb 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -1985,6 +1985,8 @@ def write_default_airflow_configuration_if_needed() -> 
AirflowConfigParser:
             FERNET_KEY = _generate_fernet_key()
             conf.remove_option("core", "fernet_key")
             conf.set("core", "fernet_key", FERNET_KEY)
+        pathlib.Path(airflow_config.__fspath__()).touch()
+        make_group_other_inaccessible(airflow_config.__fspath__())
         with open(airflow_config, "w") as file:
             conf.write(
                 file,
@@ -1994,7 +1996,6 @@ def write_default_airflow_configuration_if_needed() -> 
AirflowConfigParser:
                 extra_spacing=True,
                 only_defaults=True,
             )
-        make_group_other_inaccessible(airflow_config.__fspath__())
     return conf
 
 

Reply via email to