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:
Davanum Srinivas 2015-03-19 14:04:42 -04:00
parent 5b8e156782
commit 02a69b7d25
3 changed files with 9 additions and 26 deletions

View File

@ -199,6 +199,13 @@ class ServiceWrapper(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):
"""Constructor."""
@ -210,7 +217,8 @@ class ProcessLauncher(object):
self.handle_signal()
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):
self.sigcaught = signo

View File

@ -79,27 +79,3 @@ def wrap(sock):
ssl_kwargs['cert_reqs'] = ssl.CERT_REQUIRED
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)

View File

@ -9,7 +9,6 @@ module=local
module=loopingcall
module=memorycache
module=periodic_task
module=policy
module=report
module=report.generators
module=report.models