Compare commits

..

No commits in common. "main" and "ogexecandlog-createimage" have entirely different histories.

4 changed files with 14 additions and 17 deletions

View File

@ -5,18 +5,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.21.0] - 2025-06-25
### Changed
- Prevent Configurar.py from messing with the browser
## [0.20.3] - 2025-06-25
### Fixed
- Fixed bugs when partitioning disks
## [0.20.2] - 2025-06-24
### Changed

View File

@ -47,6 +47,9 @@ prog = os.path.basename(__name__)
#param = ''.join(sys.argv[2:]).replace(' ', '').replace('\t', '')
param = sys.argv[2]
# Activa navegador para ver progreso
coproc = subprocess.Popen (['/opt/opengnsys/bin/browser', '-qws', 'http://localhost/cgi-bin/httpd-log.sh'])
# Leer los dos bloques de parámetros, separados por '!'.
tbprm = param.split ('!')
pparam = tbprm[0] # General disk parameters
@ -68,6 +71,7 @@ for item in tbprm:
# Error si no se define el parámetro de disco (dis).
if dis is None:
coproc.kill()
sys.exit (ogGlobals.OG_ERR_FORMAT)
# Toma valores de distribución de particiones, separados por "%".
@ -103,6 +107,7 @@ for item in tbprm:
if tam is None: missing_params.append ('tam')
if missing_params:
print (f'partition data ({item}) missing required parameters ({' '.join (missing_params)})')
coproc.kill()
sys.exit (1)
# Componer datos de particionado.
@ -148,13 +153,15 @@ if 'CACHE' in sparam:
rc = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGSCRIPTS}/initCache', tch])
if not rc:
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_CACHE, f'initCache failed')
coproc.kill()
sys.exit (1)
# Definir particionado.
SystemLib.ogEcho (['session', 'log'], None, f'[50] {ogGlobals.lang.MSG_HELP_ogCreatePartitions}')
SystemLib.ogEcho (['session', 'log'], None, f' ogCreatePartitions {dis} {' '.join (tbp)}')
res = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreatePartitions', str(dis)] + tbp)
res = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreatePartitions', dis] + tbp)
if not res:
coproc.kill()
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_GENERIC, f'ogCreatePartitions {dis} {' '.join (tbp)}')
sys.exit (1)
SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogUpdatePartitionTable'])
@ -170,8 +177,9 @@ for p in range (1, maxp+1):
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatCache'])
else:
SystemLib.ogEcho (['session', 'log'], None, f' ogFormatFs {dis} {p} {tbf[p]}')
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatFs', str(dis), str(p), tbf[p]])
if not retval:
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatFs', dis, str(p), tbf[p]])
if retval:
coproc.kill()
SystemLib.ogRaiseError (['session', 'log'], ogGlobals.OG_ERR_GENERIC, f'ogFormatFs {dis} {p} {tbf[p]}')
sys.exit (1)
# Registro de fin de ejecución
@ -182,4 +190,5 @@ SystemLib.ogEcho (['session', 'log'], None, f'{ogGlobals.lang.MSG_INTERFACE_END}
# Retorno
#___________________________________________________________________
coproc.kill()
sys.exit (0)

View File

@ -263,7 +263,7 @@ def ogFormatFs (disk, par, fs=None, label=None):
errcode = ogGlobals.OG_ERR_PARTITION
ogUnlock (disk, par)
return not errcode ## reverse to indicate success
return errcode
#/**

View File

@ -143,7 +143,7 @@ if sizerequired >= cachesizefree:
SystemLib.ogRaiseError ('session', ogGlobals.OG_ERR_CACHESIZE, 'CACHE')
sys.exit (1)
# Comprobamos que imagen cache igual a la del repo. Si sincronizada no podemos comprobar.
# Comprobamos que imagen cache igual a la del repo. Si sincronizada no podemos comprobar.
rc = ProtocolLib.ogUpdateCacheIsNecesary (repositorio, path, protocolo)
# si rc=True: actualizamos; si rc=False: no actualizamos (exit 0); si rc=None: exit error
if rc == True: pass ## es necesario actualizar