rlane / rbvmomi

Ruby interface to the VMware vSphere API. vmware/rbvmomi is the official repo.
MIT License
178 stars 0 forks source link

add the ability use an autovivifying hash in the inventory method #16

Closed estonfer closed 12 years ago

estonfer commented 12 years ago

This allows for the use of the inventory method in this fashion

VIM = RbVmomi::VIM vim = VIM.connect opts dc=vim.serviceInstance.find_datacenter('MyDC') inventory = dc.vmFolder.inventory( 'VirtualMachine' => :all )

otherwise this method returns an error about assigning an array to a NilClass.

estonfer commented 12 years ago

fair enough I'll patch it up with a try and catch instead to avoid the use of the chain_hash function.