Fix passing configuration via WSGI
Commit cb1072413961109d88ed1cc745437a0d1a143682 broke it since command line is not processed in WSGI case. Change-Id: Ice0105e24ab696aeafb3b30be55b3498e16efdc3
This commit is contained in:
parent
cb10724139
commit
569a02c1cc
5
releasenotes/notes/auth-config-7705910e241909c1.yaml
Normal file
5
releasenotes/notes/auth-config-7705910e241909c1.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes configuring the emulator via environment parameters when ``main``
|
||||
is not invoked (e.g. when using WSGI).
|
@ -78,9 +78,10 @@ class Application(flask.Flask):
|
||||
super().__init__(__name__)
|
||||
# Turn off strict_slashes on all routes
|
||||
self.url_map.strict_slashes = False
|
||||
# This is needed for WSGI since it cannot process argv
|
||||
self.configure(config_file=os.environ.get('SUSHY_EMULATOR_CONFIG'))
|
||||
|
||||
def configure(self, config_file=None, extra_config=None):
|
||||
config_file = config_file or os.environ.get('SUSHY_EMULATOR_CONFIG')
|
||||
if config_file:
|
||||
self.config.from_pyfile(config_file)
|
||||
if extra_config:
|
||||
|
Loading…
x
Reference in New Issue
Block a user