[pve-devel] [PATCH v1 pve-esxi-import-tools 0/5] Improve listvms.py

Max Carrara m.carrara at proxmox.com
Wed Mar 20 11:08:29 CET 2024


On Wed Mar 20, 2024 at 10:42 AM CET, Lukas Wagner wrote:
> On  2024-03-19 16:32, Max Carrara wrote:
> > 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. 
> > 
>
> Looks good to me.
>
> Since this is type-hinted Python code, maybe the following `mypy.ini` would make sense?
>
> ```
> [mypy]
>
> [mypy-pyVmomi]
> ignore_missing_imports = True
>
> [mypy-pyVim.*]
> ignore_missing_imports = True
> ```
>
> Otherwise `mypy` complains about missing type stubs for those two modules :)

I think adding this wouldn't hurt at all, so I'll include it in v2.
Thanks for the suggestion!

If only the VMware Python stuff wasn't so ... well, the way it is.

>
>
> Tested-by: Lukas Wagner <l.wagner at proxmox.com>
> Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>

Thanks for reviewing and testing!





More information about the pve-devel mailing list