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')
|
logger.info ('iPXE already present--not compiling again')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
cwd = os.getcwd()
|
||||||
with tempfile.TemporaryDirectory() as clone_dir:
|
with tempfile.TemporaryDirectory() as clone_dir:
|
||||||
logger.info(f"Clonando el repositorio {ipxe_repo_url}")
|
logger.info(f"Clonando el repositorio {ipxe_repo_url}")
|
||||||
if subprocess.call(["git", "-c", "http.sslVerify=false", "clone", ipxe_repo_url, clone_dir]) == 0:
|
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(["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(["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"])
|
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
|
return True
|
||||||
|
|
||||||
def get_ip_address(interface):
|
def get_ip_address(interface):
|
||||||
|
@ -844,7 +846,7 @@ except Exception as e:
|
||||||
try:
|
try:
|
||||||
logger.info("Installing iPXE")
|
logger.info("Installing iPXE")
|
||||||
if not install_ipxe():
|
if not install_ipxe():
|
||||||
logger.error(f"Error installing iPXE: {e}")
|
logger.error(f"Error installing iPXE")
|
||||||
exit(1)
|
exit(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error installing iPXE: {e}")
|
logger.error(f"Error installing iPXE: {e}")
|
||||||
|
@ -859,7 +861,9 @@ except Exception as e:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logger.info("Create the structure of the accesses to the server from the client (shared)")
|
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:
|
except Exception as e:
|
||||||
logger.error(f"Error creating client structure: {e}")
|
logger.error(f"Error creating client structure: {e}")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Reference in New Issue