diff options
Diffstat (limited to 'api/escalator/common')
-rw-r--r-- | api/escalator/common/utils.py | 16 | ||||
-rw-r--r-- | api/escalator/common/wsgi.py | 10 |
2 files changed, 6 insertions, 20 deletions
diff --git a/api/escalator/common/utils.py b/api/escalator/common/utils.py index ccdc7f8..6cb1784 100644 --- a/api/escalator/common/utils.py +++ b/api/escalator/common/utils.py @@ -43,15 +43,10 @@ from oslo_config import cfg from oslo_log import log as logging from oslo_utils import encodeutils from oslo_utils import excutils -from oslo_utils import netutils -from oslo_utils import strutils import six from webob import exc -import ConfigParser - from escalator.common import exception from escalator import i18n -# from providerclient.v1 import client as provider_client CONF = cfg.CONF @@ -666,9 +661,11 @@ def ip_into_int(ip): def int_into_ip(num): - inter_ip = lambda x: '.'.join( - [str(x / (256 ** i) % 256) for i in range(3, -1, -1)]) - return inter_ip(num) + s = [] + for i in range(4): + s.append(str(num % 256)) + num /= 256 + return '.'.join(s[::-1]) def is_ip_in_cidr(ip, cidr): @@ -939,6 +936,3 @@ def translate_marks_4_sed_command(ori_str): translated_str = translated_str.\ replace(translated_mark, translated_marks[translated_mark]) return translated_str - - - diff --git a/api/escalator/common/wsgi.py b/api/escalator/common/wsgi.py index c4e8bfd..8884ea4 100644 --- a/api/escalator/common/wsgi.py +++ b/api/escalator/common/wsgi.py @@ -232,12 +232,9 @@ def get_asynchronous_eventlet_pool(size=1000): class Server(object): """Server class to manage multiple WSGI sockets and applications. - - This class requires initialize_escalator_store set to True if - escalator store needs to be initialized. """ - def __init__(self, threads=1000, initialize_escalator_store=False): + def __init__(self, threads=1000): os.umask(0o27) # ensure files are created with the correct privileges self._logger = logging.getLogger("eventlet.wsgi.server") self._wsgi_logger = loggers.WritableLogger(self._logger) @@ -245,9 +242,6 @@ class Server(object): self.children = set() self.stale_children = set() self.running = True - # NOTE(abhishek): Allows us to only re-initialize escalator_store when - # the API's configuration reloads. - self.initialize_escalator_store = initialize_escalator_store self.pgid = os.getpid() try: # NOTE(flaper87): Make sure this process @@ -362,8 +356,6 @@ class Server(object): """ eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line self.configure_socket(old_conf, has_changed) - if self.initialize_escalator_store: - initialize_escalator_store() def reload(self): """ |