~ubuntu-branches/ubuntu/vivid/swift/vivid-updates

« back to all changes in this revision

Viewing changes to swift/common/wsgi.py

  • Committer: Package Import Robot
  • Author(s): James Page, Chuck Short, James Page
  • Date: 2014-10-06 10:06:11 UTC
  • mfrom: (1.2.31)
  • Revision ID: package-import@ubuntu.com-20141006100611-wdzkkuoru7ubtlml
Tags: 2.1.0-0ubuntu1
[ Chuck Short ]
* debian/patches/fix-doc-no-network.patch: Refreshed.
* debian/control: Add python-oslosphinx as a build dependency.

[ James Page ]
* New upstream release for OpenStack Juno.
* d/copyright: Add linebreaks to fixup file-without-copyright-
  information warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
"""WSGI tools for use with swift."""
17
17
 
 
18
from __future__ import print_function
 
19
 
18
20
import errno
 
21
import inspect
19
22
import os
20
23
import signal
21
24
import time
386
389
    max_clients = int(conf.get('max_clients', '1024'))
387
390
    pool = RestrictedGreenPool(size=max_clients)
388
391
    try:
389
 
        wsgi.server(sock, app, NullLogger(), custom_pool=pool)
 
392
        # Disable capitalizing headers in Eventlet if possible.  This is
 
393
        # necessary for the AWS SDK to work with swift3 middleware.
 
394
        argspec = inspect.getargspec(wsgi.server)
 
395
        if 'capitalize_response_headers' in argspec.args:
 
396
            wsgi.server(sock, app, NullLogger(), custom_pool=pool,
 
397
                        capitalize_response_headers=False)
 
398
        else:
 
399
            wsgi.server(sock, app, NullLogger(), custom_pool=pool)
390
400
    except socket.error as err:
391
401
        if err[0] != errno.EINVAL:
392
402
            raise
407
417
        (conf, logger, log_name) = \
408
418
            _initrp(conf_path, app_section, *args, **kwargs)
409
419
    except ConfigFileError as e:
410
 
        print e
 
420
        print(e)
411
421
        return 1
412
422
 
413
423
    # bind to address and port