Merge pull request 'refs #1962 ignore tch parameter' (#35) from ignore-tch into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details

Reviewed-on: #35
pull/36/head 0.8.2
Natalia Serrano 2025-05-07 14:47:54 +02:00
commit 9514ce6b25
2 changed files with 16 additions and 11 deletions

View File

@ -5,6 +5,12 @@ 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.8.2] - 2025-05-07
### Changed
- Have Configurar.py ignore the tch parameter, take cache size from the definition of the cache partition
## [0.8.1] - 2025-05-07
### Fixed

View File

@ -35,10 +35,6 @@ prog = os.path.basename(__name__)
# El parámetro $2 es el que aporta toda la información y el $1 se queda obsoleto
# Formato de entrada:
# dis=Número de disco
# *=caracter de separación
# che=Vale 0 o 1
# *=caracter de separación
# $tch=tamaño cache
# != caracter de separación
#
# Y un numero indeterminado de cadenas del tipo siguuenteseparadas por el caracter '$':
@ -47,7 +43,7 @@ prog = os.path.basename(__name__)
#____________________________________________________________________
# Captura de parámetros (se ignora el 1er parámetro y se eliminan espacios y tabuladores).
#param='dis=1*che=0*tch=70000000!par=1*cpt=NTFS*sfi=NTFS*tam=11000000*ope=0%'
#param='dis=1!par=1*cpt=NTFS*sfi=NTFS*tam=11000000*ope=0%'
#param = ''.join(sys.argv[2:]).replace(' ', '').replace('\t', '')
param = sys.argv[2]
@ -67,19 +63,16 @@ for item in tbprm:
if '=' not in item: continue
k, v = item.split ('=', 1)
if k not in ['dis', 'tch']:
if k not in ['dis']:
print (f'ignoring unknown disk parameter ({k})')
continue
if 'dis' == k: dis = int (v)
elif 'tch' == k: tch = v
if 'dis' == k: dis = int (v)
# Error si no se define el parámetro de disco (dis).
if dis is None:
coproc.kill()
sys.exit (ogGlobals.OG_ERR_FORMAT)
if tch is None:
tch = '0'
# Toma valores de distribución de particiones, separados por "%".
tbp = [] # Valores de configuración (parámetros para ogCreatePartitions)
@ -118,7 +111,10 @@ for item in tbprm:
sys.exit (1)
# Componer datos de particionado.
if 'CACHE' != cpt: tbp.append (f'{cpt}:{tam}')
if 'CACHE' == cpt:
tch = tam
else:
tbp.append (f'{cpt}:{tam}')
if ope:
# Si se activa operación de formatear, componer datos de formateo.
if cpt not in ['EMPTY', 'EXTENDED', 'LINUX-LVM', 'LVM', 'ZPOOL']:
@ -126,6 +122,9 @@ for item in tbprm:
# Obtener la partición mayor.
if par > maxp: maxp = par
if tch is None:
tch = '0'
#____________________________________________________
#
# Proceso