From 98ca8ce7a68d18533f3bf85097490c5b66e9f876 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 11 Apr 2017 13:13:32 -0400 Subject: [PATCH] Update config overhaul branch for introduction of galaxy.web.stack package. --- lib/galaxy/web/framework/webapp.py | 24 ++++++++++-------------- lib/galaxy/webapps/galaxy/buildapp.py | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/galaxy/web/framework/webapp.py b/lib/galaxy/web/framework/webapp.py index 28bb34ab485..4e093441bdb 100644 --- a/lib/galaxy/web/framework/webapp.py +++ b/lib/galaxy/web/framework/webapp.py @@ -27,7 +27,6 @@ from galaxy.exceptions import MessageException from galaxy import util from galaxy.util import asbool from galaxy.util import safe_str_cmp -from galaxy.util.postfork import process_is_uwsgi from galaxy.util.sanitize_html import sanitize_html from galaxy.managers import context @@ -959,21 +958,18 @@ def build_native_uwsgi_app( paste_factory, config_section ): """uwsgi can load paste factories with --ini-paste, but this builds non-paste uwsgi apps. In particular these are useful with --yaml or --json for config.""" - if not process_is_uwsgi: + import uwsgi + uwsgi_opt = uwsgi.opt + config_file = uwsgi_opt.get("yaml") or uwsgi_opt.get("json") + if not config_file: + # Probably loaded via --ini-paste - expect paste app. return None - else: - import uwsgi - uwsgi_opt = uwsgi.opt - config_file = uwsgi_opt.get("yaml") or uwsgi_opt.get("json") - if not config_file: - # Probably loaded via --ini-paste - expect paste app. - return None - uwsgi_app = paste_factory(uwsgi.opt, load_app_kwds={ - "config_file": config_file, - "config_section": config_section, - }) - return uwsgi_app + uwsgi_app = paste_factory(uwsgi.opt, load_app_kwds={ + "config_file": config_file, + "config_section": config_section, + }) + return uwsgi_app def build_url_map( app, global_conf, local_conf ): diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index b425d89f870..12937cdafac 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -157,6 +157,8 @@ def paste_app_factory( global_conf, **kwargs ): def uwsgi_app_factory(): + # TODO: synchronize with galaxy.web.framework.webapp.build_native_uwsgi_app - should + # at least be using nice_config_parser for instance. import uwsgi root = os.path.abspath(uwsgi.opt.get('galaxy_root', os.getcwd())) config_file = uwsgi.opt.get('galaxy_config_file', os.path.join(root, 'config', 'galaxy.ini'))