I hope this makes sense(I’m still learning Ruby).
I have this at the beginning of my “vmware_best_fit_with_tags” automate method:
prov = $evm.root[‘miq_provision_request’] || $evm.root[‘miq_provision’] || $evm.root[‘miq_provision_request_template’]
$evm.log(‘info’, “TROUBLESHOOTING Provision Object: #{prov.inspect}”)
It dumps out a whole bunch of stuff but the information I really need appears to be wrapped up in a nested array which appears to be an instance variable. Part of my “#{prov.inspect}” output looks like this:
@associations=[“destination”, “eligible_clusters”, “eligible_customization_templates”, “eligible_folders”, “eligible_hosts”, “eligible_iso_images”, “eligible_pxe_images”, “eligible_pxe_servers”, “eligible_resource_pools”, “eligible_storage_profiles”, “eligible_storages”, “eligible_windows_images”, “miq_provision_request”, “miq_request”, “miq_request_task”, “miq_request_tasks”, “source”, “tenant”, “vm”, “vm_template”]
vmware_best_fit_with_tags is looking for things like eligible_hosts and eligible_storages but isn’t finding them - I haven’t been able to even print these values out to the log.
Can somebody tell me how I might get the values of those “@associations” elements?
Thanks