def subpart_option(buildout, part, subpart, option, default=''):
    """Get an option for a filestorage subpart, falling back to the main part.
    """
    parts_to_check = ['%s_%s' % (part, subpart), part]
    val = default
    for p in parts_to_check:
        if p not in buildout:
            continue
        if option in buildout[p]:
            val = buildout[p][option]
            break
    return val % dict(fs_part_name=subpart)
