From 7f6ec263e87f58be2c3b0e0db34a3577e152a271 Mon Sep 17 00:00:00 2001 From: Vadim Troshchinskiy Date: Thu, 28 Aug 2025 13:16:04 +0200 Subject: [PATCH] refs #2506 -- argument refactoring in Crear/Modificar imagen --- ogclient/interfaceAdm/CrearImagenGit | 2 +- ogclient/interfaceAdm/ModificarImagenGit | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/ogclient/interfaceAdm/CrearImagenGit b/ogclient/interfaceAdm/CrearImagenGit index 7aa879c..87c66ee 100755 --- a/ogclient/interfaceAdm/CrearImagenGit +++ b/ogclient/interfaceAdm/CrearImagenGit @@ -106,7 +106,7 @@ def main(): # repo = repositorio, oggit@server.com:/oggit # image = nombre repo - retval = create_image(args.disk, args.partition, args.repository, args.image_name, args.tag) + retval = create_image(args.disk, args.partition, args.repository, args.image_name) diff --git a/ogclient/interfaceAdm/ModificarImagenGit b/ogclient/interfaceAdm/ModificarImagenGit index 9058fb8..4e99a03 100755 --- a/ogclient/interfaceAdm/ModificarImagenGit +++ b/ogclient/interfaceAdm/ModificarImagenGit @@ -116,27 +116,7 @@ def main(): args = parser.parse_args() - - - if len(sys.argv) != 7: - import json - args = json.dumps(sys.argv) - sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, f"Incorrect number of arguments. Got {len(sys.argv)}. Usage: ModificarImagenGit.py disk_num partition_num repo new_branch options msg. Received args: {args}")) - - # repo - repositorio, ip address. Opcional porque oglive lo recibe como parametro de kernel - # tag - tag a crear automaticamente. Opcional, no necesitamos crear un tag siempre. - - - disk_num, partition_num, repo, branch, options, msg = sys.argv[1:7] - - print(f"Repo : {repo}") - print(f"Branch : {branch}") - print(f"Options: {options}") - print(f"Msg : {msg}") - - opengnsys_log_dir = "/opt/opengnsys/log" - ip_address = NetLib.ogGetIpAddress() - logFilePath = f"{opengnsys_log_dir}/{ip_address}.log" + logFilePath = "/var/log/opengnsys.ModificarImagenGit.log" ogLog = OgLogger() ogLog.setLevel(logging.DEBUG) @@ -156,7 +136,7 @@ def main(): logger.info("Starting ModificarImagenGit") - retval = commit_image(disk_num, partition_num, repo, branch, options, msg) + retval = commit_image(args.disk, args.partition, args.repository, args.branch, args.options, args.message) logger.info("ModificarImagenGit done, return code %i", retval)