parent
61b64dea9e
commit
401f231086
|
|
@ -14,25 +14,8 @@ config_file = os.path.join(PROGRAM_DIR, 'config.json')
|
||||||
with open(config_file, 'r') as f:
|
with open(config_file, 'r') as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
# Extraer parámetros de configuración
|
# Extraer parámetros relevantes
|
||||||
ogcore_ip_port = config['ogCore_ServerIP']
|
|
||||||
if ':' in ogcore_ip_port:
|
|
||||||
OGCORE_IP, OGCORE_PORT = ogcore_ip_port.split(':')
|
|
||||||
else:
|
|
||||||
OGCORE_IP = ogcore_ip_port
|
|
||||||
OGCORE_PORT = "8443"
|
|
||||||
|
|
||||||
ogboot_ip_port = config['ogBoot_ServerIP']
|
|
||||||
if ':' in ogboot_ip_port:
|
|
||||||
OGBOOT_IP, OGBOOT_PORT = ogboot_ip_port.split(':')
|
|
||||||
else:
|
|
||||||
OGBOOT_IP = ogboot_ip_port
|
|
||||||
OGBOOT_PORT = "8082"
|
|
||||||
|
|
||||||
oglive_iso_url = config["ogLive_Default"]
|
|
||||||
INSTALL_OGBOOT_TARGET = config["ogBoot_Dir"]
|
INSTALL_OGBOOT_TARGET = config["ogBoot_Dir"]
|
||||||
OPENGNSYS_CLIENT_USER = config["ogBootSambaUser"]
|
|
||||||
OPENGNSYS_CLIENT_PASSWD = config["ogBootSambaPass"]
|
|
||||||
|
|
||||||
|
|
||||||
def og_boot_copy_files():
|
def og_boot_copy_files():
|
||||||
|
|
@ -40,7 +23,6 @@ def og_boot_copy_files():
|
||||||
Copia los archivos necesarios al punto de montaje de ogBoot.
|
Copia los archivos necesarios al punto de montaje de ogBoot.
|
||||||
Preserva el directorio client/images si existe.
|
Preserva el directorio client/images si existe.
|
||||||
"""
|
"""
|
||||||
# repo_dir = os.path.join(PROGRAM_DIR)
|
|
||||||
repo_dir = os.path.dirname(PROGRAM_DIR) # Ruta al directorio ogboot
|
repo_dir = os.path.dirname(PROGRAM_DIR) # Ruta al directorio ogboot
|
||||||
directories = {
|
directories = {
|
||||||
"bin": os.path.join(repo_dir, "bin"),
|
"bin": os.path.join(repo_dir, "bin"),
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,17 @@
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Configuración básica del logger
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Cargar configuración desde config.json
|
|
||||||
PROGRAM_DIR = os.path.dirname(os.path.abspath(__file__))
|
PROGRAM_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
config_file = os.path.join(PROGRAM_DIR, 'config.json')
|
config_file = os.path.join(PROGRAM_DIR, 'config.json')
|
||||||
with open(config_file, 'r') as f:
|
with open(config_file, 'r') as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
# Extraer parámetros de configuración
|
|
||||||
ogcore_ip_port = config['ogCore_ServerIP']
|
|
||||||
if ':' in ogcore_ip_port:
|
|
||||||
OGCORE_IP, OGCORE_PORT = ogcore_ip_port.split(':')
|
|
||||||
else:
|
|
||||||
OGCORE_IP = ogcore_ip_port
|
|
||||||
OGCORE_PORT = "8443"
|
|
||||||
|
|
||||||
ogboot_ip_port = config['ogBoot_ServerIP']
|
|
||||||
if ':' in ogboot_ip_port:
|
|
||||||
OGBOOT_IP, OGBOOT_PORT = ogboot_ip_port.split(':')
|
|
||||||
else:
|
|
||||||
OGBOOT_IP = ogboot_ip_port
|
|
||||||
OGBOOT_PORT = "8082"
|
|
||||||
|
|
||||||
oglive_iso_url = config["ogLive_Default"]
|
|
||||||
INSTALL_OGBOOT_TARGET = config["ogBoot_Dir"]
|
INSTALL_OGBOOT_TARGET = config["ogBoot_Dir"]
|
||||||
OPENGNSYS_CLIENT_USER = config["ogBootSambaUser"]
|
|
||||||
OPENGNSYS_CLIENT_PASSWD = config["ogBootSambaPass"]
|
|
||||||
|
|
||||||
|
|
||||||
def update_ipxe_boot_files():
|
def update_ipxe_boot_files():
|
||||||
|
|
@ -101,6 +80,7 @@ def update_ipxe_boot_files():
|
||||||
logger.info("Proceso completado exitosamente.")
|
logger.info("Proceso completado exitosamente.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
if update_ipxe_boot_files():
|
if update_ipxe_boot_files():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue