mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Use a version agnostic ip_command
With libvirt-1.2.11, libvirt no longer uses lease files for dnsmasq, which makes the existing method of fetching the ip of a vm incorrect. This change introduces a version agnostic method to get the IP of VM using arp cache instead. Fixes #298
This commit is contained in:
parent
c865b2514b
commit
267de056bf
@ -30,7 +30,7 @@ module VagrantPlugins
|
||||
|
||||
# Setup command for retrieving IP address for newly created machine
|
||||
# with some MAC address. Get it from dnsmasq leases table
|
||||
ip_command = %q[ find /var/lib/libvirt/dnsmasq/ /var/lib/misc/ -name '*leases' -exec grep $mac {} \; | cut -d' ' -f3 ]
|
||||
ip_command = %q[ arp -n | grep $mac | cut -d' ' -f 1 ]
|
||||
conn_attr[:libvirt_ip_command] = ip_command
|
||||
|
||||
@logger.info("Connecting to Libvirt (#{uri}) ...")
|
||||
|
Loading…
Reference in New Issue
Block a user