<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def attach(domain, filename):
    '''
    Attach existing datasets to their harvest remote id

    Mapping between identifiers should be in FILENAME CSV file.
    '''
    log.info('Attaching datasets for domain %s', domain)
    result = actions.attach(domain, filename)
    log.info('Attached %s datasets to %s', result.success, domain)