You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$vm = $vhost->findOneManagedObject('VirtualMachine', 'vm-123');
$vm->snapshot; //infinite loop$vm->hasSnapshots(); // tries to get $this->snapshot, infinite loop
The problem is that when there are no snapshots for the virtual machine, vSphere does not return a snapshot index at all. I verified this by inspecting the result from PropertyCollector->collectPropertiesFor. When it tries to access snapshot on that object it just starts the process all over again and loops until the maximum amount of nested function calls is reached.
Luckily, checking for the existence of snapshot with isset in Service->getQueriedProperty solves the issue:
vm-123 has no snapshots.
The problem is that when there are no snapshots for the virtual machine, vSphere does not return a snapshot index at all. I verified this by inspecting the result from
PropertyCollector->collectPropertiesFor
. When it tries to accesssnapshot
on that object it just starts the process all over again and loops until the maximum amount of nested function calls is reached.Luckily, checking for the existence of
snapshot
withisset
inService->getQueriedProperty
solves the issue:I'm going to make a pull request for the fix.
The text was updated successfully, but these errors were encountered: