def validate_connections(nodes, connections):
    """Ensure all connections actually connect to a node that has been provided."""
    # nodes may have multiple connections to the same node
    #(this is to allow for data centers/smaller servers)
    if not connections or not nodes:
        return
    if len(nodes) < len(connections) - 1:
        # There can't be no nodes then connections less 1
        raise IndexError
    names = [node.address for node in nodes]
    for connection_obj in connections:
        if (connection_obj.start_node.address == connection_obj.end_node.address
                or connection_obj.start_node.address not in names
                or connection_obj.end_node.address not in names):
            raise AttributeError  # addressError
    return True