vagrant-vsphere 1.11.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a1a898766988a184569fc058c077650f032569b
4
- data.tar.gz: e0947ca1cd5ed3b11fe6d63e2d0520cc7e1667bb
3
+ metadata.gz: d18d24bc77ed74d9653df37d88dd8f86f5b7330d
4
+ data.tar.gz: 21c8bd222a808a4cfa0885a5a319be806d4612e3
5
5
  SHA512:
6
- metadata.gz: 4fb61ccad6fc0d7bb33442f22795c51da9c9b78df40c3b8e7575f3fb8e5b56bb5ff7ad7323589b2fb6befa9ccad6b27f71772d3b84818c3f47b348210c08d196
7
- data.tar.gz: 6c64eb13ce87c80388698978a362f4ef4b525126a5d4803cc780046670ee7fb6c24628c8d052a85be8fa220441b0569519c408daf47cd6b241b51fcd5e018997
6
+ metadata.gz: 3f754461b77ae977825e5333be117af21babb85872472330e39d9b8049077dce0a22efbd1e0cced27a00e22f7a56baa9cf497a799641a3c5eb66638b06998ed0
7
+ data.tar.gz: 8d3481366b6e28f2678310ce9a20d6d70a33c40bfe6b74023ec1764c14eb7f8c41b872958aafec2a7a918cd608b48ec89b1afdf6f1502db7f44a0c20d335580f
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.11.0
2
+ current_version = 1.11.1
3
3
  tag = true
4
4
  commit = true
5
5
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.11.1 (2017-02-27)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.11.1)
2
+ - Fix 'real_nic_ip' filter logic bug
3
+ ([vagrant-vsphere:fix_ssh_ip_selection](https://github.com/nsidc/vagrant-vsphere/pull/229))
4
+
1
5
  ## [1.11.0 (2016-11-23)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.11.0)
2
6
 
3
7
  - Wait for Windows sysprep when cloning a Windows box
data/README.md CHANGED
@@ -19,9 +19,9 @@ This provider is built on top of the
19
19
  * libxml2, libxml2-dev, libxslt, libxslt-dev
20
20
 
21
21
  ## Current Version
22
- **version: 1.11.0**
22
+ **version: 1.11.1**
23
23
 
24
- vagrant-vsphere (**version: 1.11.0**) is available from
24
+ vagrant-vsphere (**version: 1.11.1**) is available from
25
25
  [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere)
26
26
 
27
27
  ## Installation
@@ -20,9 +20,12 @@ module VagrantPlugins
20
20
 
21
21
  def filter_guest_nic(vm, machine)
22
22
  return vm.guest.ipAddress unless machine.provider_config.real_nic_ip
23
- ip_addresses = vm.guest.net.select { |g| g.deviceConfigId > 0 }.map { |g| g.ipAddress[0] }
23
+
24
+ interfaces = vm.guest.net.select { |g| g.deviceConfigId > 0 }
25
+ ip_addresses = interfaces.map { |i| i.ipConfig.ipAddress.select { |a| a.state == 'preferred' } }.flatten
26
+
24
27
  fail Errors::VSphereError.new, :'multiple_interface_with_real_nic_ip_set' if ip_addresses.size > 1
25
- ip_addresses.first
28
+ ip_addresses.first.ipAddress
26
29
  end
27
30
 
28
31
  def get_ssh_info(connection, machine)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VSphere
3
- VERSION = '1.11.0'
3
+ VERSION = '1.11.1'
4
4
  end
5
5
  end
@@ -28,27 +28,50 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
28
28
  expect(@env[:machine_ssh_info][:host]).to be IP_ADDRESS
29
29
  end
30
30
 
31
- context 'when acting on a VM with multiple network adapters' do
31
+ context 'when acting on a VM with a single network adapter' do
32
32
  before do
33
33
  allow(@vm.guest).to receive(:ipAddress) { '127.0.0.2' }
34
+ @env[:machine].stub(:id).and_return(EXISTING_UUID)
35
+ end
36
+
37
+ it 'should return the correct ip address' do
38
+ call
39
+ expect(@env[:machine_ssh_info][:host]).to eq '127.0.0.2'
40
+ end
41
+ end
42
+
43
+ context 'when acting on a VM with multiple network adapters' do
44
+ before do
45
+ @env[:machine].stub(:id).and_return(EXISTING_UUID)
34
46
  allow(@vm.guest).to receive(:net) {
35
- [
36
- double('guest_nic_info',
37
- ipAddress: ['127.0.0.2', 'mac address'],
38
- deviceConfigId: -1
39
- ),
40
- double('guest_nic_info',
41
- ipAddress: ['127.0.0.1', 'mac address'],
42
- deviceConfigId: 4000
43
- )
47
+ [double('GuestNicInfo',
48
+ ipAddress: ['bad address', '127.0.0.1'],
49
+ deviceConfigId: 4000,
50
+ ipConfig: double('NetIpConfigInfo',
51
+ ipAddress: [double('NetIpConfigInfoIpAddress',
52
+ ipAddress: 'bad address', state: 'unknown'),
53
+ double('NetIpConfigInfoIpAddress',
54
+ ipAddress: '127.0.0.1', state: 'preferred')]
55
+ )
56
+ ),
57
+ double('GuestNicInfo',
58
+ ipAddress: ['bad address', '255.255.255.255'],
59
+ deviceConfigId: -1,
60
+ ipConfig: double('NetIpConfigInfo',
61
+ ipAddress: [double('NetIpConfigInfoIpAddress',
62
+ ipAddress: 'bad address', state: 'unknown'),
63
+ double('NetIpConfigInfoIpAddress',
64
+ ipAddress: '255.255.255.255', state: 'preferred')]
65
+ )
66
+ )
44
67
  ]
45
68
  }
46
- @env[:machine].stub(:id).and_return(EXISTING_UUID)
47
69
  end
70
+
48
71
  context 'when the real_nic_ip option is false' do
49
72
  it 'sets the ssh info the original adapter' do
50
73
  call
51
- expect(@env[:machine_ssh_info][:host]).to eq '127.0.0.2'
74
+ expect(@env[:machine_ssh_info][:host]).to eq IP_ADDRESS
52
75
  end
53
76
  end
54
77
 
@@ -59,17 +82,29 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
59
82
  context 'when there are mutiple valid adapters' do
60
83
  before do
61
84
  allow(@vm.guest).to receive(:net) {
62
- [
63
- double('guest_nic_info',
64
- ipAddress: ['127.0.0.2', 'mac address'],
65
- deviceConfigId: 4001
66
- ),
67
- double('guest_nic_info',
68
- ipAddress: ['127.0.0.1', 'mac address'],
69
- deviceConfigId: 4000
70
- )
85
+ [double('GuestNicInfo',
86
+ ipAddress: ['bad address', '127.0.0.1'],
87
+ deviceConfigId: 4000,
88
+ ipConfig: double('NetIpConfigInfo',
89
+ ipAddress: [double('NetIpConfigInfoIpAddress',
90
+ ipAddress: 'bad address', state: 'unknown'),
91
+ double('NetIpConfigInfoIpAddress',
92
+ ipAddress: '127.0.0.2', state: 'preferred')]
93
+ )
94
+ ),
95
+ double('GuestNicInfo',
96
+ ipAddress: ['bad address', '255.255.255.255'],
97
+ deviceConfigId: 2000,
98
+ ipConfig: double('NetIpConfigInfo',
99
+ ipAddress: [double('NetIpConfigInfoIpAddress',
100
+ ipAddress: 'bad address', state: 'unknown'),
101
+ double('NetIpConfigInfoIpAddress',
102
+ ipAddress: '255.255.255.255', state: 'preferred')]
103
+ )
104
+ )
71
105
  ]
72
106
  }
107
+
73
108
  end
74
109
  it 'should raise an error' do
75
110
  expect { call }.to raise_error(VagrantPlugins::VSphere::Errors::VSphereError)
data/vSphere.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency 'rbvmomi', '>=1.8.2', '<2.0.0'
19
19
  s.add_dependency 'i18n', '>= 0.6.4', '< 0.8.0'
20
20
 
21
- s.add_development_dependency 'rake'
21
+ s.add_development_dependency 'rake', '11.1.2' # pinned to accommodate rubocop 0.32.1
22
22
  s.add_development_dependency 'rspec-core'
23
23
  s.add_development_dependency 'rspec-expectations'
24
24
  s.add_development_dependency 'rspec-mocks'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Grauch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -68,16 +68,16 @@ dependencies:
68
68
  name: rake
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ">="
71
+ - - '='
72
72
  - !ruby/object:Gem::Version
73
- version: '0'
73
+ version: 11.1.2
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ">="
78
+ - - '='
79
79
  - !ruby/object:Gem::Version
80
- version: '0'
80
+ version: 11.1.2
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec-core
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.4.8
217
+ rubygems_version: 2.4.5.1
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: VMWare vSphere provider