File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 19
19
import functools
20
20
import multiprocessing
21
21
import operator
22
- import signal
23
22
import threading
24
23
import types
25
24
import uuid
43
42
from oslo_config import cfg
44
43
from oslo_db import exception as os_db_exc
45
44
from oslo_log import log
45
+ from oslo_service import service as oslo_service
46
46
from oslo_utils import timeutils
47
47
from ovsdbapp .backend .ovs_idl import idlutils
48
48
@@ -312,8 +312,9 @@ def _setup_hash_ring(self):
312
312
themselves to the hash ring.
313
313
"""
314
314
# Attempt to remove the node from the ring when the worker stops
315
+ sh = oslo_service .SignalHandler ()
315
316
atexit .register (self ._remove_node_from_hash_ring )
316
- signal . signal ( signal . SIGTERM , self ._remove_node_from_hash_ring )
317
+ sh . add_handler ( " SIGTERM" , self ._remove_node_from_hash_ring )
317
318
318
319
admin_context = n_context .get_admin_context ()
319
320
if not self ._hash_ring_probe_event .is_set ():
Original file line number Diff line number Diff line change 13
13
14
14
import atexit
15
15
import queue
16
- import signal
17
16
import threading
18
17
import traceback
19
18
import weakref
24
23
from neutron_lib import context as n_ctx
25
24
from neutron_lib .db import api as db_api
26
25
from oslo_log import log as logging
26
+ from oslo_service import service
27
27
28
28
from neutron .api .rpc .callbacks import events as rpc_events
29
29
from neutron .api .rpc .handlers import resources_rpc
38
38
39
39
def _setup_change_handlers_cleanup ():
40
40
atexit .register (_ObjectChangeHandler .clean_up )
41
- signal .signal (signal .SIGINT , _ObjectChangeHandler .clean_up )
42
- signal .signal (signal .SIGTERM , _ObjectChangeHandler .clean_up )
41
+ sh = service .SignalHandler ()
42
+ sh .add_handler ("SIGINT" , _ObjectChangeHandler .clean_up )
43
+ sh .add_handler ("SIGTERM" , _ObjectChangeHandler .clean_up )
43
44
44
45
45
46
class _ObjectChangeHandler (object ):
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ oslo.privsep>=2.3.0 # Apache-2.0
42
42
oslo.reports >= 1.18.0 # Apache-2.0
43
43
oslo.rootwrap >= 5.15.0 # Apache-2.0
44
44
oslo.serialization >= 2.25.0 # Apache-2.0
45
- oslo.service >= 2.8.0 # Apache-2.0
45
+ oslo.service >= 3.1.2 # Apache-2.0
46
46
oslo.upgradecheck >= 1.3.0 # Apache-2.0
47
47
oslo.utils >= 4.8.0 # Apache-2.0
48
48
oslo.versionedobjects >= 1.35.1 # Apache-2.0
You can’t perform that action at this time.
0 commit comments