refs #1979 pass imgname to ogConfigureOgagent()
parent
b9a2c58c96
commit
06885b35d7
|
@ -5,6 +5,7 @@
|
|||
#@brief Script para realizar la configuracion del sistema operativo restaurado.
|
||||
#@param 1 disco
|
||||
#@param 2 particion
|
||||
#@param 2 nombre imagen
|
||||
#@return
|
||||
#@TODO comprobar que el tipo de particion corresponde con el sistema de archivos.
|
||||
#@exception OG_ERR_FORMAT # 1 formato incorrecto.
|
||||
|
@ -30,8 +31,9 @@ import FileLib
|
|||
## [ -f $DEVICECFG ] && source $DEVICECFG
|
||||
## pero luego no utiliza ninguna de las variables definidas en el archivo...
|
||||
|
||||
disk = sys.argv[1]
|
||||
par = sys.argv[2]
|
||||
disk = sys.argv[1]
|
||||
par = sys.argv[2]
|
||||
imgname = sys.argv[3]
|
||||
|
||||
# Si el sistema de archivos no esta extendido, ampliarlo al tamaño de su partición.
|
||||
partsize = DiskLib.ogGetPartitionSize (disk, par)
|
||||
|
@ -71,7 +73,7 @@ if 'Windows' == ostype:
|
|||
BootLib.ogFixBootSector (disk, par) # Configurar el boot sector de la partición Windows.
|
||||
BootLib.ogWindowsBootParameters (disk, par) # Configurar el gestor de arranque de Windows XP/Vista/7.
|
||||
BootLib.ogWindowsRegisterPartition (disk, par, 'C', disk, par) # Registrar en Windows que la partición indicada es su nueva unidad C:\
|
||||
PostConfLib.ogConfigureOgagent (disk, par) # Configurar nuevo agente OGAgent.
|
||||
PostConfLib.ogConfigureOgagent (disk, par, imgname) # Configurar nuevo agente OGAgent.
|
||||
path1 = FileLib.ogGetPath (file=f'{mntdir}/windows/ogAdmWinClient.exe')
|
||||
path2 = FileLib.ogGetPath (file=f'{mntdir}/winnt/ogAdmWinClient.exe')
|
||||
if path1 or path2: # Eliminar el antiguo cliente de Windows.
|
||||
|
@ -88,7 +90,7 @@ elif 'Linux' == ostype:
|
|||
find_out = subprocess.run (['find', f'{mntdir}/usr/sbin', f'{mntdir}/sbin', f'{mntdir}/usr/local/sbin', '-name', 'ogAdmLnxClient', '-print'], capture_output=True, text=True).stdout
|
||||
if find_out:
|
||||
PostConfLib.ogUninstallLinuxClient (disk, par) # Eliminar el antiguo cliente de Linux.
|
||||
PostConfLib.ogConfigureOgagent (disk, par) # Configurar nuevo agente OGAgent.
|
||||
PostConfLib.ogConfigureOgagent (disk, par, imgname) # Configurar nuevo agente OGAgent.
|
||||
## Modificar el nombre del equipo
|
||||
print (f'Asignar nombre Linux "{host}".')
|
||||
etc = FileLib.ogGetPath (src=f'{disk} {par}', file='/etc')
|
||||
|
@ -154,6 +156,6 @@ elif 'MacOS' == ostype:
|
|||
fd.write ('\trm -f /osxpostconf # Borrar fichero indicador de psotconfiguración\n')
|
||||
fd.write ('fi\n')
|
||||
os.chmod (f'{mntdir}/var/root/postconfd.sh', 0o700) # Dar permiso de ejecución.
|
||||
PostConfLib.ogConfigureOgagent (disk, par) # Configurar nuevo agente OGAgent de sistema operativo.
|
||||
PostConfLib.ogConfigureOgagent (disk, par, imgname) # Configurar nuevo agente OGAgent de sistema operativo.
|
||||
|
||||
sys.exit (0)
|
||||
|
|
Loading…
Reference in New Issue