Bug #22798
closedVMware: Exception listing VMs in the root of the datacenter
Description
When listing virtual machines under a compute_resource on VMware vSphere a folder hash is built of all folders under the datacenter, but the datacenter's vmFolder is skipped in the PropertyFilterSpec.
This causes VMs which have the vmFolder as their parent to throw an undefined method '[]' for nil:NilClass error when they try to access 'folder_inventory[vm['parent']._ref][:path]'.
Traceback:
2018-03-06T11:11:34 fd0ae69d [app] [W] Error has occurred while listing VMs on dev-vc65 (VMware)
| NoMethodError: undefined method `[]' for nil:NilClass
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:61:in `lookup_parent_folders'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:62:in `lookup_parent_folders'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:56:in `block in set_folder_paths'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:55:in `each'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:55:in `set_folder_paths'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:50:in `generate_folder_inventory'
| /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:21:in `all'
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/5297 added
Updated by Ohad Levy about 7 years ago
- Related to Feature #22258: VMWare: Speed up VM listing added
Updated by Adam Grare about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100