refs #1016 chdir() out of a deleted directory
parent
dd44a43ec2
commit
ab79c9f6eb
|
@ -486,6 +486,7 @@ def install_ipxe():
|
|||
logger.info ('iPXE already present--not compiling again')
|
||||
return True
|
||||
|
||||
cwd = os.getcwd()
|
||||
with tempfile.TemporaryDirectory() as clone_dir:
|
||||
logger.info(f"Clonando el repositorio {ipxe_repo_url}")
|
||||
if subprocess.call(["git", "-c", "http.sslVerify=false", "clone", ipxe_repo_url, clone_dir]) == 0:
|
||||
|
@ -528,6 +529,7 @@ def install_ipxe():
|
|||
subprocess.call(["chown", "-R", "tftp:ogboot", f"{INSTALL_OGBOOT_TARGET}/tftpboot/ipxe_scripts/templates"])
|
||||
subprocess.call(["chmod", "-R", "775", f"{INSTALL_OGBOOT_TARGET}/tftpboot/ipxe_scripts/templates"])
|
||||
subprocess.call(["cp", f"{REPO_DIR}/tftpboot/ipxe_scripts/templates/pxe_default", f"{INSTALL_OGBOOT_TARGET}/tftpboot/ipxe_scripts/templates"])
|
||||
os.chdir(cwd)
|
||||
return True
|
||||
|
||||
def get_ip_address(interface):
|
||||
|
@ -844,8 +846,8 @@ except Exception as e:
|
|||
try:
|
||||
logger.info("Installing iPXE")
|
||||
if not install_ipxe():
|
||||
logger.error(f"Error installing iPXE: {e}")
|
||||
exit(1)
|
||||
logger.error(f"Error installing iPXE")
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
logger.error(f"Error installing iPXE: {e}")
|
||||
exit(1)
|
||||
|
@ -859,7 +861,9 @@ except Exception as e:
|
|||
|
||||
try:
|
||||
logger.info("Create the structure of the accesses to the server from the client (shared)")
|
||||
copyClientFiles()
|
||||
if not copyClientFiles():
|
||||
logger.error(f"Error creating client structure")
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
logger.error(f"Error creating client structure: {e}")
|
||||
exit(1)
|
||||
|
|
Loading…
Reference in New Issue