Merge branch 'master' into 1341_poc

This commit is contained in:
Michael Ablassmeier 2021-09-27 15:37:34 +02:00 committed by GitHub
commit edf392c0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,5 @@
# syntax = docker/dockerfile:1.0-experimental
ARG VAGRANT_VERSION=2.2.16
ARG VAGRANT_VERSION=2.2.18
FROM ubuntu:bionic as base

View File

@ -1037,10 +1037,12 @@ module VagrantPlugins
end
end
# Extract host and username values from uri if provided, otherwise nil
# Extract host values from uri if provided, otherwise nil
@host = uri.host
@port = uri.port
@username = uri.user
# only override username if there is a value provided
@username = nil if @username == UNSET_VALUE
@username = uri.user if uri.user
if uri.query
params = CGI.parse(uri.query)
@id_ssh_key_file = params['keyfile'].first if params.has_key?('keyfile')

View File

@ -192,14 +192,14 @@ describe VagrantPlugins::ProviderLibvirt::Config do
],
[ # when username explicitly set without ssh
{:username => 'my_user' },
{:uri => 'qemu:///system'},
{:uri => 'qemu:///system', :username => 'my_user'},
{
:env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'},
}
],
[ # when username explicitly set with host but without ssh
{:username => 'my_user', :host => 'remote'},
{:uri => 'qemu://remote/system'},
{:uri => 'qemu://remote/system', :username => 'my_user'},
{
:env => {'LIBVIRT_DEFAULT_URI' => 'qemu://session'},
}