Call cap for building iso

This commit is contained in:
sophia 2020-07-16 15:18:19 -05:00
parent 3f867e0df4
commit e5d7813b0a
2 changed files with 3 additions and 4 deletions

View File

@ -98,10 +98,9 @@ module Vagrant
File.open("#{source_dir}/meta-data", 'w') { |file| file.write(meta_data.to_s) }
iso_path = env[:env].host.capability(:create_iso, env[:env],
iso_path = env[:env].host.capability(:create_iso,
source_dir, volume_id: "cidata")
attach_disk_config(machine, env, iso_path)
attach_disk_config(machine, env, iso_path.to_path)
ensure
FileUtils.remove_entry(source_dir)
end

View File

@ -106,7 +106,7 @@ describe Vagrant::Action::Builtin::CloudInitSetup do
expect(File).to receive(:open).with("#{source_dir}/user-data", 'w').and_return(true)
expect(File).to receive(:open).with("#{source_dir}/meta-data", 'w').and_return(true)
expect(FileUtils).to receive(:remove_entry).with(source_dir).and_return(true)
allow(host).to receive(:capability).with(:create_iso, machine_env, source_dir, volume_id: "cidata").and_return(iso_path)
allow(host).to receive(:capability).with(:create_iso, source_dir, volume_id: "cidata").and_return(iso_path)
expect(vm.disks).to receive(:each)
subject.write_cfg_iso(machine, env, message, {})