class Fission::Action::VM::Cloner

def update_config(from, to)

Returns nothing.

@cloner.update_config 'foo', 'bar'

Examples

to - The name of the newly cloned VM.
from - The VM name that was used as the source of the clone.

Any binary '.vmdk' files will be skipped.
update any files with the extension of '.vmx', '.vmxf', and '.vmdk'.
Internal: Updates config files for a newly cloned VM. This will
def update_config(from, to)
  ['.vmx', '.vmxf', '.vmdk'].each do |ext|
    file = File.join @target_vm.path, "#{to}#{ext}"
    unless File.binary?(file)
      text = (File.read file).gsub from, to
      File.open(file, 'w'){ |f| f.print text }
    end
    clean_up_conf_file(file) if ext == '.vmx'
  end
end