vmware / vmware/pyvmomi

ListProcessesInGuest not accepting single pid argument

Open
#304 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,

I'm currently trying to grab some info about a process I started in a VM.
I start the command with StartProgramInGuest() and get a long back with the pid.

When I now try to get info about that pid, I get an error:

File "/usr/local/lib/python2.7/dist-packages/pyvmomi-5.5.0-py2.7.egg/pyVmomi/VmomiSupport.py", line 553, in <lambda>
File "/usr/local/lib/python2.7/dist-packages/pyvmomi-5.5.0-py2.7.egg/pyVmomi/VmomiSupport.py", line 361, in _InvokeMethod
File "/usr/local/lib/python2.7/dist-packages/pyvmomi-5.5.0-py2.7.egg/pyVmomi/VmomiSupport.py", line 917, in CheckField
TypeError: 'long' object is not iterable

I use it like this:

proc = self.content.guestOperationsManager.processManager.ListProcessesInGuest(vm=vm, auth=creds, pids=pid)

If I leave out the pids I get an object with all the processes running.

Currently trying to understand if this is a bug in my code or in pyvmomi.
But looking at the specs here, https://github.com/vmware/pyvmomi/blob/master/docs/vim/vm/guest/ProcessManager.rst#id5, I am using the correct arguments.

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 with ListProcessesInGuest and the argument validation shown in pyVmomi/VmomiSupport.py, then compare the pids parameter with docs/vim/vm/guest/ProcessManager.rst. Reproduce the call using a single pid and verify the expected behavior against a collection of pids. Done means the documented single-pid call no longer raises the iterable TypeError, with regression coverage if the repository provides tests for this API.

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
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.