[DRE-commits] [vagrant-libvirt] 105/163: Use a version agnostic ip_command

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:57:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.26
in repository vagrant-libvirt.

commit 267de056bf6b9289b64c6ed6979619790366befe
Author: Kaushal M <kshlmster at gmail.com>
Date:   Wed Jan 28 10:28:29 2015 +0530

    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
---
 lib/vagrant-libvirt/action/connect_libvirt.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vagrant-libvirt/action/connect_libvirt.rb b/lib/vagrant-libvirt/action/connect_libvirt.rb
index 6fdb282..85add62 100644
--- a/lib/vagrant-libvirt/action/connect_libvirt.rb
+++ b/lib/vagrant-libvirt/action/connect_libvirt.rb
@@ -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}) ...")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git



More information about the Pkg-ruby-extras-commits mailing list