Sync from oslo-incubator
Here are the changes: f29e865 Store ProcessLauncher signal handlers on class level 5509577 Remove unused validate_ssl_version Also removed policy.py from openstack-common.conf as it is already removed from oslo-incubator. Change-Id: Id1d7250b5cff142d54004f604e6c2ae04709958b
This commit is contained in:
@@ -199,6 +199,13 @@ class ServiceWrapper(object):
|
|||||||
|
|
||||||
|
|
||||||
class ProcessLauncher(object):
|
class ProcessLauncher(object):
|
||||||
|
_signal_handlers_set = set()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _handle_class_signals(cls, *args, **kwargs):
|
||||||
|
for handler in cls._signal_handlers_set:
|
||||||
|
handler(*args, **kwargs)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Constructor."""
|
"""Constructor."""
|
||||||
|
|
||||||
@@ -210,7 +217,8 @@ class ProcessLauncher(object):
|
|||||||
self.handle_signal()
|
self.handle_signal()
|
||||||
|
|
||||||
def handle_signal(self):
|
def handle_signal(self):
|
||||||
_set_signals_handler(self._handle_signal)
|
self._signal_handlers_set.add(self._handle_signal)
|
||||||
|
_set_signals_handler(self._handle_class_signals)
|
||||||
|
|
||||||
def _handle_signal(self, signo, frame):
|
def _handle_signal(self, signo, frame):
|
||||||
self.sigcaught = signo
|
self.sigcaught = signo
|
||||||
|
@@ -79,27 +79,3 @@ def wrap(sock):
|
|||||||
ssl_kwargs['cert_reqs'] = ssl.CERT_REQUIRED
|
ssl_kwargs['cert_reqs'] = ssl.CERT_REQUIRED
|
||||||
|
|
||||||
return ssl.wrap_socket(sock, **ssl_kwargs)
|
return ssl.wrap_socket(sock, **ssl_kwargs)
|
||||||
|
|
||||||
|
|
||||||
_SSL_PROTOCOLS = {
|
|
||||||
"tlsv1": ssl.PROTOCOL_TLSv1,
|
|
||||||
"sslv23": ssl.PROTOCOL_SSLv23,
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
|
||||||
_SSL_PROTOCOLS["sslv2"] = ssl.PROTOCOL_SSLv2
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
_SSL_PROTOCOLS["sslv3"] = ssl.PROTOCOL_SSLv3
|
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def validate_ssl_version(version):
|
|
||||||
key = version.lower()
|
|
||||||
try:
|
|
||||||
return _SSL_PROTOCOLS[key]
|
|
||||||
except KeyError:
|
|
||||||
raise RuntimeError(_("Invalid SSL version : %s") % version)
|
|
||||||
|
@@ -9,7 +9,6 @@ module=local
|
|||||||
module=loopingcall
|
module=loopingcall
|
||||||
module=memorycache
|
module=memorycache
|
||||||
module=periodic_task
|
module=periodic_task
|
||||||
module=policy
|
|
||||||
module=report
|
module=report
|
||||||
module=report.generators
|
module=report.generators
|
||||||
module=report.models
|
module=report.models
|
||||||
|
Reference in New Issue
Block a user