refs #2506 argument fixes

modificar-imagen-branch
Vadim vtroshchinskiy 2025-08-14 16:09:33 +02:00
parent a272fc1d5e
commit 00ee895353
1 changed files with 20 additions and 14 deletions

View File

@ -361,7 +361,7 @@ class ogAdmClientWorker (ogLiveWorker):
return self.respuestaEjecucionComando (cmd, herror, ids)
def do_CrearImagenGit (self, post_params):
for k in ['nfn', 'ids', 'disk', 'partition', 'repository']:
for k in ['nfn', 'ids', 'disk', 'partition', 'repository', 'image_name']:
if k not in post_params:
logger.error (f'required parameter ({k}) not in POST params')
return {}
@ -369,10 +369,13 @@ class ogAdmClientWorker (ogLiveWorker):
nfn = post_params['nfn']
ids = post_params['ids']
disk = post_params['disk'] ## Numero de disco
partition = post_params['partition'] ## Numero de partición
repo = post_params['repository'] ## URL a repositorio
msg = post_params['message'] ## Mensaje de commit (opcional)
disk = post_params['disk'] ## Numero de disco
partition = post_params['partition'] ## Numero de partición
repo = post_params['repository'] ## URL a repositorio
image_name = post_params['image_name'] ## Nombre de imagen
msg = post_params['message'] ## Mensaje de commit (opcional)
self.muestraMensaje (7)
@ -386,9 +389,9 @@ class ogAdmClientWorker (ogLiveWorker):
self.muestraMensaje (2)
inv_sft = res['contents']
try:
create_args = ["--disk", disk, "--partition", partition, "--repository", repo]
create_args = ["--disk", disk, "--partition", partition, "--repository", repo, "--image-name", image_name]
if msg:
create_args = create_args = ['--message', msg]
create_args = create_args + ['--message', msg]
self.interfaceAdmin (nfn, create_args)
self.muestraMensaje (9)
@ -426,6 +429,7 @@ class ogAdmClientWorker (ogLiveWorker):
disk = post_params['disk'] ## Disco
partition = post_params['partition'] ## Número de partición
repo = post_params['repository'] ## Ip del repositorio
branch = post_params['branch'] ## Rama nueva a crear
options = post_params['options'] ## Opciones (force push, etc)
msg = post_params['message'] ## Commit message
@ -518,7 +522,7 @@ class ogAdmClientWorker (ogLiveWorker):
return self.respuestaEjecucionComando (cmd, herror, ids)
def do_RestaurarImagenGit (self, post_params):
for k in ['nfn', 'ids', 'disk', 'partition', 'repository', 'commit']:
for k in ['nfn', 'ids', 'disk', 'partition', 'repository', 'image_name', 'commit']:
if k not in post_params:
logger.error (f'required parameter ({k}) not in POST params')
return {}
@ -526,16 +530,18 @@ class ogAdmClientWorker (ogLiveWorker):
nfn = post_params['nfn']
ids = post_params['ids']
disk = post_params['disk'] ## Numero de disco
partition = post_params['partition'] ## Numero de partición
repo = post_params['repository'] ## URL a repositorio
branch = post_params['branch'] ## Rama de git seleccionada para restaurar
commit = post_params['commit'] ## Referencia de git a restaurar. Debe ser un commit dentro de la rama indicada.
disk = post_params['disk'] ## Numero de disco
partition = post_params['partition'] ## Numero de partición
repo = post_params['repository'] ## URL a repositorio
image_name = post_params['image_name'] ## Nombre de imagen
branch = post_params['branch'] ## Rama de git seleccionada para restaurar
commit = post_params['commit'] ## Referencia de git a restaurar. Debe ser un commit dentro de la rama indicada.
self.muestraMensaje (3)
try:
restore_args = ["--disk", disk, "--partition", partition, "--repository", repo, "--commit", commit]
restore_args = ["--disk", disk, "--partition", partition, "--repository", repo, "--image-name", image_name, "--commit", commit]
if branch:
restore_args = restore_args + ["--branch", branch]