remove nesting
This commit is contained in:
parent
0401f76621
commit
6f5deada62
1 changed files with 4 additions and 5 deletions
|
@ -122,16 +122,15 @@ class LocalNodes(dict):
|
|||
for key, value in info.properties.items():
|
||||
key = key.decode()
|
||||
self[id][key] = value.decode()
|
||||
logger.debug('add localnode: %s', self[id])
|
||||
logger.debug('add: %s', self[id])
|
||||
if state.tasks:
|
||||
state.tasks.queue('addlocalinfo', self[id])
|
||||
elif state_change is ServiceStateChange.Removed:
|
||||
logger.debug('remove localnode: %s', id)
|
||||
logger.debug('remove: %s', id)
|
||||
self.pop(id, None)
|
||||
if state.tasks:
|
||||
state.tasks.queue('removelocalinfo', id)
|
||||
|
||||
def get(self, user_id):
|
||||
if user_id in self:
|
||||
if can_connect(self[user_id]):
|
||||
if user_id in self and can_connect(self[user_id]):
|
||||
return self[user_id]
|
||||
|
|
Loading…
Reference in a new issue