Revert "Escape identify file path"
This commit is contained in:
parent
95ffde0938
commit
3f6ac05d7c
|
@ -6,7 +6,11 @@ Host <%= host_key %>
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
<% private_key_path.each do |path| %>
|
<% private_key_path.each do |path| %>
|
||||||
IdentityFile <%= path.inspect %>
|
<% if path.include?(" ") -%>
|
||||||
|
IdentityFile "<%= path %>"
|
||||||
|
<% else -%>
|
||||||
|
IdentityFile <%= path %>
|
||||||
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
IdentitiesOnly yes
|
IdentitiesOnly yes
|
||||||
LogLevel FATAL
|
LogLevel FATAL
|
||||||
|
|
|
@ -92,8 +92,8 @@ Host #{machine.name}
|
||||||
|
|
||||||
subject.execute
|
subject.execute
|
||||||
|
|
||||||
expect(output).to include('IdentityFile "foo"')
|
expect(output).to include("IdentityFile foo")
|
||||||
expect(output).to include('IdentityFile "bar"')
|
expect(output).to include("IdentityFile bar")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "puts quotes around an identityfile path if it has a space" do
|
it "puts quotes around an identityfile path if it has a space" do
|
||||||
|
@ -107,17 +107,5 @@ Host #{machine.name}
|
||||||
|
|
||||||
expect(output).to include('IdentityFile "with a space"')
|
expect(output).to include('IdentityFile "with a space"')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "escapes special characters" do
|
|
||||||
allow(machine).to receive(:ssh_info) { ssh_info.merge(private_key_path: ['/private/tmp/test of "vagrant" plugin/']) }
|
|
||||||
output = ""
|
|
||||||
allow(subject).to receive(:safe_puts) do |data|
|
|
||||||
output += data if data
|
|
||||||
end
|
|
||||||
|
|
||||||
subject.execute
|
|
||||||
|
|
||||||
expect(output).to include('"/private/tmp/test of \"vagrant\" plugin/"')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue