Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
# NOTE(mikal): All of this is because if dnspython is present in your # environment then eventlet monkeypatches socket.getaddrinfo() with an # implementation which doesn't work for IPv6. What we're checking here is # that the magic environment variable was set when the import happened. os.environ.get('EVENTLET_NO_GREENDNS', '').lower() != 'yes'): raise ImportError('eventlet imported before ' 'keystone.common.wsgi_server ' '(EVENTLET_NO_GREENDNS env var set to %s)' % os.environ.get('EVENTLET_NO_GREENDNS'))
thread=monkeypatch_thread)
"""Server class to manage multiple WSGI sockets and applications."""
"""Run a WSGI server with the given application.""" {'arg0': sys.argv[0], 'host': self.host, 'port': self.port})
# TODO(dims): eventlet's green dns/socket module does not actually # support IPv6 in getaddrinfo(). We need to get around this in the # future or monitor upstream for a fix self.port, socket.AF_UNSPEC, socket.SOCK_STREAM)[0] family=info[0], backlog=backlog) # SSL is enabled else: keyfile=self.keyfile, server_side=True, cert_reqs=cert_reqs, ca_certs=self.ca_certs)
self.application, _socket)
cert_required=True):
"""Wait until all servers have completed running.""" try: self.pool.waitall() except KeyboardInterrupt:
"""Start a WSGI server in a new green thread.""" log=wsgi.WritableLogger(log)) |