vmware / vsphere-automation-sdk-python

Python samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
MIT License
746 stars 313 forks source link

pyvmomi for vSphere 8.0 incompatible with automation SDK #346

Closed kunal-pmj closed 10 months ago

kunal-pmj commented 1 year ago

Describe the bug

taks.WaitForTask broken on version >8.0.0.

The issue has been reported against pyvmomi

Reproduction steps

Run any sample which involves

pyVim.task.WaitForTask()

e.g. managing disks sample

Expected behavior

The sample should execure fine

Additional context

No response

ra-albrecht commented 1 year ago

Have the same problem, but it looks like it is a later change. in an somewhat older install it works as expected. On a fresh install I get following stacktrace on debug:

File "/tmp/pycharm_project_535/src/vcenter_inventory/commands/command.py", line 101, in wait_for_task
    WaitForTask(vmtask, onProgressUpdate=self.print_task_progress)
  File "/home/xxxx/.virtualenvs/vcenter-inventory/lib/python3.10/site-packages/pyVim/task.py", line 126, in WaitForTask
    filter = CreateFilter(pc, task)
  File "/home/xxxx/.virtualenvs/vcenter-inventory/lib/python3.10/site-packages/pyVim/task.py", line 266, in CreateFilter
    return CreateTasksFilter(pc, [task])
  File "/home/xxxx/.virtualenvs/vcenter-inventory/lib/python3.10/site-packages/pyVim/task.py", line 275, in CreateTasksFilter
    objspecs = [
  File "/home/xxxx/.virtualenvs/vcenter-inventory/lib/python3.10/site-packages/pyVim/task.py", line 276, in <listcomp>
    vmodl.Query.PropertyCollector.ObjectSpec(obj=task) for task in tasks
  File "/home/xxxx/.virtualenvs/vcenter-inventory/lib/python3.10/site-packages/pyVmomi/VmomiSupport.py", line 249, in __getattr__
    raise AttributeError(attr)
AttributeError: Query. Did you mean: 'query'?
kunal-pmj commented 10 months ago

The issue has been fixed