theforeman/foreman — pull request #1405 by domcleal (2014-04-28 08:30:01+00:00)
Title: fixes #5453 - ensure all VMware compute attribute keys are symbolized

The bug was caused by string keys used in our hashes instead of symbols. Symbols are important as fog is checking for them, so it wasn't converting a string class name into the real class here: https://github.com/fog/fog/blob/master/lib/fog/vsphere/models/compute/interface.rb#L25-L31

In 1.4, the args hash passed from the controller into create_vm got symbolised here: https://github.com/theforeman/foreman/blob/1.4-stable/app/models/compute_resources/foreman/model/vmware.rb#L95

It's very important that it's symbolised before we use nested_attributes_for, else the inner hashes (of interfaces + volumes) aren't symbolised when they're stored in an indifferent hash.

We lost this in 1.5 here: https://github.com/theforeman/foreman/blob/1.5-stable/app/models/compute_resources/foreman/model/vmware.rb#L113-L124

This PR adds symbolize_keys back into the same position and updates the clone_vm path to expect symbols too.