Commit 163858ed authored by Julien Muchembled's avatar Julien Muchembled

qa: fix attributeTracker

parent fa14157b
...@@ -26,7 +26,7 @@ from Queue import Empty ...@@ -26,7 +26,7 @@ from Queue import Empty
class LockUser(object): class LockUser(object):
def __init__(self, message, level=0): def __init__(self, message=None, level=0):
t = threading.currentThread() t = threading.currentThread()
ident = getattr(t, 'node_name', t.name) ident = getattr(t, 'node_name', t.name)
# This class is instantiated from a place desiring to known what # This class is instantiated from a place desiring to known what
...@@ -42,9 +42,10 @@ class LockUser(object): ...@@ -42,9 +42,10 @@ class LockUser(object):
# current Neo directory structure. # current Neo directory structure.
path = os.path.join('...', *path.split(os.path.sep)[-3:]) path = os.path.join('...', *path.split(os.path.sep)[-3:])
self.time = time() self.time = time()
self.ident = "%s@%r %s:%s %s" % ( if message is not None:
ident, self.time, path, line_number, line) self.ident = "%s@%r %s:%s %s" % (
self.note(message) ident, self.time, path, line_number, line)
self.note(message)
self.ident = ident self.ident = ident
def __eq__(self, other): def __eq__(self, other):
......
...@@ -118,8 +118,8 @@ class Node(object): ...@@ -118,8 +118,8 @@ class Node(object):
if connection.isServer(): if connection.isServer():
self.setIdentified() self.setIdentified()
else: else:
assert force is not None, \ assert force is not None, (conn,
attributeTracker.whoSet(self, '_connection') attributeTracker.whoSet(self, '_connection'))
# The test on peer_id is there to protect against buggy nodes. # The test on peer_id is there to protect against buggy nodes.
# XXX: handler comparison does not cover all cases: there may # XXX: handler comparison does not cover all cases: there may
# be a pending handler change, which won't be detected, or a future # be a pending handler change, which won't be detected, or a future
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment