ashb commented on code in PR #46966:
URL: https://github.com/apache/airflow/pull/46966#discussion_r1965801310
##########
airflow/configuration.py:
##########
@@ -1965,13 +1962,14 @@ def write_default_airflow_configuration_if_needed() ->
AirflowConfigParser:
raise FileNotFoundError(msg) from None
log.debug("Create directory %r for Airflow config",
config_directory.__fspath__())
config_directory.mkdir(parents=True, exist_ok=True)
- if conf.get("core", "fernet_key", fallback=None) is None:
+ if conf.get("core", "fernet_key", fallback=None) in (None, ""):
# We know that FERNET_KEY is not set, so we can generate it, set
as global key
# and also write it to the config file so that same key will be
used next time
- global FERNET_KEY
FERNET_KEY = _generate_fernet_key()
- conf.remove_option("core", "fernet_key")
- conf.set("core", "fernet_key", FERNET_KEY)
+
conf.configuration_description["core"]["options"]["fernet_key"]["default"] =
FERNET_KEY
Review Comment:
This was the crux of the change -- default values are now read from this
dict (which is the loaded version of the loaded config.yml)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]