def save_local_facts(filename, facts):
 try:
  fact_dir = os.path.dirname(filename)
  try:
   os.makedirs(fact_dir)
  except OSError as exception:
   if (exception.errno != errno.EEXIST):
    raise
  with open(filename, 'w') as fact_file:
   fact_file.write(module.jsonify(facts))
  os.chmod(filename, 384)
 except (IOError, OSError) as ex:
  raise OpenShiftFactsFileWriteError(('Could not create fact file: %s, error: %s' % (filename, ex)))

def save_local_facts ( filename , facts ) : try : fact_dir = os . path . dirname ( filename ) try : os . makedirs ( fact_dir ) except OSError as exception : if ( exception . errno != errno . EEXIST ) : raise with open ( filename , 'w' ) as fact_file : fact_file . write ( module . jsonify ( facts ) ) os . chmod ( filename , 384 ) except ( IOError , OSError ) as ex : raise OpenShiftFactsFileWriteError ( ( 'Could not create fact file: %s, error: %s' % ( filename , ex ) ) )
save local facts args: filename : local facts file facts : facts to set .