mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Handle extraction of keyfile from uri (#1297)
If the keyfile is specified as part of the URI provided, extract it and set the appropriate option so that it can be provided to the proxy command subsequently.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
require 'cgi'
|
||||
|
||||
require 'vagrant'
|
||||
|
||||
class Numeric
|
||||
@@ -1019,6 +1021,10 @@ module VagrantPlugins
|
||||
@host = uri.host
|
||||
@port = uri.port
|
||||
@username = uri.user
|
||||
if uri.query
|
||||
params = CGI.parse(uri.query)
|
||||
@id_ssh_key_file = params['keyfile'].first if params.has_key?('keyfile')
|
||||
end
|
||||
|
||||
finalize_id_ssh_key_file
|
||||
end
|
||||
|
||||
@@ -394,7 +394,6 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
||||
[
|
||||
{:uri => 'qemu+ssh://remote/system?keyfile=/some/path/to/keyfile'},
|
||||
"ssh 'remote' -i '/some/path/to/keyfile' -W %h:%p",
|
||||
{:allow_failure => "keyfile not yet inferred from uri"},
|
||||
],
|
||||
|
||||
# provide custom template
|
||||
|
||||
Reference in New Issue
Block a user