mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Fix NFS network discovery
This commit is contained in:
parent
1ba2b9aeb0
commit
01eb354d89
@ -41,7 +41,7 @@ module VagrantPlugins
|
||||
xml=Nokogiri::XML(domain.to_xml)
|
||||
networkname = xml.xpath('/domain/devices/interface/source').first.attributes['network'].value.to_s
|
||||
puts "network name = #{networkname}"
|
||||
net = env[:libvirt_compute].list_networks.map {|netw| netw if netw[:name] == networkname}.first
|
||||
net = env[:libvirt_compute].list_networks.find {|netw| netw[:name] == networkname}
|
||||
end
|
||||
# FIXME better implement by libvirt xml parsing
|
||||
`ip addr show | grep -A 2 #{net[:bridge_name]} | grep -i 'inet ' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1`.chomp
|
||||
|
Loading…
Reference in New Issue
Block a user