From ac24d63b70685d552787be067b98941db4642949 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Thu, 28 Aug 2025 11:35:21 +0200 Subject: [PATCH] refs #2688 pass a new parameter "gen-script" to Configurar --- CHANGELOG.md | 6 ++++++ src/opengnsys/modules/server/ogAdmClient/__init__.py | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5104059..b8f6651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,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). +## [8.1.0] - 2025-08-28 + +### Changed + +- Pass a new parameter "gen-script" to Configurar + ## [8.0.0] - 2025-08-08 ### Changed diff --git a/src/opengnsys/modules/server/ogAdmClient/__init__.py b/src/opengnsys/modules/server/ogAdmClient/__init__.py index 4124ac1..8266b5f 100644 --- a/src/opengnsys/modules/server/ogAdmClient/__init__.py +++ b/src/opengnsys/modules/server/ogAdmClient/__init__.py @@ -560,6 +560,7 @@ class ogAdmClientWorker (ogLiveWorker): cfg = post_params['cfg'] ids = post_params['ids'] check_sizes = str ('check-sizes' in post_params and 'true' == post_params['check-sizes']).lower() + gen_script = str ('gen-script' in post_params and 'true' == post_params['gen-script']).lower() if 'true' != check_sizes: self.muestraMensaje (4) @@ -581,8 +582,9 @@ class ogAdmClientWorker (ogLiveWorker): cfg_str = f'{disk_info_str}!{part_info_str}%' + script_out = f'/tmp/ConfigurarScript-{self.IPlocal}' try: - self.interfaceAdmin (nfn, ['ignored', cfg_str, check_sizes]) + self.interfaceAdmin (nfn, ['ignored', cfg_str, script_out, check_sizes, gen_script]) if 'true' != check_sizes: self.muestraMensaje (14) herror = 0 except: @@ -599,6 +601,9 @@ class ogAdmClientWorker (ogLiveWorker): logger.warning ('No se ha podido recuperar la configuración de las particiones del disco') return {} cmd['cfg'] = self.cfg2obj (cfg) + if 'true' == gen_script: + script_contents = Path (script_out).read_bytes() + cmd['script'] = base64.b64encode (script_contents).decode ('utf-8') self.muestraMenu() return self.respuestaEjecucionComando (cmd, herror, ids)