-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix #1576 - config file/module in GUNICORN_CMD_ARGS #1581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good. Thank you for writing tests, too! My only question is whether we should override env_args.config
with args.config
so that we're consistent about precedence. But maybe config files are special and you could specify both? It seems overkill maybe, since you could always import one config from another.
gunicorn/app/base.py
Outdated
self.load_config_from_file(args.config) | ||
env_args = parser.parse_args(self.cfg.get_cmd_args_from_env()) | ||
|
||
if args.config or env_args.config: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should one override the other rather than allowing both of these branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that env_args.config
should override args.config
. We should probably document this at http://docs.gunicorn.org/en/latest/settings.html#settings
I can kind of understand why overriding would make sense, but inheriting feels more natural to me. After looking at this more I've realised the hierarchy feels a bit weird (as it was before the patch) as options from the config file on the command line are overridden by arguments from the environment: This also gives the issue that applications don't get augments from the environment, so for applications to get configured properly Blerg. |
Some comments:
|
I think this looks good to merge! Thank you so much, @Code0x58! |
And thanks for your patience. I had my personal laptop melt down last weekend, so I've been a little bit offline more than usually. |
Don't worry, I was delayed too as I was on a mobile for 5 days. Is it worth me putting in a separate PR to either sort the THANKS, or remove the sorting part from CONTRIBUTING? |
I'm fine to keep it sorted. |
Fix benoitc#1576 - config file/module in GUNICORN_CMD_ARGS
I also sorted THANKS.md to follow CONTRIBUTING.md.