Skip to content

Commit

Permalink
Remove hack by only importing when configured
Browse files Browse the repository at this point in the history
  • Loading branch information
bolkedebruin committed Nov 20, 2015
1 parent bc19b50 commit 5881436
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions airflow/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@
from airflow.executors.local_executor import LocalExecutor
from airflow.executors.sequential_executor import SequentialExecutor

# TODO Fix this emergency fix
try:
from airflow.executors.celery_executor import CeleryExecutor
except:
pass
try:
from airflow.contrib.executors.mesos_executor import MesosExecutor
except:
pass

from airflow.utils import AirflowException

_EXECUTOR = configuration.get('core', 'EXECUTOR')

if _EXECUTOR == 'LocalExecutor':
DEFAULT_EXECUTOR = LocalExecutor()
elif _EXECUTOR == 'CeleryExecutor':
from airflow.executors.celery_executor import CeleryExecutor
DEFAULT_EXECUTOR = CeleryExecutor()
elif _EXECUTOR == 'SequentialExecutor':
DEFAULT_EXECUTOR = SequentialExecutor()
elif _EXECUTOR == 'MesosExecutor':
from airflow.contrib.executors.mesos_executor import MesosExecutor
DEFAULT_EXECUTOR = MesosExecutor()
else:
# Loading plugins
Expand Down

0 comments on commit 5881436

Please sign in to comment.