def save_reg(data):
 reg_dir = _reg_dir()
 regfile = os.path.join(reg_dir, 'register')
 try:
  if (not os.path.exists()):
   os.makedirs(reg_dir)
 except OSError as exc:
  if (exc.errno == errno.EEXIST):
   pass
  else:
   raise
 try:
  with salt.utils.fopen(regfile, 'a') as fh_:
   msgpack.dump(data, fh_)
  fh_.close()
 except:
  log.error('Could not write to msgpack file {0}'.format(__opts__['outdir']))
  raise

def save_reg ( data ) : reg_dir = _reg_dir ( ) regfile = os . path . join ( reg_dir , 'register' ) try : if ( not os . path . exists ( ) ) : os . makedirs ( reg_dir ) except OSError as exc : if ( exc . errno == errno . EEXIST ) : pass else : raise try : with salt . utils . fopen ( regfile , 'a' ) as fh_ : msgpack . dump ( data , fh_ ) fh_ . close ( ) except : log . error ( 'Could not write to msgpack file {0}' . format ( __opts__ [ 'outdir' ] ) ) raise
save the register to msgpack files .