ashb commented on a change in pull request #4028: [AIRFLOW-3099] Don't ever
warn about missing sections of config
URL: https://github.com/apache/incubator-airflow/pull/4028#discussion_r223998136
##########
File path: airflow/bin/cli.py
##########
@@ -519,25 +500,7 @@ def run(args, dag=None):
if os.path.exists(args.cfg_path):
os.remove(args.cfg_path)
- # Do not log these properties since some may contain passwords.
- # This may also set default values for database properties like
- # core.sql_alchemy_pool_size
- # core.sql_alchemy_pool_recycle
- for section, config in conf_dict.items():
- for option, value in config.items():
- try:
- conf.set(section, option, value)
- except NoSectionError:
- no_section_msg = (
- 'Section {section} Option {option} '
- 'does not exist in the config!'
- ).format(section=section, option=option)
-
- if section in OPTIONAL_AIRFLOW_CFG_SECTIONS:
- log.debug(no_section_msg)
- else:
- log.error(no_section_msg)
-
+ conf.conf.read_dict(conf_dict, source=args.cfg_path)
Review comment:
If there are any errors it will display the filename as the source, instead
of the default of `<dict>` (unlikely here, as the dict as already parsed but
it's an arg the method takes so it makes sense to use it)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services