mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Handle REXML requires for Ubuntu focal (#1584)
The distribution provided vagrant package on Ubuntu 20.04 is version 2.2.6 running on ruby 2.7.2. It appears that the rexml layout is slightly different and imports different paths than the current code expects. Add this combination to the unit tests and switch the requires to load the specific library requirements instead of relying on rexml loading everything underneath. Additionally it appears the hook behaviour change appeared earlier that the understood vagrant release of 2.2.11, and 2.2.6 also requires the newer hook behaviour.
This commit is contained in:
parent
602b4e9ad8
commit
ba2c7be494
6
.github/workflows/unit-tests.yml
vendored
6
.github/workflows/unit-tests.yml
vendored
@ -41,6 +41,12 @@ jobs:
|
|||||||
- ruby: 2.6.6
|
- ruby: 2.6.6
|
||||||
vagrant: v2.2.14
|
vagrant: v2.2.14
|
||||||
allow_fail: false
|
allow_fail: false
|
||||||
|
- ruby: 2.7.2
|
||||||
|
vagrant: v2.2.10
|
||||||
|
allow_fail: false
|
||||||
|
# above block is to ensure compatible with Ubuntu 20.04 vagrant package
|
||||||
|
# although it uses 2.2.10 it is the earliest version that will install on
|
||||||
|
# ruby 2.7 without patching
|
||||||
- ruby: 3.0.0
|
- ruby: 3.0.0
|
||||||
vagrant:
|
vagrant:
|
||||||
allow_fail: false
|
allow_fail: false
|
||||||
|
@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
require 'log4r'
|
require 'log4r'
|
||||||
|
|
||||||
begin
|
require 'rexml/document'
|
||||||
require 'rexml'
|
require 'rexml/xpath'
|
||||||
rescue LoadError
|
|
||||||
require 'rexml/rexml'
|
|
||||||
end
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/util/domain_flags'
|
require 'vagrant-libvirt/util/domain_flags'
|
||||||
|
|
||||||
|
@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
require 'log4r'
|
require 'log4r'
|
||||||
|
|
||||||
begin
|
require 'rexml/document'
|
||||||
require 'rexml'
|
require 'rexml/xpath'
|
||||||
rescue LoadError
|
|
||||||
require 'rexml/rexml'
|
|
||||||
end
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/util/resolvers'
|
require 'vagrant-libvirt/util/resolvers'
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
require 'log4r'
|
require 'log4r'
|
||||||
|
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
require 'rexml/formatters/pretty'
|
||||||
|
require 'rexml/xpath'
|
||||||
|
|
||||||
require 'vagrant-libvirt/util/xml'
|
require 'vagrant-libvirt/util/xml'
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ module VagrantPlugins
|
|||||||
module Compat
|
module Compat
|
||||||
def self.action_hook_args(name, action)
|
def self.action_hook_args(name, action)
|
||||||
# handle different number of arguments for action_hook depending on vagrant version
|
# handle different number of arguments for action_hook depending on vagrant version
|
||||||
if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('2.2.11')
|
if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('2.2.10')
|
||||||
return name, action
|
return name, action
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user