Merge lp:~cjwatson/convoy/wsgi-environ into lp:~launchpad/convoy/packaging

Proposed by Colin Watson
Status: Merged
Merged at revision: 35
Proposed branch: lp:~cjwatson/convoy/wsgi-environ
Merge into: lp:~launchpad/convoy/packaging
Diff against target: 34 lines (+16/-1)
2 files modified
debian/changelog (+7/-0)
debian/convoy.wsgi (+9/-1)
To merge this branch: bzr merge lp:~cjwatson/convoy/wsgi-environ
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+331611@code.launchpad.net

Commit message

CONVOY_ROOT comes from the request environment under mod_wsgi. Adjust
the previous change so that it copes with both mod_wsgi and gunicorn.

To post a comment you must log in.
lp:~cjwatson/convoy/wsgi-environ updated
36. By Colin Watson

Fix indentation.

Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2017-09-20 11:25:00 +0000
+++ debian/changelog 2017-09-30 01:09:32 +0000
@@ -1,3 +1,10 @@
1convoy (0.4.4+bzr39-0lp4) UNRELEASED; urgency=medium
2
3 * CONVOY_ROOT comes from the request environment under mod_wsgi. Adjust
4 the previous change so that it copes with both mod_wsgi and gunicorn.
5
6 -- Colin Watson <cjwatson@ubuntu.com> Fri, 29 Sep 2017 21:06:49 -0400
7
1convoy (0.4.4+bzr39-0lp3) xenial; urgency=medium8convoy (0.4.4+bzr39-0lp3) xenial; urgency=medium
29
3 * Fix CONVOY_ROOT handling in convoy.wsgi: this must come from the process10 * Fix CONVOY_ROOT handling in convoy.wsgi: this must come from the process
411
=== modified file 'debian/convoy.wsgi'
--- debian/convoy.wsgi 2017-09-20 11:23:56 +0000
+++ debian/convoy.wsgi 2017-09-30 01:09:32 +0000
@@ -19,6 +19,14 @@
19from convoy.combo import combo_app19from convoy.combo import combo_app
2020
21def application(environ, start_response):21def application(environ, start_response):
22 root = os.environ.get('CONVOY_ROOT', '/srv/launchpad.dev/convoy')22 # CONVOY_ROOT may be set by SetEnv in Apache configuration, in which
23 # case mod_wsgi passes it in the request environment. (This is safe
24 # because HTTP headers end up in HTTP_*.)
25 root = environ.get('CONVOY_ROOT')
26 if root is None:
27 # Alternatively, convoy may be run under a standalone WSGI server
28 # such as gunicorn, in which case we need to look for CONVOY_ROOT in
29 # the process environment.
30 root = os.environ.get('CONVOY_ROOT', '/srv/launchpad.dev/convoy')
23 app = combo_app(root)31 app = combo_app(root)
24 return app(environ, start_response)32 return app(environ, start_response)

Subscribers

People subscribed via source and target branches