Recursively workout the file name from an augeas change

def _workout_filename(filename):
    '''
    Recursively workout the file name from an augeas change
    '''
    if os.path.isfile(filename) or filename == '/':
        if filename == '/':
            filename = None
        return filename
    else:
        return _workout_filename(os.path.dirname(filename))