Skip to content

Commit

Permalink
Fallback to the original behavior if prefix is not available (#1068)
Browse files Browse the repository at this point in the history
I needed to restore the original behavior because some external
applications was actually relying on the behavior.

https://github.com/apache/incubator-airflow/blob/1.8.0/airflow/bin/cli.py#L775
  • Loading branch information
yyuu committed Apr 11, 2017
1 parent 328e509 commit e0171e8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gunicorn/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ def load_config_from_module_name_or_filename(self, location):
if location.startswith("python:"):
module_name = location[len("python:"):]
cfg = self.get_config_from_module_name(module_name)
else:
if location.startswith("file:"):
filename = location[len("file:"):]
else:
filename = location
elif location.startswith("file:"):
filename = location[len("file:"):]
cfg = self.get_config_from_filename(filename)
else:
# Fallback to the original behavior if prefix is not available (#1068)
try:
cfg = self.get_config_from_module_name(module_name=location)
except ImportError:
cfg = self.get_config_from_filename(filename=location)

for k, v in cfg.items():
# Ignore unknown names
Expand Down

0 comments on commit e0171e8

Please sign in to comment.