vagrant-libvirt 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72412515bebb729139c28b407437ecf123b5f9625e2e0964ed207b46e49536aa
4
- data.tar.gz: f07da3fe91c36c466e3e134dfaf219fa0ef9f0d6cfff01dea8923d1a7f10c24c
3
+ metadata.gz: a0b92464d39e7682b1ac22c2deef83e5a5cdfd56050ecb868ffc043fcd1b2e64
4
+ data.tar.gz: 9e659bdc02484b1bf96aa71f0b5424d8e6eaec2939cb5f01a9a8d69a07d03cfe
5
5
  SHA512:
6
- metadata.gz: bb6173851f6f4ad7226f40961e733102ff3f6a794c3331116e187ffdc683d841c33aafd3aab1f9e2408b4bb7c6c0ffb374b010a58bd743d191920ee84dc52579
7
- data.tar.gz: ebf2c52e56bc87e6be14c16a292f9fb3be6b1b5241d9ebfb0159199993c2a0e5011503fd2587e79472dab7e1ff3474b69d826a6ac1b76375bd56948b525eaa5d
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
- if !host_devices.include?(opts[:dev])
1071
- 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 #{host_devices.join(", ")}"
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
- require 'socket'
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
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.10.1
@@ -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(Socket::Ifaddr),
640
- instance_double(Socket::Ifaddr),
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(Socket).to receive(:getifaddrs).and_return(host_devices)
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.0
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-16 00:00:00.000000000 Z
14
+ date: 2022-08-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-libvirt