diff options
| author | Devin Carlen <devin.carlen@gmail.com> | 2012-03-03 14:01:46 -0800 |
|---|---|---|
| committer | Devin Carlen <devin.carlen@gmail.com> | 2012-03-07 12:54:27 -0800 |
| commit | d0429ea9b8849f99aa170cd09aef7776e2651dbf (patch) | |
| tree | 6ced31803cdcd93464eae586f8591b4dddbf852a /keystone | |
| parent | fe6414c8c1f769e6cc87fc001b6c52c5fea0f160 (diff) | |
Make bind host configurable
* fixes bug 945868
Change-Id: Ib33dc9ad1878a9215c1a1ab10814fa7d0905cbdb
Diffstat (limited to 'keystone')
| -rw-r--r-- | keystone/common/wsgi.py | 11 | ||||
| -rw-r--r-- | keystone/config.py | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py index 6279d4cc..f8a7e2f1 100644 --- a/keystone/common/wsgi.py +++ b/keystone/common/wsgi.py @@ -51,20 +51,21 @@ class WritableLogger(object): class Server(object): """Server class to manage multiple WSGI sockets and applications.""" - def __init__(self, application, port, threads=1000): + def __init__(self, application, host=None, port=None, threads=1000): self.application = application - self.port = port + self.host = host or '0.0.0.0' + self.port = port or 0 self.pool = eventlet.GreenPool(threads) self.socket_info = {} self.greenthread = None - def start(self, host='0.0.0.0', key=None, backlog=128): + def start(self, key=None, backlog=128): """Run a WSGI server with the given application.""" logging.debug('Starting %(arg0)s on %(host)s:%(port)s' % {'arg0': sys.argv[0], - 'host': host, + 'host': self.host, 'port': self.port}) - socket = eventlet.listen((host, self.port), backlog=backlog) + socket = eventlet.listen((self.host, self.port), backlog=backlog) self.greenthread = self.pool.spawn(self._run, self.application, socket) if key: self.socket_info[key] = socket.getsockname() diff --git a/keystone/config.py b/keystone/config.py index 61643fc2..ba4f7b25 100644 --- a/keystone/config.py +++ b/keystone/config.py @@ -139,6 +139,7 @@ CONF = CommonConfig(project='keystone') register_str('admin_token', default='ADMIN') +register_str('bind_host', default='0.0.0.0') register_str('compute_port') register_str('admin_port') register_str('public_port') |
