def setup_nfs()

in integration/src/integration.py [0:0]


def setup_nfs(properties_file: str) -> None:
    args = ["cyclecloud", "create_cluster", "nfs_template_1.1.0", NFS_CLUSTER_NAME, "-p", properties_file, "--force"]
    check_output(args, cwd=CWD)

    cs_home = os.getenv("CS_HOME")
    assert cs_home, "Please set CS_HOME"
    nfs_cloud_init_tmp = os.path.join(cs_home, "config", "data", "integration-nfs.txt.tmp")
    nfs_cloud_init = os.path.join(cs_home, "config", "data", "integration-nfs.txt")

    with open(nfs_cloud_init_tmp, "w") as fw:
        fw.write('AdType = "Cloud.Node"\n')
        fw.write('ClusterName = NFS_CLUSTER_NAME\n')
        fw.write('Name = "filer"\n')
        fw.write('CloudInit = "#!/bin/bash\\n')
        fw.write("echo '/mnt/exports/sched *(rw,sync,no_root_squash)' >> /etc/exports\\n")
        fw.write("echo '/mnt/exports/shared *(rw,sync,no_root_squash)' >> /etc/exports\"")

    shutil.move(nfs_cloud_init_tmp, nfs_cloud_init)
    while os.path.exists(nfs_cloud_init):
        time.sleep(.5)

    args = ["cyclecloud", "start_cluster", NFS_CLUSTER_NAME]
    check_output(args, cwd=CWD)