def list_nodes(search="unsigned"):
    """ List all connected nodes
    """
    nodes = nago.core.get_nodes()
    if search == "all":
        return map(lambda x: {x[0]: x[1].data}, nodes.items())
    elif search == 'unsigned':
        result = {}
        for token, node in nodes.items():
            if node.get('access') is None:
                result[token] = node.data
        return result
    else:
        result = {}
        for token, node in nodes.items():
            host_name = node.get('host_name')
            if search in (token, host_name):
                result[token] = node.data
        return result
def list_nodes ( search = "unsigned" ) : nodes = nago . core . get_nodes ( ) if search == "all" : return map ( lambda x : { x [ 0 ] : x [ 1 ] . data } , nodes . items ( ) ) elif search == 'unsigned' : result = { } for token , node in nodes . items ( ) : if node . get ( 'access' ) is None : result [ token ] = node . data return result else : result = { } for token , node in nodes . items ( ) : host_name = node . get ( 'host_name' ) if search in ( token , host_name ) : result [ token ] = node . data return result
List all connected nodes