From 00ee895353427a7845681fd4388af16b45cd87aa Mon Sep 17 00:00:00 2001 From: Vadim Troshchinskiy Date: Thu, 14 Aug 2025 16:09:33 +0200 Subject: [PATCH] refs #2506 argument fixes --- .../modules/server/ogAdmClient/__init__.py | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/opengnsys/modules/server/ogAdmClient/__init__.py b/src/opengnsys/modules/server/ogAdmClient/__init__.py index 0da6a57..10ada4b 100644 --- a/src/opengnsys/modules/server/ogAdmClient/__init__.py +++ b/src/opengnsys/modules/server/ogAdmClient/__init__.py @@ -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]