amoghrajesh commented on code in PR #29926:
URL: https://github.com/apache/airflow/pull/29926#discussion_r1134171101
##########
airflow/configuration.py:
##########
@@ -1531,14 +1531,28 @@ def initialize_config() -> AirflowConfigParser:
if local_conf.getboolean("core", "unit_test_mode"):
local_conf.load_test_config()
- # Make it no longer a proxy variable, just set it to an actual string
+ old_webserver_config = AIRFLOW_HOME + "/webserver_config.py"
+ # Prioritise airflow webserver config that is present in the config
location
+ webserver_config_in_config = AIRFLOW_HOME + "/config/webserver_config.py"
+
global WEBSERVER_CONFIG
- WEBSERVER_CONFIG = AIRFLOW_HOME + "/webserver_config.py"
+ WEBSERVER_CONFIG = webserver_config_in_config
+
+ msg = (
+ "webserver_config.py is still present in {}, this location is
deprecated. You should move your "
+ "webserver_config.py to {} "
+ )
+
+ msg = msg.format(old_webserver_config, webserver_config_in_config)
+
+ if os.path.isfile(old_webserver_config):
+ warnings.warn(msg, category=DeprecationWarning)
if not os.path.isfile(WEBSERVER_CONFIG):
import shutil
log.info("Creating new FAB webserver config file in: %s",
WEBSERVER_CONFIG)
+ os.makedirs(os.path.dirname(AIRFLOW_HOME + "/config"), exist_ok=True)
Review Comment:
Right makes sense. Thanks for the feedback.
Making the required change.
--
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]