Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-3099] Complete list of optional airflow.cfg sections #4002

Merged
merged 1 commit into from
Oct 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions airflow/bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,24 @@ def _run(args, dag, ti):

@cli_utils.action_logging
def run(args, dag=None):
# Optional sections won't log an error if they're missing in airflow.cfg.
OPTIONAL_AIRFLOW_CFG_SECTIONS = [
'atlas',
'celery',
'celery_broker_transport_options',
'dask',
'elasticsearch',
'github_enterprise',
'hive',
'kerberos',
'kubernetes',
'kubernetes_node_selectors',
'kubernetes_secrets',
'ldap',
'lineage',
'mesos',
]

if dag:
args.dag_id = dag.dag_id

Expand All @@ -510,18 +528,15 @@ def run(args, dag=None):
try:
conf.set(section, option, value)
except NoSectionError:
optional_sections = [
'atlas', 'mesos', 'elasticsearch', 'kubernetes',
'lineage', 'hive'
]
if section in optional_sections:
log.debug('Section {section} Option {option} '
'does not exist in the config!'.format(section=section,
option=option))
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('Section {section} Option {option} '
'does not exist in the config!'.format(section=section,
option=option))
log.error(no_section_msg)

settings.configure_vars()

Expand Down