def dn_attribute(dn, attr):
    """Given a full DN return the value of the attribute given"""
    for rdn in dn.split(','):
        if rdn.startswith('%s=' % attr):
            return rdn.split('=', 1)[1]
