From ead2149429ef03ee36ddf3b2d3db8731674eb6fe Mon Sep 17 00:00:00 2001 From: Thomas Kadauke Date: Mon, 18 Mar 2013 09:59:03 +0100 Subject: [PATCH] Make finding IP address more stable. Finding IP address of instance can fail sometimes, because the OpenStack API might not correctly return it on creation of the instance. This happened reproducibly on my machine. So we ignore it when there is no IP address and wait for another round. --- lib/vagrant-openstack/action/read_ssh_info.rb | 3 ++- lib/vagrant-openstack/version.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-openstack/action/read_ssh_info.rb b/lib/vagrant-openstack/action/read_ssh_info.rb index f48282e..ec9d173 100644 --- a/lib/vagrant-openstack/action/read_ssh_info.rb +++ b/lib/vagrant-openstack/action/read_ssh_info.rb @@ -31,10 +31,11 @@ def read_ssh_info(openstack, machine) config = machine.provider_config + host = server.addresses['public'].last['addr'] rescue nil # Read the DNS info return { # Usually there should only be one public IP - :host => server.addresses['public'].last['addr'], + :host => host, :port => 22, :username => config.ssh_username } diff --git a/lib/vagrant-openstack/version.rb b/lib/vagrant-openstack/version.rb index fa372e7..eadf6e4 100644 --- a/lib/vagrant-openstack/version.rb +++ b/lib/vagrant-openstack/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module OpenStack - VERSION = "0.1.0" + VERSION = "0.1.1" end end