[pve-devel] [PATCH v2 pve-esxi-import-tools 5/7] listvms: dump json directly to stdout

Max Carrara m.carrara at proxmox.com
Fri Mar 22 19:06:22 CET 2024


Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
Changes v1 --> v2:
  * new (thanks for the suggestion, Lukas!)

 listvms.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/listvms.py b/listvms.py
index 354844b..58b09df 100755
--- a/listvms.py
+++ b/listvms.py
@@ -254,7 +254,7 @@ def main():
                     file=sys.stderr,
                 )
 
-    print(json.dumps(data, indent=2, default=json_dump_helper))
+    json.dump(data, sys.stdout, indent=2, default=json_dump_helper)
 
 
 if __name__ == "__main__":
-- 
2.39.2





More information about the pve-devel mailing list