vagrant-libvirt 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vagrant-libvirt/config.rb +5 -6
- data/lib/vagrant-libvirt/version +1 -1
- data/spec/unit/config_spec.rb +5 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0b92464d39e7682b1ac22c2deef83e5a5cdfd56050ecb868ffc043fcd1b2e64
|
4
|
+
data.tar.gz: 9e659bdc02484b1bf96aa71f0b5424d8e6eaec2939cb5f01a9a8d69a07d03cfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf1018d2cd9e72ec46d23a48ff2f85862edcd6a7e634a5595ea9b1911fba329790b276bdd3bc10ec9cfcbc34fc6005216e73a2052756d915a5a54afd2b879410
|
7
|
+
data.tar.gz: 789bc17e1422b2607a69f05ebfe90b40b606c18c7619398634f5ac7e296497a1146878e73fb65c6fefdffda60b6e50386d52cade4d211631fe8fdbd13c916953
|
@@ -1067,8 +1067,9 @@ module VagrantPlugins
|
|
1067
1067
|
|
1068
1068
|
# only interested in public networks where portgroup is nil, as then source will be a host device
|
1069
1069
|
if type == :public_network && opts[:portgroup] == nil
|
1070
|
-
|
1071
|
-
|
1070
|
+
devices = host_devices(machine)
|
1071
|
+
if !devices.include?(opts[:dev])
|
1072
|
+
errors << "network configuration #{index} for machine #{machine.name} is a public_network referencing host device '#{opts[:dev]}' which does not exist, consider adding ':dev => ....' referencing one of #{devices.join(", ")}"
|
1072
1073
|
end
|
1073
1074
|
end
|
1074
1075
|
end
|
@@ -1210,11 +1211,9 @@ module VagrantPlugins
|
|
1210
1211
|
end
|
1211
1212
|
end
|
1212
1213
|
|
1213
|
-
def host_devices
|
1214
|
+
def host_devices(machine)
|
1214
1215
|
@host_devices ||= begin
|
1215
|
-
|
1216
|
-
|
1217
|
-
Socket.getifaddrs.map { |iface| iface.name }.uniq.select do |dev|
|
1216
|
+
machine.provider.driver.connection.client.list_all_interfaces().map { |iface| iface.name }.uniq.select do |dev|
|
1218
1217
|
dev != "lo" && !@host_device_exclude_prefixes.any? { |exclude| dev.start_with?(exclude) }
|
1219
1218
|
end
|
1220
1219
|
end
|
data/lib/vagrant-libvirt/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
data/spec/unit/config_spec.rb
CHANGED
@@ -635,13 +635,15 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
|
635
635
|
end
|
636
636
|
|
637
637
|
context 'with public_network defined' do
|
638
|
+
let(:libvirt_client) { instance_double(::Libvirt::Connect) }
|
638
639
|
let(:host_devices) { [
|
639
|
-
instance_double(
|
640
|
-
instance_double(
|
640
|
+
instance_double(Libvirt::Interface),
|
641
|
+
instance_double(Libvirt::Interface),
|
641
642
|
] }
|
642
643
|
before do
|
643
644
|
machine.config.vm.network :public_network, dev: 'eth0', ip: "192.168.2.157"
|
644
|
-
expect(
|
645
|
+
expect(machine).to receive_message_chain('provider.driver.connection.client').and_return(libvirt_client)
|
646
|
+
expect(libvirt_client).to receive(:list_all_interfaces).and_return(host_devices)
|
645
647
|
expect(host_devices[0]).to receive(:name).and_return('eth0')
|
646
648
|
expect(host_devices[1]).to receive(:name).and_return('virbr0')
|
647
649
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-08-
|
14
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-libvirt
|