diff options
| -rw-r--r-- | openstack/common/wsgi.py | 2 | ||||
| -rw-r--r-- | tests/unit/test_wsgi.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/openstack/common/wsgi.py b/openstack/common/wsgi.py index a6310a4..7d35158 100644 --- a/openstack/common/wsgi.py +++ b/openstack/common/wsgi.py @@ -79,6 +79,7 @@ class Service(service.Service): self._port = port self._host = host self._backlog = backlog if backlog else CONF.backlog + self._socket = self._get_socket(host, port, self._backlog) super(Service, self).__init__(threads) def _get_socket(self, host, port, backlog): @@ -129,7 +130,6 @@ class Service(service.Service): """ super(Service, self).start() - self._socket = self._get_socket(self._host, self._port, self._backlog) self.tg.add_thread(self._run, self.application, self._socket) @property diff --git a/tests/unit/test_wsgi.py b/tests/unit/test_wsgi.py index b83c865..1732c80 100644 --- a/tests/unit/test_wsgi.py +++ b/tests/unit/test_wsgi.py @@ -527,10 +527,6 @@ class WSGIServerTest(utils.BaseTestCase): server.stop() def test_ipv6_listen_called_with_scope(self): - server = wsgi.Service("test_app", - 1234, - host="fe80::204:acff:fe96:da87%eth0") - with mock.patch.object(wsgi.eventlet, 'listen') as mock_listen: with mock.patch.object(socket, 'getaddrinfo') as mock_get_addr: mock_get_addr.return_value = [ @@ -540,7 +536,10 @@ class WSGIServerTest(utils.BaseTestCase): '', ('fe80::204:acff:fe96:da87%eth0', 1234, 0, 2)) ] - server.start() + + wsgi.Service("test_app", + 1234, + host="fe80::204:acff:fe96:da87%eth0") mock_get_addr.assert_called_once_with( "fe80::204:acff:fe96:da87%eth0", |
