module Veewee
  module Provider
    module Kvm
      module BoxCommand
        def ip_address
          ip=@connection.servers.all(:name => "#{name}").first.public_ip_address
          return ip.first unless ip.nil?
          return ip
        end

      end # End Module
    end # End Module
  end # End Module
end # End Module

module Veewee
  module Provider
    module Kvm
      module BoxCommand
        def ip_address
          ip=@connection.servers.all(:name => "#{name}").first.public_ip_address
          return [*ip].first unless ip.nil?
          return ip
        end

      end # End Module
    end # End Module
  end # End Module
end # End Module

Make IP retrieval more reliable
Make IP retrieval more reliable

Previous to this commit, the public IP returned from ruby-libvirt may
not be an array. The code assumes it's an array and always grabs the
first item.  I'm not sure if it's ever an array, but to be safe this
commit ensures what's returned from #public_ip_address is an array, then
the first item is selected.
