From 4eb72dabc9222dc148317b994b630f71fc91e17e Mon Sep 17 00:00:00 2001 From: Patrick Debois Date: Mon, 8 Aug 2011 15:49:12 -0600 Subject: [PATCH] check ip-address that returned from the search in the logfile --- lib/fog/compute/models/libvirt/server.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/fog/compute/models/libvirt/server.rb b/lib/fog/compute/models/libvirt/server.rb index 4dbd1abf7..c3b02c4a4 100644 --- a/lib/fog/compute/models/libvirt/server.rb +++ b/lib/fog/compute/models/libvirt/server.rb @@ -291,6 +291,9 @@ module Fog # or local execute arp -an to get the ip (as a last resort) end + # We check if the result is an actual ip-address + # otherwise we return nil + ipaddress=nil unless ipaddress=~/^(\d{1,3}\.){3}\d{1,3}$/ return { :public => [ipaddress], :private => [ipaddress]} end