def _cache_id(minion_id, cache_file):
    '''
    Helper function, writes minion id to a cache file.
    '''
    try:
        with salt.utils.fopen(cache_file, 'w') as idf:
            idf.write(minion_id)
    except (IOError, __HOLE__) as exc:
        log.error('Could not cache minion ID: {0}'.format(exc))
dataset/ETHPy150Open saltstack/salt/salt/config/__init__.py/_cache_id