From b402ae69731dc92fb72f9b697a15543e56ee4a89 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Thu, 24 Jul 2025 15:18:10 +0200 Subject: [PATCH] refs #2530 show listSoftwareInfo errors in the log --- ogclient/interfaceAdm/InventarioSoftware | 12 +++++++++--- ogclient/lib/python3/NetLib.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ogclient/interfaceAdm/InventarioSoftware b/ogclient/interfaceAdm/InventarioSoftware index 631c7ea..9560124 100755 --- a/ogclient/interfaceAdm/InventarioSoftware +++ b/ogclient/interfaceAdm/InventarioSoftware @@ -27,12 +27,18 @@ if __name__ == "__main__": # Registro de inicio de ejecución ogEcho (['log', 'session'], None, f'{ogGlobals.lang.MSG_INTERFACE_START} {prog} {disk} {par} {dest_file}') - listsi_out = subprocess.run ([f'{ogGlobals.OGSCRIPTS}/listSoftwareInfo', disk, par], capture_output=True, text=True).stdout + p = subprocess.run ([f'{ogGlobals.OGSCRIPTS}/listSoftwareInfo', disk, par], capture_output=True, text=True) + listsi_out = p.stdout + listsi_err = p.stderr if listsi_out: file = listsi_out.splitlines()[0] else: - ogRaiseError ([], ogGlobals.OG_ERR_GENERIC, 'listSoftwareInfo failed') - sys.exit (1) + if listsi_err: + ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, listsi_err) + sys.exit (1) + else: + ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'listSoftwareInfo failed') + sys.exit (1) shutil.copy (file, dest_file) diff --git a/ogclient/lib/python3/NetLib.py b/ogclient/lib/python3/NetLib.py index f36d342..66a6ba1 100644 --- a/ogclient/lib/python3/NetLib.py +++ b/ogclient/lib/python3/NetLib.py @@ -160,7 +160,7 @@ def ogGetIpAddress(): addrs = e['addr_info'] for a in addrs: if 'inet' != a['family']: continue - addresses.append ({ 'local': a['local'], 'prefixlen': a['prefixlen'] }) + addresses.append (a['local']) if 1 != len (addresses): raise Exception ('more than one local IP address found')