From fdbf3366ceaa053d88039de6b07f6db0cda7492a Mon Sep 17 00:00:00 2001 From: Anton D Date: Fri, 10 Oct 2014 23:20:50 +1300 Subject: [PATCH] Check whether Salt bootstrap script exists before attempting to delete it. GH-4614 --- plugins/provisioners/salt/provisioner.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index 6225fd339..827ee20e7 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -236,7 +236,9 @@ module VagrantPlugins bootstrap_destination = File.join(config_dir, "bootstrap_salt.sh") end - @machine.communicate.sudo("rm -f %s" % bootstrap_destination) + if @machine.communicate.test("test -f %s" % bootstrap_destination) + @machine.communicate.sudo("rm -f %s" % bootstrap_destination) + end @machine.communicate.upload(bootstrap_path.to_s, bootstrap_destination) @machine.communicate.sudo("chmod +x %s" % bootstrap_destination) if @machine.config.vm.communicator == :winrm