public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v1 pve-esxi-import-tools 0/5] Improve listvms.py
@ 2024-03-19 15:32 Max Carrara
  2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 1/5] listvms: remove unused import and variable Max Carrara
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Max Carrara @ 2024-03-19 15:32 UTC (permalink / raw)
  To: pve-devel

This series adds a bunch of improvements for listvms.py, most notably
better typing (and thus better linting support) as well as parsing
arguments via the Python STL's `argparse` [0]. For more information,
please see the individual patches.

All patches were additionally tested in order to ensure that the JSON
output on successful invocations remains unchanged. This was done as
follows:

  # on master
  ./listvms.py $ARGS | jq > ref.json
  # after each patch
  ./listvms.py $ARGS | jq > output.json
  diff -u ref.json output.json

Furthermore, I built the repo's package and installed it on my local
system, and re-added my virtual ESXi host in the storage settings. The
plugin worked as expected - all my VMs on the ESXi hosts showed up and
were able to be live-imported. 

[0]: https://docs.python.org/3.11/library/argparse.html

Max Carrara (5):
  listvms: remove unused import and variable
  listvms: reorder imports
  listvms: improve typing and add dataclasses to represent dicts
  listvms: add arg parser, context manager for connections, fetch helper
  listvms: run formatter

 listvms.py | 296 ++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 225 insertions(+), 71 deletions(-)

-- 
2.39.2





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-03-20 17:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19 15:32 [pve-devel] [PATCH v1 pve-esxi-import-tools 0/5] Improve listvms.py Max Carrara
2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 1/5] listvms: remove unused import and variable Max Carrara
2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 2/5] listvms: reorder imports Max Carrara
2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 3/5] listvms: improve typing and add dataclasses to represent dicts Max Carrara
2024-03-20  9:38   ` Lukas Wagner
2024-03-20 10:08     ` Max Carrara
2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 4/5] listvms: add arg parser, context manager for connections, fetch helper Max Carrara
2024-03-20  9:39   ` Lukas Wagner
2024-03-20 10:08     ` Max Carrara
2024-03-20 12:45   ` Wolfgang Bumiller
2024-03-20 17:00     ` Max Carrara
2024-03-19 15:32 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 5/5] listvms: run formatter Max Carrara
2024-03-20  9:42 ` [pve-devel] [PATCH v1 pve-esxi-import-tools 0/5] Improve listvms.py Lukas Wagner
2024-03-20 10:08   ` Max Carrara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal