@@ -54,7 +54,7 @@ def generate_vagrantfile(file_path, platform, enable_synced_folder, provider, cp
5454 ''
5555 end
5656 vf = <<~VF
57- Vagrant.configure(\" 2 \ " ) do |config|
57+ Vagrant.configure("2 ") do |config|
5858 config.vm.box = '#{ platform } '
5959 config.vm.boot_timeout = 600
6060 config.ssh.insert_key = false
@@ -64,9 +64,7 @@ def generate_vagrantfile(file_path, platform, enable_synced_folder, provider, cp
6464 #{ provider_config_block }
6565 end
6666 VF
67- File . open ( file_path , 'w' ) do |f |
68- f . write ( vf )
69- end
67+ File . write ( file_path , vf )
7068end
7169
7270def get_vagrant_dir ( platform , vagrant_dirs , int = 0 )
@@ -187,7 +185,7 @@ def provision(platform, inventory_location, enable_synced_folder, provider, cpus
187185 group_name = 'winrm_nodes'
188186 end
189187 add_node_to_group ( inventory_hash , node , group_name )
190- File . open ( inventory_full_path , 'w' ) { | f | f . write inventory_hash . to_yaml }
188+ File . write ( inventory_full_path , inventory_hash . to_yaml )
191189 { status : 'ok' , node_name : node_name , node : node }
192190end
193191
@@ -203,7 +201,7 @@ def tear_down(node_name, inventory_location)
203201 FileUtils . rm_r ( vagrant_env )
204202 end
205203 warn "Removed #{ node_name } "
206- File . open ( inventory_full_path , 'w' ) { | f | f . write inventory_hash . to_yaml }
204+ File . write ( inventory_full_path , inventory_hash . to_yaml )
207205 { status : 'ok' }
208206end
209207
0 commit comments