summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-04-11 19:36:28 +0900
committerKali Kaneko <kali@leap.se>2013-04-11 19:40:18 +0900
commitb16426c7d7e77dac89cf86730df4e3ccea96fac4 (patch)
tree49a18ae228ceca095047b0d85e4faa276021cfad
parent8c9c8fb20b87a1a66f373ccc9e2e60ddd8266cde (diff)
fix deprecation warnings; add debug info
-rw-r--r--changes/bug_fix-deprecation-warning1
-rw-r--r--src/leap/common/events/component.py5
-rw-r--r--src/leap/common/events/daemon.py2
-rw-r--r--src/leap/common/events/server.py8
4 files changed, 9 insertions, 7 deletions
diff --git a/changes/bug_fix-deprecation-warning b/changes/bug_fix-deprecation-warning
new file mode 100644
index 0000000..ac58117
--- /dev/null
+++ b/changes/bug_fix-deprecation-warning
@@ -0,0 +1 @@
+ o Fix deprecation warnings
diff --git a/src/leap/common/events/component.py b/src/leap/common/events/component.py
index 4fcd6e7..bec1898 100644
--- a/src/leap/common/events/component.py
+++ b/src/leap/common/events/component.py
@@ -66,10 +66,13 @@ def ensure_component_daemon():
@return: the daemon instance
@rtype: EventsComponentDaemon
"""
- daemon = EventsComponentDaemon.ensure(0)
import time
+ daemon = EventsComponentDaemon.ensure(0)
+ logger.debug('ensure component daemon')
+
# Because we use a random port we want to wait until a port is assigned to
# local component daemon.
+
while not (EventsComponentDaemon.get_instance() and
EventsComponentDaemon.get_instance().get_port()):
time.sleep(0.1)
diff --git a/src/leap/common/events/daemon.py b/src/leap/common/events/daemon.py
index 09f3c2f..d2c7b9b 100644
--- a/src/leap/common/events/daemon.py
+++ b/src/leap/common/events/daemon.py
@@ -99,7 +99,7 @@ class EventsSingletonDaemon(threading.Thread):
% len(args))
if cls.__instance is None:
cls.__instance = object.__new__(
- EventsSingletonDaemon, *args, **kwargs)
+ EventsSingletonDaemon)
cls.__initialize(cls.__instance, args[0], args[1])
return cls.__instance
diff --git a/src/leap/common/events/server.py b/src/leap/common/events/server.py
index e2365cb..16c6513 100644
--- a/src/leap/common/events/server.py
+++ b/src/leap/common/events/server.py
@@ -14,7 +14,6 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
"""
A server for the events mechanism.
@@ -25,10 +24,7 @@ A server can receive different kinds of requests from components:
2. Signal request: redistribute the signal to registered components.
"""
-
-
import logging
-import sets
import socket
@@ -95,9 +91,11 @@ class EventsServerService(proto.EventsServerService):
logger.info("Received registration request: %s" % str(request))
# add component port to signal list
if request.event not in registered_components:
- registered_components[request.event] = sets.Set()
+ registered_components[request.event] = set([])
registered_components[request.event].add(request.port)
# send response back to component
+
+ logger.debug('sending response back')
response = proto.EventResponse()
response.status = proto.EventResponse.OK
done.run(response)