def METHOD_NAME(fields, report):
    # set the target filename
    reportFormatVersion = __version__
    CC                  = fields['probe_cc']
    # XXX: wouldn't hurt to check timestamp for sanity again?
    dateInISO8601Format,__,__ = os.path.basename(report).split('_')
    probeASNumber       = fields['probe_asn']
    testName            = get_test_name(fields)
    # make sure path reportFormatVersion/CC exists
    path = os.path.abspath(report_archive_dir)
    for component in [reportFormatVersion, CC]:
        path = os.path.join(path, component)
        if not os.path.isdir(path):
            try:
                os.mkdir(path, path_permission)
                log.debug("mkdir path: %s" % path)
            except OSError:
                return None
    # if the target file already exists, try to find another filename
    filename = "%s-%s-%s.yamloo" % (testName, dateInISO8601Format, probeASNumber)
    target = os.path.join(path, filename)
    # try to get a unique filename. os.open as used below requires
    # that the file not already exist
    naming_attempts = 1
    while os.path.exists(target) and naming_attempts < retry_attempts:
        filename = "%s-%s-%s.%d.yamloo" % (testName, dateInISO8601Format,
                probeASNumber, naming_attempts)
        target = os.path.join(path, filename)
        naming_attempts = naming_attempts + 1
    if naming_attempts >= retry_attempts:
        log.err("Failed getting unique filename %d times; skipping" % i)
        return None
    return target