mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Set empty host when nil on finalize_from_uri
With ruby3.2, URI.parse now sets empty host instead of nil via:
dd5118f852
Adjust test case so, also with ruby <= 3.1, forcely set empty string for host
when nil to make finalize_from_uri behavior consistent between different
host ruby versions.
This commit is contained in:
parent
517bf7792a
commit
578d3ae429
@ -1304,8 +1304,8 @@ module VagrantPlugins
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Extract host values from uri if provided, otherwise nil
|
# Extract host values from uri if provided, otherwise set empty string
|
||||||
@host = uri.host
|
@host = uri.host || ""
|
||||||
@port = uri.port
|
@port = uri.port
|
||||||
# only override username if there is a value provided
|
# only override username if there is a value provided
|
||||||
@username = nil if @username == UNSET_VALUE
|
@username = nil if @username == UNSET_VALUE
|
||||||
|
@ -86,7 +86,7 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
|||||||
],
|
],
|
||||||
[ # connect explicit to unix socket
|
[ # connect explicit to unix socket
|
||||||
{:uri => "qemu+unix:///system"},
|
{:uri => "qemu+unix:///system"},
|
||||||
{:uri => "qemu+unix:///system", :connect_via_ssh => false, :host => nil, :username => nil},
|
{:uri => "qemu+unix:///system", :connect_via_ssh => false, :host => "", :username => nil},
|
||||||
],
|
],
|
||||||
[ # via libssh2 should enable ssh as well
|
[ # via libssh2 should enable ssh as well
|
||||||
{:uri => "qemu+libssh2://user@remote/system?known_hosts=/home/user/.ssh/known_hosts"},
|
{:uri => "qemu+libssh2://user@remote/system?known_hosts=/home/user/.ssh/known_hosts"},
|
||||||
@ -139,7 +139,7 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
|||||||
],
|
],
|
||||||
[ # with session and using ssh infer connect by ssh and ignore host as not provided
|
[ # with session and using ssh infer connect by ssh and ignore host as not provided
|
||||||
{},
|
{},
|
||||||
{:uri => "qemu+ssh:///session", :qemu_use_session => true, :connect_via_ssh => true, :host => nil},
|
{:uri => "qemu+ssh:///session", :qemu_use_session => true, :connect_via_ssh => true, :host => ""},
|
||||||
{
|
{
|
||||||
:env => {'LIBVIRT_DEFAULT_URI' => "qemu+ssh:///session"},
|
:env => {'LIBVIRT_DEFAULT_URI' => "qemu+ssh:///session"},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user