Check whether Salt bootstrap script exists before attempting to delete it. GH-4614

This commit is contained in:
Anton D 2014-10-10 23:20:50 +13:00
parent 31c77bed37
commit fdbf3366ce
1 changed files with 3 additions and 1 deletions

View File

@ -236,7 +236,9 @@ module VagrantPlugins
bootstrap_destination = File.join(config_dir, "bootstrap_salt.sh") bootstrap_destination = File.join(config_dir, "bootstrap_salt.sh")
end end
if @machine.communicate.test("test -f %s" % bootstrap_destination)
@machine.communicate.sudo("rm -f %s" % bootstrap_destination) @machine.communicate.sudo("rm -f %s" % bootstrap_destination)
end
@machine.communicate.upload(bootstrap_path.to_s, bootstrap_destination) @machine.communicate.upload(bootstrap_path.to_s, bootstrap_destination)
@machine.communicate.sudo("chmod +x %s" % bootstrap_destination) @machine.communicate.sudo("chmod +x %s" % bootstrap_destination)
if @machine.config.vm.communicator == :winrm if @machine.config.vm.communicator == :winrm