def cachedir_index_add(minion_id, profile, driver, provider, base=None):
 base = init_cachedir(base)
 index_file = os.path.join(base, 'index.p')
 lock_file(index_file)
 if os.path.exists(index_file):
  with salt.utils.fopen(index_file, 'r') as fh_:
   index = msgpack.load(fh_)
 else:
  index = {}
 prov_comps = provider.split(':')
 index.update({minion_id: {'id': minion_id, 'profile': profile, 'driver': driver, 'provider': prov_comps[0]}})
 with salt.utils.fopen(index_file, 'w') as fh_:
  msgpack.dump(index, fh_)
 unlock_file(index_file)

def cachedir_index_add ( minion_id , profile , driver , provider , base = None ) : base = init_cachedir ( base ) index_file = os . path . join ( base , 'index.p' ) lock_file ( index_file ) if os . path . exists ( index_file ) : with salt . utils . fopen ( index_file , 'r' ) as fh_ : index = msgpack . load ( fh_ ) else : index = { } prov_comps = provider . split ( ':' ) index . update ( { minion_id : { 'id' : minion_id , 'profile' : profile , 'driver' : driver , 'provider' : prov_comps [ 0 ] } } ) with salt . utils . fopen ( index_file , 'w' ) as fh_ : msgpack . dump ( index , fh_ ) unlock_file ( index_file )
add an entry to the cachedir index .