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 almost 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 almost 7 years ago
- Category set to Compute resources - VMware
Updated by Ohad Levy almost 7 years ago
- Translation missing: en.field_release set to 330
Updated by Ohad Levy almost 7 years ago
- Related to Feature #22258: VMWare: Speed up VM listing added
Updated by Adam Grare almost 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 68e96c10b596d67106a3ed49535231019d8507b4.