def __write_docker_compose(path, docker_compose):
 if (os.path.isdir(path) is False):
  os.mkdir(path)
 f = salt.utils.fopen(os.path.join(path, dc_filename), 'w')
 if f:
  f.write(docker_compose)
  f.close()
 else:
  return __standardize_result(False, 'Could not write docker-compose file in {0}'.format(path), None, None)
 project = __load_project(path)
 if isinstance(project, dict):
  os.remove(os.path.join(path, dc_filename))
  return project
 return path

def __write_docker_compose ( path , docker_compose ) : if ( os . path . isdir ( path ) is False ) : os . mkdir ( path ) f = salt . utils . fopen ( os . path . join ( path , dc_filename ) , 'w' ) if f : f . write ( docker_compose ) f . close ( ) else : return __standardize_result ( False , 'Could not write docker-compose file in {0}' . format ( path ) , None , None ) project = __load_project ( path ) if isinstance ( project , dict ) : os . remove ( os . path . join ( path , dc_filename ) ) return project return path
write docker-compose to a temp directory in order to use it with docker-compose .