diff options
author | Naveed Massjouni <naveedm9@gmail.com> | 2011-05-25 03:18:00 -0400 |
---|---|---|
committer | Naveed Massjouni <naveedm9@gmail.com> | 2011-05-25 03:18:00 -0400 |
commit | c5278be5e8e77e6af14e2ba8005ab1874194b77a (patch) | |
tree | efec4edae95e9a4725d7402b5097e2f48570c854 /nova/wsgi.py | |
parent | 65595766706631a5c65193cfc0fa2ac9de1aeffc (diff) | |
parent | e1795bd73c71a20290bc988c410e0cc30afe6bd8 (diff) | |
download | nova-c5278be5e8e77e6af14e2ba8005ab1874194b77a.tar.gz nova-c5278be5e8e77e6af14e2ba8005ab1874194b77a.tar.xz nova-c5278be5e8e77e6af14e2ba8005ab1874194b77a.zip |
Merge from trunk.
Diffstat (limited to 'nova/wsgi.py')
-rw-r--r-- | nova/wsgi.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nova/wsgi.py b/nova/wsgi.py index f3f82b36a..ea9bb963d 100644 --- a/nova/wsgi.py +++ b/nova/wsgi.py @@ -59,13 +59,16 @@ class Server(object): def __init__(self, threads=1000): self.pool = eventlet.GreenPool(threads) + self.socket_info = {} - def start(self, application, port, host='0.0.0.0', backlog=128): + def start(self, application, port, host='0.0.0.0', key=None, backlog=128): """Run a WSGI server with the given application.""" arg0 = sys.argv[0] logging.audit(_('Starting %(arg0)s on %(host)s:%(port)s') % locals()) socket = eventlet.listen((host, port), backlog=backlog) self.pool.spawn_n(self._run, application, socket) + if key: + self.socket_info[key] = socket.getsockname() def wait(self): """Wait until all servers have completed running.""" @@ -428,7 +431,7 @@ class Serializer(object): try: return handlers[content_type] except Exception: - raise exception.InvalidContentType() + raise exception.InvalidContentType(content_type=content_type) def serialize(self, data, content_type): """Serialize a dictionary into the specified content type.""" @@ -451,8 +454,7 @@ class Serializer(object): try: return handlers[content_type] except Exception: - raise exception.InvalidContentType(_('Invalid content type %s' - % content_type)) + raise exception.InvalidContentType(content_type=content_type) def _from_json(self, datastring): return utils.loads(datastring) |