From 2525be90bf24cb16d8b457e83f046874c69082c8 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 23 Sep 2015 20:37:24 -0600 Subject: [PATCH] works --- example_box/metadata.json | 2 +- .../action/prepare_nfs_settings.rb | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/example_box/metadata.json b/example_box/metadata.json index 1cefe8f..f483ad2 100644 --- a/example_box/metadata.json +++ b/example_box/metadata.json @@ -1,5 +1,5 @@ { "provider" : "libvirt", "format" : "qcow2", - "virtual_size" : 40 + "virtual_size" : 16 } diff --git a/lib/vagrant-libvirt/action/prepare_nfs_settings.rb b/lib/vagrant-libvirt/action/prepare_nfs_settings.rb index 9bc24a1..cdd9292 100644 --- a/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +++ b/lib/vagrant-libvirt/action/prepare_nfs_settings.rb @@ -39,18 +39,16 @@ module VagrantPlugins # # @param [Machine] machine # @return [String] - def read_host_ip(ip) - UDPSocket.open do |s| - @logger.info("!!!! ALL IPs #{ip} #{ip.kind_of?(Array)}" ) - if ip.kind_of?(Array) - s.connect(ip[0], 1) - else - s.connect(ip, 1) - end - s.addr.last - end + def read_host_ip(ip) + UDPSocket.open do |s| + if(ip.kind_of?(Array)) + s.connect(ip.last, 1) + else + s.connect(ip, 1) end - + s.addr.last + end + end # Returns the IP address of the guest # # @param [Machine] machine