From ec5fae997686c64c3c1192b231b2434e6a6aeb1c Mon Sep 17 00:00:00 2001 From: Pham Le Gia Dai Date: Fri, 5 Apr 2024 10:22:48 +0700 Subject: [PATCH] Remove unused `WSGIService` class This class have been stayed in source code for a long time and not used since it created. The API service used `senlin.api.common.wsgi.Server`, not this class . It should be cleaned up. Change-Id: I71196af4ad5ce0c975bec1c8c80be19b43ccbd2d --- senlin/common/service.py | 43 ---------------------------------------- 1 file changed, 43 deletions(-) diff --git a/senlin/common/service.py b/senlin/common/service.py index 29b635a7f..34a9bf756 100644 --- a/senlin/common/service.py +++ b/senlin/common/service.py @@ -13,10 +13,6 @@ # under the License. from oslo_log import log as logging from oslo_service import service - -from oslo_service import sslutils -from oslo_service import wsgi -from oslo_utils import netutils from oslo_utils import uuidutils from senlin.common import context as senlin_context @@ -123,42 +119,3 @@ class Service(service.Service): 'ex': ex, } ) - - -class WSGIService(service.Service): - def __init__(self, app, name, listen, max_url_len=None): - super(WSGIService, self).__init__(CONF.senlin_api.threads) - self.app = app - self.name = name - - self.listen = listen - - self.servers = [] - - for address in self.listen: - host, port = netutils.parse_host_port(address) - server = wsgi.Server( - CONF, name, app, - host=host, - port=port, - pool_size=CONF.senlin_api.threads, - use_ssl=sslutils.is_enabled(CONF), - max_url_len=max_url_len - ) - - self.servers.append(server) - - def start(self): - for server in self.servers: - server.start() - super(WSGIService, self).start() - - def stop(self, graceful=True): - for server in self.servers: - server.stop() - super(WSGIService, self).stop(graceful) - - def wait(self): - for server in self.servers: - server.wait() - super(WSGIService, self).wait()