def cache_node(node, provider, opts):
 if isinstance(opts, dict):
  __opts__.update(opts)
 if (('update_cachedir' not in __opts__) or (not __opts__['update_cachedir'])):
  return
 if (not os.path.exists(os.path.join(__opts__['cachedir'], 'active'))):
  init_cachedir()
 base = os.path.join(__opts__['cachedir'], 'active')
 (provider, driver) = provider.split(':')
 prov_dir = os.path.join(base, driver, provider)
 if (not os.path.exists(prov_dir)):
  os.makedirs(prov_dir)
 path = os.path.join(prov_dir, '{0}.p'.format(node['name']))
 with salt.utils.fopen(path, 'w') as fh_:
  msgpack.dump(node, fh_)

def cache_node ( node , provider , opts ) : if isinstance ( opts , dict ) : __opts__ . update ( opts ) if ( ( 'update_cachedir' not in __opts__ ) or ( not __opts__ [ 'update_cachedir' ] ) ) : return if ( not os . path . exists ( os . path . join ( __opts__ [ 'cachedir' ] , 'active' ) ) ) : init_cachedir ( ) base = os . path . join ( __opts__ [ 'cachedir' ] , 'active' ) ( provider , driver ) = provider . split ( ':' ) prov_dir = os . path . join ( base , driver , provider ) if ( not os . path . exists ( prov_dir ) ) : os . makedirs ( prov_dir ) path = os . path . join ( prov_dir , '{0}.p' . format ( node [ 'name' ] ) ) with salt . utils . fopen ( path , 'w' ) as fh_ : msgpack . dump ( node , fh_ )
cache node individually .