#!/usr/bin/env python3 # tftp.py - PVC Cluster Auto-bootstrap TFTP preparation libraries # Part of the Parallel Virtual Cluster (PVC) system # # Copyright (C) 2018-2021 Joshua M. Boniface # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ############################################################################### import os.path import git import yaml from celery.utils.log import get_task_logger logger = get_task_logger(__name__) def build_tftp_repository(config): # Generate an installer config os.system(f"{config['root_path']}/repo/pvc-installer/buildpxe.sh -o {config['tftp_root_path']} -u {config['deploy_user']}") def init_tftp(config): """ Prepare a TFTP root """ if not os.patch.exists(config['tftp_root_path']): os.makedirs(config['tftp_root_path']) os.makedirs(config['tftp_host_path']) build_tftp_repository(config)