def _write_to_file(contents, path, mode):
    fd, local_path = tempfile.mkstemp()
    try:
        os.write(fd, contents)
        tmp_path = os.path.join("/tmp", os.path.basename(path))
        env.safe_put(local_path, tmp_path)
        env.safe_sudo("mv %s %s" % (tmp_path, path))
        env.safe_sudo("chmod %s %s" % (mode, path))
        os.close(fd)
    finally:
        os.unlink(local_path)
Returns VirtualServers associated with a list of Pools
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_write_to_file--crossover with--dataset/ETHPy150Open tdevelioglu/python-f5/f5/lb.py/Lb.pools_get_vs