parent
c056a86f1f
commit
8b398b66a3
|
@ -101,7 +101,8 @@ module VagrantPlugins
|
||||||
# of a hack but is the most portable way I can think of at the moment
|
# of a hack but is the most portable way I can think of at the moment
|
||||||
# to achieve this. Otherwise, Vagrant attempts to share at some crazy
|
# to achieve this. Otherwise, Vagrant attempts to share at some crazy
|
||||||
# path like /home/vagrant/c:/foo/bar
|
# path like /home/vagrant/c:/foo/bar
|
||||||
remote_path = File.expand_path(path.gsub(/^[a-zA-Z]:\//, "/"), guest_provisioning_path.gsub(/^[a-zA-Z]:\//, "/"))
|
remote_path = File.expand_path(path.sub(/^[a-zA-Z]:\//, "/"), guest_provisioning_path.sub(/^[a-zA-Z]:\//, "/"))
|
||||||
|
remote_path.sub!(/^[a-zA-Z]:\//, "/")
|
||||||
end
|
end
|
||||||
|
|
||||||
# If we have specified a folder name to append then append it
|
# If we have specified a folder name to append then append it
|
||||||
|
@ -183,10 +184,10 @@ module VagrantPlugins
|
||||||
)
|
)
|
||||||
|
|
||||||
still_active = 259 #provisioner has asked chef to reboot
|
still_active = 259 #provisioner has asked chef to reboot
|
||||||
|
|
||||||
@config.attempts.times do |attempt|
|
@config.attempts.times do |attempt|
|
||||||
exit_status = 0
|
exit_status = 0
|
||||||
while exit_status == 0 || exit_status == still_active
|
while exit_status == 0 || exit_status == still_active
|
||||||
if @machine.guest.capability?(:wait_for_reboot)
|
if @machine.guest.capability?(:wait_for_reboot)
|
||||||
@machine.guest.capability(:wait_for_reboot)
|
@machine.guest.capability(:wait_for_reboot)
|
||||||
elsif attempt > 0
|
elsif attempt > 0
|
||||||
|
|
|
@ -23,12 +23,22 @@ describe VagrantPlugins::Chef::Provisioner::ChefSolo do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#expanded_folders" do
|
describe "#expanded_folders" do
|
||||||
|
before { allow(subject).to receive(:windows?).and_return(true) }
|
||||||
|
|
||||||
it "handles the default Windows provisioning path" do
|
it "handles the default Windows provisioning path" do
|
||||||
allow(config).to receive(:provisioning_path).and_return(nil)
|
allow(config).to receive(:provisioning_path).and_return(nil)
|
||||||
allow(subject).to receive(:windows?).and_return(true)
|
|
||||||
remote_path = subject.expanded_folders([[:vm, "cookbooks-1"]])[0][2]
|
remote_path = subject.expanded_folders([[:vm, "cookbooks-1"]])[0][2]
|
||||||
expect(remote_path).to eq("/vagrant-chef/cookbooks-1")
|
expect(remote_path).to eq("/vagrant-chef/cookbooks-1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "removes drive letter prefix from path" do
|
||||||
|
allow(config).to receive(:provisioning_path).and_return(nil)
|
||||||
|
expect(File).to receive(:expand_path).and_return("C:/vagrant-chef/cookbooks-1")
|
||||||
|
result = subject.expanded_folders([[:vm, "cookbooks-1"]])
|
||||||
|
remote_path = result[0][2]
|
||||||
|
expect(remote_path).to eq("/vagrant-chef/cookbooks-1")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#expanded_folders" do
|
describe "#expanded_folders" do
|
||||||
|
|
Loading…
Reference in New Issue