From 05eafb8142c4f254a2f69215b2dde6712301fe70 Mon Sep 17 00:00:00 2001 From: Michael Brandt Date: Thu, 20 Apr 2017 11:46:02 -0600 Subject: [PATCH] Fix IP address for docker swarm, cut v1.12.1 --- .bumpversion.cfg | 2 +- CHANGELOG.md | 7 +++++++ README.md | 4 ++-- lib/vSphere/action/get_ssh_info.rb | 3 ++- lib/vSphere/version.rb | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1f42d954..e1d27001 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.12.0 +current_version = 1.12.1 tag = true commit = true diff --git a/CHANGELOG.md b/CHANGELOG.md index fbd1d900..a5c9980c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.12.1 (2017-03-07)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.12.1) + + - If no valid adapters can be found on a host when using the `real_nic_ip` + option, fall back to the value of `vm.guest.ipAddress`. This resolves an + issue where the network changes made by Docker Swarm prevent vagrant-vsphere + from acquiring the VM's IP address. + ## [1.12.0 (2017-03-07)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.12.0) - Make `wait_for_sysprep` functionality configurable (see README.md for diff --git a/README.md b/README.md index 48ae10f3..7e96acec 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ This provider is built on top of the * libxml2, libxml2-dev, libxslt, libxslt-dev ## Current Version -**version: 1.12.0** +**version: 1.12.1** -vagrant-vsphere (**version: 1.12.0**) is available from +vagrant-vsphere (**version: 1.12.1**) is available from [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere) ## Installation diff --git a/lib/vSphere/action/get_ssh_info.rb b/lib/vSphere/action/get_ssh_info.rb index 2075bc28..dc0a1c2d 100644 --- a/lib/vSphere/action/get_ssh_info.rb +++ b/lib/vSphere/action/get_ssh_info.rb @@ -24,7 +24,8 @@ def filter_guest_nic(vm, machine) interfaces = vm.guest.net.select { |g| g.deviceConfigId > 0 } ip_addresses = interfaces.map { |i| i.ipConfig.ipAddress.select { |a| a.state == 'preferred' } }.flatten - return nil if ip_addresses.empty? + return (vm.guest.ipAddress || nil) if ip_addresses.empty? + fail Errors::VSphereError.new, :'multiple_interface_with_real_nic_ip_set' if ip_addresses.size > 1 ip_addresses.first.ipAddress end diff --git a/lib/vSphere/version.rb b/lib/vSphere/version.rb index 9b70b9a2..6123c5de 100644 --- a/lib/vSphere/version.rb +++ b/lib/vSphere/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module VSphere - VERSION = '1.12.0' + VERSION = '1.12.1' end end