(#10570) Use nil in-place of missing attributes
(#10570) Use nil in-place of missing attributes

Without this patch, `Fog::Compute::Vsphere#convert_vm_mob_ref_to_attr_hash`
method produces unhandled exceptions during VMware cloning and listing
operations. The root cause of these exceptions are based on the fact
that some VMware virtual machine attributes: hypervisor name, and
macaddress, are not available until the cloning process has finished.

These exceptions can be triggered when external events take place within
the VMware infrastructure such as end-users cloning machines via some
other VMware management tool.

This patch solves the problem by catching any exceptions that occur
during attribute lookups for both the hypervisor name and the virtual
machine macaddress, and setting them to nil.

This patch also removes the host attribute from the hash generated by
the `Fog::Compute::Vsphere#convert_vm_mob_ref_to_attr_hash` method. The
hypervisor attribute is added instead, which is an alias to host.

This patch changes the behaviour of the
`Fog::Compute::Vsphere#convert_vm_mob_ref_to_attr_hash` method by
catching exceptions for missing attributes, and setting them to nil.

github/fog,Ladas/fog,duhast/fog,covario-cdiaz/fog,Programatica/fog,TerryHowe/fog,asebastian-r7/fog,backupify/fog,covario-cdiaz/fog,adecarolis/fog,pyama86/fog,kongslund/fog,nandhanurrevanth/fog,mitchlloyd/fog,brilliomsinterop/fog,pravi/fog,dustacio/fog,ManageIQ/fog,surminus/fog,Programatica/fog,brandondunne/fog,dustacio/fog,glennpratt/fog,TerryHowe/fog,10io/fog,mohitsethi/fog,backupify/fog,SpryBTS/fog,fog/fog,ManageIQ/fog,dhague/fog,dLobatog/fog,seanhandley/fog,brilliomsinterop/fog,plribeiro3000/fog,asebastian-r7/fog,martinb3/fog,nandhanurrevanth/fog,bdunne/fog,phillbaker/fog,nicolasbrechet/fog,b0ric/fog,theforeman/fog,12spokes/fog,nalabjp/fog,eLobato/fog,phillbaker/fog,adamleff/fog,fog/fog,joshisa/fog,bryanl/fog,duhast/fog,adecarolis/fog,lwander/fog,plribeiro3000/fog,cocktail-io/fog,icco/fog,alphagov/fog,ack/fog,adamleff/fog,sideci-sample/sideci-sample-fog,brilliomsinterop/fog,10io/fog,surminus/fog,b0e/fog,Ladas/fog,sideci-sample/sideci-sample-fog,b0ric/fog,joshmyers/fog,github/fog,displague/fog,zephyrean/fog,SpryBTS/fog,icco/fog,petems/fog,mavenlink/fog,unorthodoxgeek/fog,alphagov/fog,sferik/fog,sapcc/fog,eLobato/fog,runtimerevolution/fog,displague/fog,mitchlloyd/fog,MSOpenTech/fog,NETWAYS/fog,bryanl/fog,nicolasbrechet/fog,nandhanurrevanth/fog,theforeman/fog,petems/fog,glennpratt/fog,rackspace/fog,yyuu/fog,cocktail-io/fog,dpowell7/fog,martinb3/fog,runtimerevolution/fog,zephyrean/fog,MSOpenTech/fog,joshisa/fog,pravi/fog,kongslund/fog,sapcc/fog,phillbaker/fog,dhague/fog,NETWAYS/fog,unorthodoxgeek/fog,dLobatog/fog,dtdream/fog,ack/fog,seanhandley/fog,nalabjp/fog,yyuu/fog,zephyrean/fog,joshmyers/fog,mavenlink/fog,lwander/fog,papedaniel/fog,dtdream/fog,rackspace/fog,pyama86/fog,mohitsethi/fog,papedaniel/fog