Skip to content

Commit

Permalink
Revert the sequence of initializing configuration defaults (#37155)
Browse files Browse the repository at this point in the history
(cherry picked from commit d987bce)
  • Loading branch information
potiuk committed Feb 13, 2024
1 parent 0dc8c28 commit 662ff2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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


Expand Down

0 comments on commit 662ff2d

Please sign in to comment.