Call listener stop only if listener is initialized
Change-Id: I1303d74af7a242edefe774d8f5e12e63614c0158 Closes-Bug: #1785048
This commit is contained in:
parent
3a725f957b
commit
d8fa6d5edf
@ -426,7 +426,8 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
|
|||||||
some messages, and underlying driver resources associated to this
|
some messages, and underlying driver resources associated to this
|
||||||
server are still in use. See 'wait' for more details.
|
server are still in use. See 'wait' for more details.
|
||||||
"""
|
"""
|
||||||
self.listener.stop()
|
if self.listener:
|
||||||
|
self.listener.stop()
|
||||||
self._started = False
|
self._started = False
|
||||||
|
|
||||||
@ordered(after='stop')
|
@ordered(after='stop')
|
||||||
@ -443,7 +444,8 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
|
|||||||
self._work_executor.shutdown(wait=True)
|
self._work_executor.shutdown(wait=True)
|
||||||
|
|
||||||
# Close listener connection after processing all messages
|
# Close listener connection after processing all messages
|
||||||
self.listener.cleanup()
|
if self.listener:
|
||||||
|
self.listener.cleanup()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
"""Reset service.
|
"""Reset service.
|
||||||
|
Loading…
Reference in New Issue
Block a user