mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Save file as user-data
This commit is contained in:
parent
42718437ab
commit
6797b96cae
2 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ module Vagrant
|
|||
# TODO: make temp_root configurable?
|
||||
source_dir = Pathname.new(Dir.mktmpdir(TEMP_PREFIX, TEMP_ROOT))
|
||||
# write a cloud.cfg file with msg.to_s
|
||||
File.open("#{source_dir}/cloud.cfg", 'w') { |file| file.write(msg.to_s) }
|
||||
File.open("#{source_dir}/user-data", 'w') { |file| file.write(msg.to_s) }
|
||||
|
||||
iso_path = env[:env].host.capability(:create_iso, env[:env], source_dir)
|
||||
else
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ describe Vagrant::Action::Builtin::CloudInitSetup do
|
|||
message = subject.generate_cfg_msg(machine, text_cfgs)
|
||||
allow(host).to receive(:capability?).with(:create_iso).and_return(true)
|
||||
allow(Dir).to receive(:mktmpdir).and_return(source_dir)
|
||||
expect(File).to receive(:open).with("#{source_dir}/cloud.cfg", 'w').and_return(true)
|
||||
expect(File).to receive(:open).with("#{source_dir}/user-data", 'w').and_return(true)
|
||||
allow(host).to receive(:capability).with(:create_iso, machine_env, source_dir).and_return(iso_path)
|
||||
|
||||
subject.write_cfg_iso(machine, env, message)
|
||||
|
|
|
|||
Loading…
Reference in a new issue