refs #407 #440 Changes order execution in create symlink and install oglive

ogboot_installer
Luis Gerardo Romero Garcia 2024-07-09 14:49:10 +02:00
parent c5298f5322
commit 744218ab2b
1 changed files with 7 additions and 8 deletions

View File

@ -586,6 +586,13 @@ TFTP_OPTIONS="--secure"
logger.info(f"Directory {TFTPCFGDIR} created.")
else:
logger.warning(f"Directory {TFTPCFGDIR} exist.")
symlink_target = f"{INSTALL_OGBOOT_TARGET}/tftpboot"
logger.info(f"Creating symbolic link from {TFTPCFGDIR} to {symlink_target}")
if not os.path.exists(symlink_target):
os.symlink(TFTPCFGDIR, symlink_target)
os.lchown(symlink_target, pwd.getpwnam("ogboot").pw_uid, pwd.getpwnam("ogboot").pw_gid)
else:
logger.warning(f"The symbolic link already exists: {symlink_target}")
#Descargar oglive
logger.info("Downloading oglive...")
iso_name = "ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso"
@ -600,14 +607,6 @@ TFTP_OPTIONS="--secure"
except subprocess.CalledProcessError as e:
logger.error(f"Failed to install ogLive client: {e.stderr}")
logger.error("Continuing with the installation...")
symlink_target = f"{INSTALL_OGBOOT_TARGET}/tftpboot"
logger.info(f"Creating symbolic link from {TFTPCFGDIR} to {symlink_target}")
if not os.path.exists(symlink_target):
os.symlink(TFTPCFGDIR, symlink_target)
os.lchown(symlink_target, pwd.getpwnam("ogboot").pw_uid, pwd.getpwnam("ogboot").pw_gid)
else:
logger.warning(f"The symbolic link already exists: {symlink_target}")
#----------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------
#logger.info("Creating symbolic link from /opt/ogboot/tftpboot to /var/lib/tftpboot...")