def _sync(form, saltenv=None):
 if (saltenv is None):
  saltenv = _get_top_file_envs()
 if isinstance(saltenv, six.string_types):
  saltenv = saltenv.split(',')
 (ret, touched) = salt.utils.extmods.sync(__opts__, form, saltenv=saltenv)
 if touched:
  mod_file = os.path.join(__opts__['cachedir'], 'module_refresh')
  with salt.utils.fopen(mod_file, 'a+') as ofile:
   ofile.write('')
 if ((form == 'grains') and __opts__.get('grains_cache') and os.path.isfile(os.path.join(__opts__['cachedir'], 'grains.cache.p'))):
  try:
   os.remove(os.path.join(__opts__['cachedir'], 'grains.cache.p'))
  except OSError:
   log.error('Could not remove grains cache!')
 return ret

def _sync ( form , saltenv = None ) : if ( saltenv is None ) : saltenv = _get_top_file_envs ( ) if isinstance ( saltenv , six . string_types ) : saltenv = saltenv . split ( ',' ) ( ret , touched ) = salt . utils . extmods . sync ( __opts__ , form , saltenv = saltenv ) if touched : mod_file = os . path . join ( __opts__ [ 'cachedir' ] , 'module_refresh' ) with salt . utils . fopen ( mod_file , 'a+' ) as ofile : ofile . write ( '' ) if ( ( form == 'grains' ) and __opts__ . get ( 'grains_cache' ) and os . path . isfile ( os . path . join ( __opts__ [ 'cachedir' ] , 'grains.cache.p' ) ) ) : try : os . remove ( os . path . join ( __opts__ [ 'cachedir' ] , 'grains.cache.p' ) ) except OSError : log . error ( 'Could not remove grains cache!' ) return ret
sync the given directory in the given environment .