Fix deregistering signal receivers in the core.

This commit is contained in:
Andrew Resch 2008-01-24 01:31:48 +00:00
parent 50e6b343c3
commit 468e51c72b
2 changed files with 4 additions and 3 deletions

View File

@ -50,8 +50,8 @@ class SignalManager(component.Component):
def deregister_client(self, address):
"""Deregisters a client"""
log.debug("Deregistering %s as a signal reciever..", address)
for client in self.clients:
if client[:len(address)] == address:
for client in self.clients.keys():
if client.split("//")[1].split(":")[0] == address:
del self.clients[client]
break

View File

@ -94,7 +94,8 @@ class SignalReceiver(
self._shutdown = True
# De-register with the daemon so it doesn't try to send us more signals
client.deregister_client()
client.force_call()
# Hacky.. sends a request to our local receiver to ensure that it
# shutdowns.. This is because handle_request() is a blocking call.
receiver = xmlrpclib.ServerProxy("http://localhost:" + str(self.port),