vmware / vmware/pyvmomi

Typing: VirtualMachine optional fields

Open
#1,074 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Type hints for the VirtualMachine object aren't correct. The following fields should be optional (according to the documentation):

  • config
  • datastore
  • guest
  • layout
  • layoutEx
  • network
  • parentVApp
  • resourceConfig
  • resourcePool
  • rootSnapshot
  • snapshot
  • storage
Reproduction steps

Look at VirtualMachine object type hints.

vm: vim.VirtualMachine

... (logic for fetching VM)

config: vim.vm.ConfigInfo | None = vm.config (<- is not 100% correct, because vm.config type hint is just vim.vm.ConfigInfo)

Expected behavior

Type hints are shown as optional for those fields.

Additional context

Documentation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VirtualMachine object type hints and compare the listed fields with the linked vSphere documentation. Update the annotations so config, datastore, guest, layout, layoutEx, network, parentVApp, resourceConfig, resourcePool, rootSnapshot, snapshot, and storage are optional, then verify the reproduced type-checking example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.