diff --git a/client/shared/scripts/listSoftwareInfo.py b/client/shared/scripts/listSoftwareInfo.py index 3ad6cef..84f94ae 100755 --- a/client/shared/scripts/listSoftwareInfo.py +++ b/client/shared/scripts/listSoftwareInfo.py @@ -14,26 +14,21 @@ if len(sys.argv) > 1 and sys.argv[1] == "-r": REDUCED = "yes" sys.argv.pop(1) -# Validar argumentos if len(sys.argv) != 3: SystemLib.ogRaiseError("session", ogGlobals.OG_ERR_FORMAT, f"{ogGlobals.MSG_FORMAT}: {PROG} ndisco nparticion") sys.exit(1) -# Nombre del archivo de listado SOFTFILE = f"soft-{NetLib.ogGetIpAddress()}-{sys.argv[1]}-{sys.argv[2]}" softfile_path = os.path.join(ogGlobals.OGLOG, SOFTFILE) try: - # Generar listado de software con InventoryLib.ogListSoftware software_list = InventoryLib.ogListSoftware(int(sys.argv[1]), int(sys.argv[2])) if REDUCED == "no": - # Escribir el listado completo al archivo with open(softfile_path, "w") as f: for line in software_list: f.write(f"{line}\n") else: - # Filtrar parches de Windows (KBxxxxxx) y guardar filtered_list = [line for line in software_list if "(KB" not in line] with open(softfile_path, "w") as f: for line in filtered_list: @@ -42,6 +37,5 @@ try: print(softfile_path) except Exception as e: - # Manejar errores SystemLib.ogRaiseError("session", ogGlobals.OG_ERR_FORMAT, f"Error al generar el listado de software: {e}") sys.exit(1) \ No newline at end of file