vagrant-vsphere 1.13.4 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.bumpversion.cfg +2 -1
  3. data/.rubocop.yml +15 -0
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +12 -0
  6. data/DEVELOPMENT.md +22 -0
  7. data/Gemfile +3 -1
  8. data/README.md +2 -2
  9. data/Rakefile +4 -2
  10. data/lib/vSphere/action/clone.rb +20 -19
  11. data/lib/vSphere/action/close_vsphere.rb +2 -0
  12. data/lib/vSphere/action/connect_vsphere.rb +2 -0
  13. data/lib/vSphere/action/destroy.rb +3 -0
  14. data/lib/vSphere/action/get_ssh_info.rb +7 -2
  15. data/lib/vSphere/action/get_state.rb +3 -1
  16. data/lib/vSphere/action/is_created.rb +2 -0
  17. data/lib/vSphere/action/is_running.rb +2 -0
  18. data/lib/vSphere/action/is_suspended.rb +2 -0
  19. data/lib/vSphere/action/message_already_created.rb +2 -0
  20. data/lib/vSphere/action/message_not_created.rb +2 -0
  21. data/lib/vSphere/action/message_not_running.rb +2 -0
  22. data/lib/vSphere/action/message_not_suspended.rb +2 -0
  23. data/lib/vSphere/action/power_off.rb +2 -0
  24. data/lib/vSphere/action/power_on.rb +2 -0
  25. data/lib/vSphere/action/resume.rb +2 -0
  26. data/lib/vSphere/action/snapshot_delete.rb +8 -4
  27. data/lib/vSphere/action/snapshot_list.rb +2 -0
  28. data/lib/vSphere/action/snapshot_restore.rb +5 -2
  29. data/lib/vSphere/action/snapshot_save.rb +8 -4
  30. data/lib/vSphere/action/suspend.rb +2 -0
  31. data/lib/vSphere/action/wait_for_ip_address.rb +2 -0
  32. data/lib/vSphere/action.rb +8 -6
  33. data/lib/vSphere/cap/public_address.rb +3 -0
  34. data/lib/vSphere/cap/snapshot_list.rb +2 -0
  35. data/lib/vSphere/config.rb +4 -31
  36. data/lib/vSphere/errors.rb +2 -0
  37. data/lib/vSphere/plugin.rb +5 -5
  38. data/lib/vSphere/provider.rb +3 -0
  39. data/lib/vSphere/util/vim_helpers.rb +26 -19
  40. data/lib/vSphere/util/vm_helpers.rb +9 -6
  41. data/lib/vSphere/version.rb +3 -1
  42. data/lib/vagrant-vsphere.rb +4 -2
  43. data/spec/action_spec.rb +2 -0
  44. data/spec/clone_spec.rb +8 -6
  45. data/spec/connect_vsphere_spec.rb +2 -0
  46. data/spec/destroy_spec.rb +2 -0
  47. data/spec/get_ssh_info_spec.rb +6 -14
  48. data/spec/get_state_spec.rb +2 -0
  49. data/spec/is_created_spec.rb +2 -0
  50. data/spec/power_off_spec.rb +2 -0
  51. data/spec/spec_helper.rb +34 -31
  52. data/vSphere.gemspec +7 -6
  53. metadata +20 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 122ef76e1e318918c3ae41a9d08dd3294a5622778d64d92dc7f9ca5a9a781afc
4
- data.tar.gz: 9023bbcf8d47bb0490afaf4669836a9eec929a321e7da1aa8dbd3503fa2011f8
3
+ metadata.gz: 78475eca6295dc1f1bed7ff8490181ee6d3e783c4faa5c02139930e719b12ce3
4
+ data.tar.gz: 5babfa6b5a6f9bb2a53e540f0d0f5dae9e0f6c96a6e100ba49049e59431fd026
5
5
  SHA512:
6
- metadata.gz: 69bfa799b9ebc91c983cb28d021584135b61e56a5d9fed1e77afbb518baa7a34d5132a3eea79c6896119c8c37204496f7924c95c06bef621d982cabd32985bb7
7
- data.tar.gz: cdaea22e2995e7ab9cb3cd971f9a5e4225735cc32a5b67b98a0f5280c56596e0744539b599763c5af0644a0000711c7b00fdf1c0120d99fbe779b284817f983f
6
+ metadata.gz: 7331f8728a023affd94a50da77ab3960e4866375201d248edf41a9d1e39262f2d4e53b52b2d901f635b5c599d338fecae2c8e13ca24b6fdfac5ee713bbacb959
7
+ data.tar.gz: 3e04b94b120a4e6abc53a2fc20876ed1fe26c97b1cf41b3fb76233c6828088d1852023c111ae15baa07db94a459db07a6d18d2df8cd8d67bc1c7139b56f4d92f
data/.bumpversion.cfg CHANGED
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.13.4
2
+ current_version = 1.14.0
3
3
  tag = true
4
4
  commit = true
5
5
 
@@ -8,3 +8,4 @@ commit = true
8
8
  [bumpversion:file:README.md]
9
9
  parse = version: (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
10
10
  serialize = version: {major}.{minor}.{patch}
11
+
data/.rubocop.yml CHANGED
@@ -32,3 +32,18 @@ Metrics/ModuleLength:
32
32
 
33
33
  Metrics/PerceivedComplexity:
34
34
  Enabled: false
35
+
36
+ # Disabled these cops upgrading rubocop to 1.25.0
37
+ # TODO:Correct the issues found by these cops someday
38
+ Lint/MissingSuper:
39
+ Enabled: false
40
+
41
+ Metrics/BlockLength:
42
+ Enabled: false
43
+
44
+ Naming:
45
+ Enabled: false
46
+
47
+ # TODO: Add required ruby version to gemspec
48
+ Gemspec/RequiredRubyVersion:
49
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ ruby-3.0.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [1.14.0 (2022-08-01)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.14.0.pre1)
2
+
3
+ - Update gem to ruby 3.0.2
4
+ - Support for vagrant >=2.2.17
5
+ - Update nokogiri dependency (1.13.4) to take care of dependabot alerts
6
+ - Update rbvmomi, rake, rubocop dependencies
7
+
8
+ ## [1.13.5 (2021-01-05)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.13.5)
9
+ - Pin nokogiri to 1.10.10. This fixes an issue where vagrant-vsphere failed to install due to
10
+ nokogiri requiring Ruby >=2.5. This is a workaround until the vagrant-nsidc plugin is updated
11
+ to work with newer versions of vagrant that are bundled with newer versions of Ruby
12
+
1
13
  ## [1.13.4 (2020-03-31)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.13.4)
2
14
 
3
15
  - Allow newer versions of i18n.
data/DEVELOPMENT.md CHANGED
@@ -65,3 +65,25 @@ prefers to be run from the official installer rather than through the gem.
65
65
  Despite those warning messages, this is the
66
66
  [officially recommended](https://docs.vagrantup.com/v2/plugins/development-basics.html)
67
67
  method for Vagrant plugin development.
68
+
69
+ ### Releasing
70
+
71
+ 1) Ensure [travis-ci](https://travis-ci.org/github/nsidc/vagrant-vsphere/) build is passing
72
+ 2) Ensure `CHANGELOG.md` is up-to-date with the changes to release
73
+ 3) Update version in the code, according to [semver](https://semver.org/)
74
+ * [bumpversion](https://github.com/peritus/bumpversion) can be used; if not,
75
+ the version needs to be manually updated in `.bumpversion.cfg`,
76
+ `README.md`, and `lib/vSphere/version.rb` (e.g., as in
77
+ [`11eced2`](https://github.com/nsidc/vagrant-vsphere/commit/11eced2))
78
+ 4) `bundle exec rake build`
79
+ * builds the plugin to `pkg/vagrant-vsphere-$VERSION.gem`
80
+ * install to your system vagrant for further testing with `vagrant plugin
81
+ install ./pkg/vagrant-vsphere-$VERSION.gem`
82
+ 5) `bundle exec rake release`
83
+ * creates the version tag and pushes it to GitHub
84
+ * pushes the built gem to
85
+ [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere/)
86
+ 6) Update the [Releases page](https://github.com/nsidc/vagrant-vsphere/releases)
87
+ * the release name should match the version tag (e.g., `v1.2.3`)
88
+ * the release description can be the same as the `CHANGELOG.md` entry
89
+ * upload the `.gem` from RubyGems.org as an attached binary for the release
data/Gemfile CHANGED
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  group :development do
4
6
  # We depend on Vagrant for development, but we don't add it as a
5
7
  # gem dependency because we expect to be installed within the
6
8
  # Vagrant environment itself using `vagrant plugin`.
7
- gem 'vagrant', github: 'mitchellh/vagrant'
9
+ gem 'vagrant', github: 'mitchellh/vagrant', ref: 'v2.2.19'
8
10
  end
9
11
 
10
12
  group :plugins do
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.13.4**
22
+ **version: 1.14.0.pre1**
23
23
 
24
- vagrant-vsphere (**version: 1.13.4**) is available from
24
+ vagrant-vsphere (**version: 1.14.0**) is available from
25
25
  [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere)
26
26
 
27
27
  ## Installation
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler/setup'
3
5
  require 'rspec/core/rake_task'
@@ -9,7 +11,7 @@ $stdout.sync = true
9
11
  $stderr.sync = true
10
12
 
11
13
  # Change to the directory of this file.
12
- Dir.chdir(File.expand_path('../', __FILE__))
14
+ Dir.chdir(File.expand_path(__dir__))
13
15
 
14
16
  Bundler::GemHelper.install_tasks
15
17
 
@@ -17,4 +19,4 @@ RSpec::Core::RakeTask.new
17
19
 
18
20
  RuboCop::RakeTask.new
19
21
 
20
- task default: %w(rubocop spec)
22
+ task default: %w[rubocop spec]
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -19,14 +21,15 @@ module VagrantPlugins
19
21
  name = get_name machine, config, env[:root_path]
20
22
  dc = get_datacenter connection, machine
21
23
  template = dc.find_vm config.template_name
22
- fail Errors::VSphereError, :'missing_template' if template.nil?
24
+ raise Errors::VSphereError, :'missing_template' if template.nil?
25
+
23
26
  vm_base_folder = get_vm_base_folder dc, template, config
24
- fail Errors::VSphereError, :'invalid_base_path' if vm_base_folder.nil?
27
+ raise Errors::VSphereError, :'invalid_base_path' if vm_base_folder.nil?
25
28
 
26
29
  begin
27
30
  # Storage DRS does not support vSphere linked clones. http://www.vmware.com/files/pdf/techpaper/vsphere-storage-drs-interoperability.pdf
28
31
  ds = get_datastore dc, machine
29
- fail Errors::VSphereError, :'invalid_configuration_linked_clone_with_sdrs' if config.linked_clone && ds.is_a?(RbVmomi::VIM::StoragePod)
32
+ raise Errors::VSphereError, :'invalid_configuration_linked_clone_with_sdrs' if config.linked_clone && ds.is_a?(RbVmomi::VIM::StoragePod)
30
33
 
31
34
  location = get_location ds, dc, machine, template
32
35
  spec = RbVmomi::VIM.VirtualMachineCloneSpec location: location, powerOn: true, template: false
@@ -74,9 +77,7 @@ module VagrantPlugins
74
77
 
75
78
  recommendation = result.recommendations[0]
76
79
  key = recommendation.key ||= ''
77
- if key == ''
78
- fail Errors::VSphereError, :missing_datastore_recommendation
79
- end
80
+ raise Errors::VSphereError, :missing_datastore_recommendation if key == ''
80
81
 
81
82
  env[:ui].info I18n.t('vsphere.creating_cloned_vm_sdrs')
82
83
  env[:ui].info " -- Storage DRS recommendation: #{recommendation.target.name} #{recommendation.reasonText}"
@@ -125,13 +126,13 @@ module VagrantPlugins
125
126
  while wait
126
127
  events = query_customization_succeeded(vm, vem)
127
128
 
128
- if events.size > 0
129
+ if events.size.positive?
129
130
  events.each do |e|
130
131
  env[:ui].info e.fullFormattedMessage
131
132
  end
132
133
  wait = false
133
134
  elsif waited_seconds >= timeout
134
- fail Errors::VSphereError, :'sysprep_timeout'
135
+ raise Errors::VSphereError, :'sysprep_timeout'
135
136
  else
136
137
  sleep(sleep_time)
137
138
  waited_seconds += sleep_time
@@ -154,7 +155,7 @@ module VagrantPlugins
154
155
  return customization_spec if private_networks.nil?
155
156
 
156
157
  # make sure we have enough NIC settings to override with the private network settings
157
- fail Errors::VSphereError, :'too_many_private_networks' if private_networks.length > customization_spec.nicSettingMap.length
158
+ raise Errors::VSphereError, :'too_many_private_networks' if private_networks.length > customization_spec.nicSettingMap.length
158
159
 
159
160
  # assign the private network IP to the NIC
160
161
  private_networks.each_index do |idx|
@@ -212,7 +213,7 @@ module VagrantPlugins
212
213
  return config.name unless config.name.nil?
213
214
 
214
215
  prefix = "#{root_path.basename}_#{machine.name}"
215
- prefix.gsub!(/[^-a-z0-9_\.]/i, '')
216
+ prefix.gsub!(/[^-a-z0-9_.]/i, '')
216
217
  # milliseconds + random number suffix to allow for simultaneous `vagrant up` of the same box in different dirs
217
218
  prefix + "_#{(Time.now.to_f * 1000.0).to_i}_#{rand(100_000)}"
218
219
  end
@@ -229,7 +230,7 @@ module VagrantPlugins
229
230
  spec[:config][:deviceChange] ||= []
230
231
  @card ||= template.config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).first
231
232
 
232
- fail Errors::VSphereError, :missing_network_card if @card.nil?
233
+ raise Errors::VSphereError, :missing_network_card if @card.nil?
233
234
 
234
235
  yield(@card)
235
236
 
@@ -241,7 +242,7 @@ module VagrantPlugins
241
242
  def add_custom_address_type(template, spec, addressType)
242
243
  spec[:config][:deviceChange] = []
243
244
  config = template.config
244
- card = config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).first || fail(Errors::VSphereError, :missing_network_card)
245
+ card = config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard).first || raise(Errors::VSphereError, :missing_network_card)
245
246
  card.addressType = addressType
246
247
  card_spec = { :deviceChange => [{ :operation => :edit, :device => card }] }
247
248
  template.ReconfigVM_Task(:spec => card_spec).wait_for_completion
@@ -257,13 +258,13 @@ module VagrantPlugins
257
258
  network = get_network_by_name(dc, vlan)
258
259
 
259
260
  modify_network_card(template, spec) do |card|
260
- begin
261
- switch_port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(switchUuid: network.config.distributedVirtualSwitch.uuid, portgroupKey: network.key)
262
- card.backing = RbVmomi::VIM::VirtualEthernetCardDistributedVirtualPortBackingInfo(port: switch_port)
263
- rescue
264
- # not connected to a distibuted switch?
265
- card.backing = RbVmomi::VIM::VirtualEthernetCardNetworkBackingInfo(network: network, deviceName: network.name)
266
- end
261
+
262
+ switch_port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(switchUuid: network.config.distributedVirtualSwitch.uuid, portgroupKey: network.key)
263
+ card.backing = RbVmomi::VIM::VirtualEthernetCardDistributedVirtualPortBackingInfo(port: switch_port)
264
+ rescue StandardError
265
+ # not connected to a distibuted switch?
266
+ card.backing = RbVmomi::VIM::VirtualEthernetCardNetworkBackingInfo(network: network, deviceName: network.name)
267
+
267
268
  end
268
269
  end
269
270
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -23,6 +25,7 @@ module VagrantPlugins
23
25
 
24
26
  def destroy_vm(env)
25
27
  return if env[:machine].state.id == :not_created
28
+
26
29
  vm = get_vm_by_uuid env[:vSphere_connection], env[:machine]
27
30
  return if vm.nil?
28
31
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'vSphere/util/vim_helpers'
3
5
 
@@ -21,12 +23,13 @@ module VagrantPlugins
21
23
  def filter_guest_nic(vm, machine)
22
24
  return vm.guest.ipAddress unless machine.provider_config.real_nic_ip
23
25
 
24
- interfaces = vm.guest.net.select { |g| g.deviceConfigId > 0 }
26
+ interfaces = vm.guest.net.select { |g| g.deviceConfigId.positive? }
25
27
  ip_addresses = interfaces.map { |i| i.ipConfig.ipAddress.select { |a| a.state == 'preferred' } }.flatten
26
28
 
27
29
  return (vm.guest.ipAddress || nil) if ip_addresses.empty?
28
30
 
29
- fail Errors::VSphereError.new, :'multiple_interface_with_real_nic_ip_set' if ip_addresses.size > 1
31
+ raise Errors::VSphereError.new, :'multiple_interface_with_real_nic_ip_set' if ip_addresses.size > 1
32
+
30
33
  ip_addresses.first.ipAddress
31
34
  end
32
35
 
@@ -35,8 +38,10 @@ module VagrantPlugins
35
38
 
36
39
  vm = get_vm_by_uuid connection, machine
37
40
  return nil if vm.nil?
41
+
38
42
  ip_address = filter_guest_nic(vm, machine)
39
43
  return nil if ip_address.nil? || ip_address.empty?
44
+
40
45
  {
41
46
  host: ip_address,
42
47
  port: 22
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'vSphere/util/vim_helpers'
3
5
  require 'vSphere/util/vm_helpers'
@@ -22,7 +24,7 @@ module VagrantPlugins
22
24
  private
23
25
 
24
26
  def get_state(connection, machine)
25
- return :not_created if machine.id.nil?
27
+ return :not_created if machine.id.nil?
26
28
 
27
29
  vm = get_vm_by_uuid connection, machine
28
30
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
5
  module Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
5
  module Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
5
  module Action
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'i18n'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vSphere/util/vim_helpers'
2
4
  require 'vSphere/util/vm_helpers'
3
5
 
@@ -16,8 +18,9 @@ module VagrantPlugins
16
18
  vm = get_vm_by_uuid(env[:vSphere_connection], env[:machine])
17
19
 
18
20
  env[:ui].info(I18n.t(
19
- "vagrant.actions.vm.snapshot.deleting",
20
- name: env[:snapshot_name]))
21
+ "vagrant.actions.vm.snapshot.deleting",
22
+ name: env[:snapshot_name]
23
+ ))
21
24
 
22
25
  delete_snapshot(vm, env[:snapshot_name]) do |progress|
23
26
  env[:ui].clear_line
@@ -27,8 +30,9 @@ module VagrantPlugins
27
30
  env[:ui].clear_line
28
31
 
29
32
  env[:ui].info(I18n.t(
30
- "vagrant.actions.vm.snapshot.deleted",
31
- name: env[:snapshot_name]))
33
+ "vagrant.actions.vm.snapshot.deleted",
34
+ name: env[:snapshot_name]
35
+ ))
32
36
 
33
37
  @app.call env
34
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vSphere/util/vim_helpers'
2
4
  require 'vSphere/util/vm_helpers'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vSphere/util/vim_helpers'
2
4
  require 'vSphere/util/vm_helpers'
3
5
 
@@ -16,8 +18,9 @@ module VagrantPlugins
16
18
  vm = get_vm_by_uuid(env[:vSphere_connection], env[:machine])
17
19
 
18
20
  env[:ui].info(I18n.t(
19
- "vagrant.actions.vm.snapshot.restoring",
20
- name: env[:snapshot_name]))
21
+ "vagrant.actions.vm.snapshot.restoring",
22
+ name: env[:snapshot_name]
23
+ ))
21
24
 
22
25
  restore_snapshot(vm, env[:snapshot_name]) do |progress|
23
26
  env[:ui].clear_line
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vSphere/util/vim_helpers'
2
4
  require 'vSphere/util/vm_helpers'
3
5
 
@@ -16,8 +18,9 @@ module VagrantPlugins
16
18
  vm = get_vm_by_uuid(env[:vSphere_connection], env[:machine])
17
19
 
18
20
  env[:ui].info(I18n.t(
19
- "vagrant.actions.vm.snapshot.saving",
20
- name: env[:snapshot_name]))
21
+ "vagrant.actions.vm.snapshot.saving",
22
+ name: env[:snapshot_name]
23
+ ))
21
24
 
22
25
  create_snapshot(vm, env[:snapshot_name]) do |progress|
23
26
  env[:ui].clear_line
@@ -27,8 +30,9 @@ module VagrantPlugins
27
30
  env[:ui].clear_line
28
31
 
29
32
  env[:ui].success(I18n.t(
30
- "vagrant.actions.vm.snapshot.saved",
31
- name: env[:snapshot_name]))
33
+ "vagrant.actions.vm.snapshot.saved",
34
+ name: env[:snapshot_name]
35
+ ))
32
36
  @app.call env
33
37
  end
34
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'i18n'
3
5
  require 'vSphere/util/vim_helpers'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ipaddr'
2
4
  require 'timeout'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vagrant'
2
4
  require 'vagrant/action/builder'
3
5
 
@@ -224,7 +226,7 @@ module VagrantPlugins
224
226
  end
225
227
 
226
228
  # TODO: Remove the if guard when Vagrant 1.8.0 is the minimum version.
227
- # rubocop:disable IndentationWidth
229
+ # rubocop:disable Layout/IndentationWidth
228
230
  if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.8.0')
229
231
  def self.action_snapshot_delete
230
232
  Vagrant::Action::Builder.new.tap do |b|
@@ -292,11 +294,11 @@ module VagrantPlugins
292
294
  b.use CloseVSphere
293
295
  end
294
296
  end
295
- end # Vagrant > 1.8.0 guard
296
- # rubocop:enable IndentationWidth
297
+ end
298
+ # rubocop:enable Layout/IndentationWidth
297
299
 
298
300
  # autoload
299
- action_root = Pathname.new(File.expand_path('../action', __FILE__))
301
+ action_root = Pathname.new(File.expand_path('action', __dir__))
300
302
  autoload :Clone, action_root.join('clone')
301
303
  autoload :CloseVSphere, action_root.join('close_vsphere')
302
304
  autoload :ConnectVSphere, action_root.join('connect_vsphere')
@@ -317,14 +319,14 @@ module VagrantPlugins
317
319
  autoload :WaitForIPAddress, action_root.join('wait_for_ip_address')
318
320
 
319
321
  # TODO: Remove the if guard when Vagrant 1.8.0 is the minimum version.
320
- # rubocop:disable IndentationWidth
322
+ # rubocop:disable Layout/IndentationWidth
321
323
  if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.8.0')
322
324
  autoload :SnapshotDelete, action_root.join('snapshot_delete')
323
325
  autoload :SnapshotList, action_root.join('snapshot_list')
324
326
  autoload :SnapshotRestore, action_root.join('snapshot_restore')
325
327
  autoload :SnapshotSave, action_root.join('snapshot_save')
326
328
  end
327
- # rubocop:enable IndentationWidth
329
+ # rubocop:enable Layout/IndentationWidth
328
330
  end
329
331
  end
330
332
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
5
  module Cap
@@ -7,6 +9,7 @@ module VagrantPlugins
7
9
 
8
10
  ssh_info = machine.ssh_info
9
11
  return nil unless ssh_info
12
+
10
13
  ssh_info[:host]
11
14
  end
12
15
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
5
  module Cap
@@ -1,36 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vagrant'
2
4
 
3
5
  module VagrantPlugins
4
6
  module VSphere
5
7
  class Config < Vagrant.plugin('2', :config)
6
- attr_accessor :ip_address_timeout # Time to wait for an IP address when booting, in seconds @return [Integer]
7
- attr_accessor :host
8
- attr_accessor :insecure
9
- attr_accessor :user
10
- attr_accessor :password
11
- attr_accessor :data_center_name
12
- attr_accessor :compute_resource_name
13
- attr_accessor :resource_pool_name
14
- attr_accessor :clone_from_vm
15
- attr_accessor :template_name
16
- attr_accessor :name
17
- attr_accessor :vm_base_path
18
- attr_accessor :customization_spec_name
19
- attr_accessor :data_store_name
20
- attr_accessor :linked_clone
21
- attr_accessor :proxy_host
22
- attr_accessor :proxy_port
23
- attr_accessor :vlan
24
- attr_accessor :addressType
25
- attr_accessor :mac
26
- attr_accessor :memory_mb
27
- attr_accessor :cpu_count
28
- attr_accessor :cpu_reservation
29
- attr_accessor :mem_reservation
30
- attr_accessor :extra_config
31
- attr_accessor :real_nic_ip
32
- attr_accessor :notes
33
- attr_accessor :wait_for_sysprep
8
+ attr_accessor :ip_address_timeout, :host, :insecure, :user, :password, :data_center_name, :compute_resource_name, :resource_pool_name, :clone_from_vm, :template_name, :name, :vm_base_path, :customization_spec_name, :data_store_name, :linked_clone, :proxy_host, :proxy_port, :vlan, :addressType, :mac, :memory_mb, :cpu_count, :cpu_reservation, :mem_reservation, :extra_config, :real_nic_ip, :notes, :wait_for_sysprep # Time to wait for an IP address when booting, in seconds @return [Integer]
34
9
 
35
10
  attr_reader :custom_attributes
36
11
 
@@ -53,9 +28,7 @@ module VagrantPlugins
53
28
  def validate(machine)
54
29
  errors = _detected_errors
55
30
 
56
- if password == :ask || password.nil?
57
- self.password = machine.ui.ask('vSphere Password (will be hidden): ', echo: false)
58
- end
31
+ self.password = machine.ui.ask('vSphere Password (will be hidden): ', echo: false) if password == :ask || password.nil?
59
32
 
60
33
  # TODO: add blank?
61
34
  errors << I18n.t('vsphere.config.host') if host.nil?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vagrant'
2
4
 
3
5
  module VagrantPlugins
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'vagrant'
3
5
  rescue LoadError
@@ -6,9 +8,7 @@ end
6
8
 
7
9
  # This is a sanity check to make sure no one is attempting to install
8
10
  # this into an early Vagrant version.
9
- if Vagrant::VERSION < '1.5'
10
- fail 'The Vagrant vSphere plugin is only compatible with Vagrant 1.5+'
11
- end
11
+ raise 'The Vagrant vSphere plugin is only compatible with Vagrant 1.5+' if Vagrant::VERSION < '1.5'
12
12
 
13
13
  module VagrantPlugins
14
14
  module VSphere
@@ -36,14 +36,14 @@ module VagrantPlugins
36
36
  end
37
37
 
38
38
  # TODO: Remove the if guard when Vagrant 1.8.0 is the minimum version.
39
- # rubocop:disable IndentationWidth
39
+ # rubocop:disable Layout/IndentationWidth
40
40
  if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.8.0')
41
41
  provider_capability('vsphere', 'snapshot_list') do
42
42
  require_relative 'cap/snapshot_list'
43
43
  Cap::SnapshotList
44
44
  end
45
45
  end
46
- # rubocop:enable IndentationWidth
46
+ # rubocop:enable Layout/IndentationWidth
47
47
 
48
48
  def self.setup_i18n
49
49
  I18n.load_path << File.expand_path('locales/en.yml', VSphere.source_root)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vagrant'
2
4
 
3
5
  module VagrantPlugins
@@ -10,6 +12,7 @@ module VagrantPlugins
10
12
  def action(name)
11
13
  action_method = "action_#{name}"
12
14
  return Action.send(action_method) if Action.respond_to?(action_method)
15
+
13
16
  nil
14
17
  end
15
18
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
 
3
5
  module VagrantPlugins
@@ -5,7 +7,7 @@ module VagrantPlugins
5
7
  module Util
6
8
  module VimHelpers
7
9
  def get_datacenter(connection, machine)
8
- connection.serviceInstance.find_datacenter(machine.provider_config.data_center_name) || fail(Errors::VSphereError, :missing_datacenter)
10
+ connection.serviceInstance.find_datacenter(machine.provider_config.data_center_name) || raise(Errors::VSphereError, :missing_datacenter)
9
11
  end
10
12
 
11
13
  def get_vm_by_uuid(connection, machine)
@@ -20,16 +22,18 @@ module VagrantPlugins
20
22
  entity_array = resource_pool_name.split('/')
21
23
  entity_array.each do |entity_array_item|
22
24
  next if entity_array_item.empty?
23
- if rp.is_a? RbVmomi::VIM::Folder
24
- rp = rp.childEntity.find { |f| f.name == entity_array_item } || fail(Errors::VSphereError, :missing_resource_pool)
25
- elsif rp.is_a? RbVmomi::VIM::ClusterComputeResource
26
- rp = rp.resourcePool.resourcePool.find { |f| f.name == entity_array_item } || fail(Errors::VSphereError, :missing_resource_pool)
27
- elsif rp.is_a? RbVmomi::VIM::ResourcePool
28
- rp = rp.resourcePool.find { |f| f.name == entity_array_item } || fail(Errors::VSphereError, :missing_resource_pool)
29
- elsif rp.is_a? RbVmomi::VIM::ComputeResource
30
- rp = rp.resourcePool.find(resource_pool_name) || fail(Errors::VSphereError, :missing_resource_pool)
25
+
26
+ case rp
27
+ when RbVmomi::VIM::Folder
28
+ rp = rp.childEntity.find { |f| f.name == entity_array_item } || raise(Errors::VSphereError, :missing_resource_pool)
29
+ when RbVmomi::VIM::ClusterComputeResource
30
+ rp = rp.resourcePool.resourcePool.find { |f| f.name == entity_array_item } || raise(Errors::VSphereError, :missing_resource_pool)
31
+ when RbVmomi::VIM::ResourcePool
32
+ rp = rp.resourcePool.find { |f| f.name == entity_array_item } || raise(Errors::VSphereError, :missing_resource_pool)
33
+ when RbVmomi::VIM::ComputeResource
34
+ rp = rp.resourcePool.find(resource_pool_name) || raise(Errors::VSphereError, :missing_resource_pool)
31
35
  else
32
- fail Errors::VSphereError, :missing_resource_pool
36
+ raise Errors::VSphereError, :missing_resource_pool
33
37
  end
34
38
  end
35
39
  rp = rp.resourcePool if !rp.is_a?(RbVmomi::VIM::ResourcePool) && rp.respond_to?(:resourcePool)
@@ -38,19 +42,22 @@ module VagrantPlugins
38
42
 
39
43
  def get_compute_resource(datacenter, machine)
40
44
  cr = find_clustercompute_or_compute_resource(datacenter, machine.provider_config.compute_resource_name)
41
- fail Errors::VSphereError, :missing_compute_resource if cr.nil?
45
+ raise Errors::VSphereError, :missing_compute_resource if cr.nil?
46
+
42
47
  cr
43
48
  end
44
49
 
45
50
  def find_clustercompute_or_compute_resource(datacenter, path)
46
- if path.is_a? String
51
+ case path
52
+ when String
47
53
  es = path.split('/').reject(&:empty?)
48
- elsif path.is_a? Enumerable
54
+ when Enumerable
49
55
  es = path
50
56
  else
51
- fail "unexpected path class #{path.class}"
57
+ raise "unexpected path class #{path.class}"
52
58
  end
53
59
  return datacenter.hostFolder if es.empty?
60
+
54
61
  final = es.pop
55
62
 
56
63
  p = es.inject(datacenter.hostFolder) do |f, e|
@@ -69,7 +76,7 @@ module VagrantPlugins
69
76
  if x.is_a?(RbVmomi::VIM::ClusterComputeResource) || x.is_a?(RbVmomi::VIM::ComputeResource)
70
77
  x
71
78
  else
72
- puts 'ex unknown type ' + x.to_json
79
+ puts "ex unknown type #{x.to_json}"
73
80
  nil
74
81
  end
75
82
  end
@@ -80,10 +87,10 @@ module VagrantPlugins
80
87
  return if name.nil? || name.empty?
81
88
 
82
89
  manager = connection.serviceContent.customizationSpecManager
83
- fail Errors::VSphereError, :null_configuration_spec_manager if manager.nil?
90
+ raise Errors::VSphereError, :null_configuration_spec_manager if manager.nil?
84
91
 
85
92
  spec = manager.GetCustomizationSpec(name: name)
86
- fail Errors::VSphereError, :missing_configuration_spec if spec.nil?
93
+ raise Errors::VSphereError, :missing_configuration_spec if spec.nil?
87
94
 
88
95
  spec
89
96
  end
@@ -93,11 +100,11 @@ module VagrantPlugins
93
100
  return if name.nil? || name.empty?
94
101
 
95
102
  # find_datastore uses folder datastore that only lists Datastore and not StoragePod, if not found also try datastoreFolder which contains StoragePod(s)
96
- datacenter.find_datastore(name) || datacenter.datastoreFolder.traverse(name) || fail(Errors::VSphereError, :missing_datastore)
103
+ datacenter.find_datastore(name) || datacenter.datastoreFolder.traverse(name) || raise(Errors::VSphereError, :missing_datastore)
97
104
  end
98
105
 
99
106
  def get_network_by_name(dc, name)
100
- dc.network.find { |f| f.name == name } || fail(Errors::VSphereError, :missing_vlan)
107
+ dc.network.find { |f| f.name == name } || raise(Errors::VSphereError, :missing_vlan)
101
108
  end
102
109
  end
103
110
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
 
3
5
  module VagrantPlugins
@@ -55,11 +57,11 @@ module VagrantPlugins
55
57
  def enumerate_snapshots(vm)
56
58
  snapshot_info = vm.snapshot
57
59
 
58
- if snapshot_info.nil?
59
- snapshot_root = []
60
- else
61
- snapshot_root = snapshot_info.rootSnapshotList
62
- end
60
+ snapshot_root = if snapshot_info.nil?
61
+ []
62
+ else
63
+ snapshot_info.rootSnapshotList
64
+ end
63
65
 
64
66
  recursor = lambda do |snapshot_list|
65
67
  Enumerator.new do |yielder|
@@ -95,7 +97,8 @@ module VagrantPlugins
95
97
  task = vm.CreateSnapshot_Task(
96
98
  name: name,
97
99
  memory: false,
98
- quiesce: false)
100
+ quiesce: false
101
+ )
99
102
 
100
103
  if block_given?
101
104
  task.wait_for_progress do |progress|
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module VagrantPlugins
2
4
  module VSphere
3
- VERSION = '1.13.4'
5
+ VERSION = '1.14.0'
4
6
  end
5
7
  end
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
 
3
5
  require 'vSphere/plugin'
4
6
 
5
7
  module VagrantPlugins
6
8
  module VSphere
7
- lib_path = Pathname.new(File.expand_path('../vSphere', __FILE__))
9
+ lib_path = Pathname.new(File.expand_path('vSphere', __dir__))
8
10
  autoload :Action, lib_path.join('action')
9
11
  autoload :Errors, lib_path.join('errors')
10
12
 
@@ -12,7 +14,7 @@ module VagrantPlugins
12
14
  #
13
15
  # @return [Pathname]
14
16
  def self.source_root
15
- @source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
17
+ @source_root ||= Pathname.new(File.expand_path('..', __dir__))
16
18
  end
17
19
  end
18
20
  end
data/spec/action_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'vagrant'
3
5
 
data/spec/clone_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  CUSTOM_VM_FOLDER = 'custom_vm_folder'
@@ -55,9 +57,8 @@ describe VagrantPlugins::VSphere::Action::Clone do
55
57
  expect(@template).to have_received(:CloneVM_Task).with(
56
58
  folder: @data_center,
57
59
  name: NAME,
58
- spec: { location: { pool: @child_resource_pool },
59
- config: expected_config
60
- }
60
+ spec: { location: { pool: @child_resource_pool },
61
+ config: expected_config }
61
62
  )
62
63
  end
63
64
 
@@ -102,10 +103,11 @@ describe VagrantPlugins::VSphere::Action::Clone do
102
103
 
103
104
  it 'should set extraConfig if specified' do
104
105
  @machine.provider_config.stub(:extra_config).and_return(
105
- 'guestinfo.hostname' => 'somehost.testvm')
106
+ 'guestinfo.hostname' => 'somehost.testvm'
107
+ )
106
108
  expected_config = RbVmomi::VIM.VirtualMachineConfigSpec(extraConfig: [
107
- { 'key' => 'guestinfo.hostname', 'value' => 'somehost.testvm' }
108
- ])
109
+ { 'key' => 'guestinfo.hostname', 'value' => 'somehost.testvm' }
110
+ ])
109
111
 
110
112
  call
111
113
  expect(@template).to have_received(:CloneVM_Task).with(
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe VagrantPlugins::VSphere::Action::ConnectVSphere do
data/spec/destroy_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe VagrantPlugins::VSphere::Action::Destroy do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe VagrantPlugins::VSphere::Action::GetSshInfo do
@@ -51,9 +53,7 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
51
53
  ipAddress: [double('NetIpConfigInfoIpAddress',
52
54
  ipAddress: 'bad address', state: 'unknown'),
53
55
  double('NetIpConfigInfoIpAddress',
54
- ipAddress: '127.0.0.1', state: 'preferred')]
55
- )
56
- ),
56
+ ipAddress: '127.0.0.1', state: 'preferred')])),
57
57
  double('GuestNicInfo',
58
58
  ipAddress: ['bad address', '255.255.255.255'],
59
59
  deviceConfigId: -1,
@@ -61,10 +61,7 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
61
61
  ipAddress: [double('NetIpConfigInfoIpAddress',
62
62
  ipAddress: 'bad address', state: 'unknown'),
63
63
  double('NetIpConfigInfoIpAddress',
64
- ipAddress: '255.255.255.255', state: 'preferred')]
65
- )
66
- )
67
- ]
64
+ ipAddress: '255.255.255.255', state: 'preferred')]))]
68
65
  }
69
66
  end
70
67
 
@@ -89,9 +86,7 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
89
86
  ipAddress: [double('NetIpConfigInfoIpAddress',
90
87
  ipAddress: 'bad address', state: 'unknown'),
91
88
  double('NetIpConfigInfoIpAddress',
92
- ipAddress: '127.0.0.2', state: 'preferred')]
93
- )
94
- ),
89
+ ipAddress: '127.0.0.2', state: 'preferred')])),
95
90
  double('GuestNicInfo',
96
91
  ipAddress: ['bad address', '255.255.255.255'],
97
92
  deviceConfigId: 2000,
@@ -99,10 +94,7 @@ describe VagrantPlugins::VSphere::Action::GetSshInfo do
99
94
  ipAddress: [double('NetIpConfigInfoIpAddress',
100
95
  ipAddress: 'bad address', state: 'unknown'),
101
96
  double('NetIpConfigInfoIpAddress',
102
- ipAddress: '255.255.255.255', state: 'preferred')]
103
- )
104
- )
105
- ]
97
+ ipAddress: '255.255.255.255', state: 'preferred')]))]
106
98
  }
107
99
 
108
100
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'vSphere/util/vim_helpers'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'vSphere/action/is_created'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe VagrantPlugins::VSphere::Action::PowerOff do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rbvmomi'
2
4
  require 'pathname'
3
5
  require 'vSphere/errors'
@@ -29,7 +31,7 @@ RSpec.configure do |config|
29
31
  # removes deprecation warnings.
30
32
  # http://stackoverflow.com/questions/20275510/how-to-avoid-deprecation-warning-for-stub-chain-in-rspec-3-0/20296359#20296359
31
33
  config.mock_with :rspec do |c|
32
- c.syntax = [:should, :expect]
34
+ c.syntax = %i[should expect]
33
35
  end
34
36
 
35
37
  config.before(:each) do
@@ -38,36 +40,37 @@ RSpec.configure do |config|
38
40
  end
39
41
 
40
42
  provider_config = double(
41
- host: 'testhost.com',
42
- user: 'testuser',
43
- password: 'testpassword',
44
- data_center_name: nil,
45
- compute_resource_name: 'testcomputeresource',
46
- resource_pool_name: 'testresourcepool',
47
- vm_base_path: nil,
48
- template_name: TEMPLATE,
49
- name: NAME,
50
- insecure: true,
51
- validate: [],
52
- customization_spec_name: nil,
53
- data_store_name: nil,
54
- clone_from_vm: nil,
55
- linked_clone: nil,
56
- proxy_host: nil,
57
- proxy_port: nil,
58
- vlan: nil,
59
- memory_mb: nil,
60
- cpu_count: nil,
61
- mac: nil,
62
- addressType: nil,
63
- cpu_reservation: nil,
64
- mem_reservation: nil,
65
- custom_attributes: {},
66
- notes: nil,
67
- extra_config: {},
68
- ip_address_timeout: 1,
69
- real_nic_ip: false,
70
- wait_for_sysprep: false)
43
+ host: 'testhost.com',
44
+ user: 'testuser',
45
+ password: 'testpassword',
46
+ data_center_name: nil,
47
+ compute_resource_name: 'testcomputeresource',
48
+ resource_pool_name: 'testresourcepool',
49
+ vm_base_path: nil,
50
+ template_name: TEMPLATE,
51
+ name: NAME,
52
+ insecure: true,
53
+ validate: [],
54
+ customization_spec_name: nil,
55
+ data_store_name: nil,
56
+ clone_from_vm: nil,
57
+ linked_clone: nil,
58
+ proxy_host: nil,
59
+ proxy_port: nil,
60
+ vlan: nil,
61
+ memory_mb: nil,
62
+ cpu_count: nil,
63
+ mac: nil,
64
+ addressType: nil,
65
+ cpu_reservation: nil,
66
+ mem_reservation: nil,
67
+ custom_attributes: {},
68
+ notes: nil,
69
+ extra_config: {},
70
+ ip_address_timeout: 1,
71
+ real_nic_ip: false,
72
+ wait_for_sysprep: false
73
+ )
71
74
  vm_config = double(
72
75
  vm: double('config_vm',
73
76
  box: nil,
data/vSphere.gemspec CHANGED
@@ -1,4 +1,6 @@
1
- $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
2
4
  require 'vSphere/version'
3
5
 
4
6
  Gem::Specification.new do |s|
@@ -11,18 +13,17 @@ Gem::Specification.new do |s|
11
13
  s.summary = 'VMWare vSphere provider'
12
14
  s.description = 'Enables Vagrant to manage machines with VMWare vSphere.'
13
15
 
14
- # force the use of Nokogiri 1.5.x to prevent conflicts with older versions of zlib
15
- s.add_dependency 'nokogiri', '~>1.5'
16
+ s.add_dependency 'nokogiri', '1.13.4'
16
17
 
17
- s.add_dependency 'rbvmomi', '>=1.11.5', '<2.0.0'
18
+ s.add_dependency 'rbvmomi', '3.0.0'
18
19
 
19
20
  s.add_dependency 'i18n', '>=0.6.4'
20
21
 
21
- s.add_development_dependency 'rake', '11.1.2' # pinned to accommodate rubocop 0.32.1
22
+ s.add_development_dependency 'rake', '13.0.6'
22
23
  s.add_development_dependency 'rspec-core'
23
24
  s.add_development_dependency 'rspec-expectations'
24
25
  s.add_development_dependency 'rspec-mocks'
25
- s.add_development_dependency 'rubocop', '~> 0.32.1'
26
+ s.add_development_dependency 'rubocop', '1.25.0'
26
27
 
27
28
  s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
28
29
  s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) }
metadata CHANGED
@@ -1,49 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.4
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Grauch
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: 1.13.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: 1.13.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rbvmomi
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.11.5
34
- - - "<"
31
+ - - '='
35
32
  - !ruby/object:Gem::Version
36
- version: 2.0.0
33
+ version: 3.0.0
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.11.5
44
- - - "<"
38
+ - - '='
45
39
  - !ruby/object:Gem::Version
46
- version: 2.0.0
40
+ version: 3.0.0
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: i18n
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +58,14 @@ dependencies:
64
58
  requirements:
65
59
  - - '='
66
60
  - !ruby/object:Gem::Version
67
- version: 11.1.2
61
+ version: 13.0.6
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
66
  - - '='
73
67
  - !ruby/object:Gem::Version
74
- version: 11.1.2
68
+ version: 13.0.6
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: rspec-core
77
71
  requirement: !ruby/object:Gem::Requirement
@@ -118,16 +112,16 @@ dependencies:
118
112
  name: rubocop
119
113
  requirement: !ruby/object:Gem::Requirement
120
114
  requirements:
121
- - - "~>"
115
+ - - '='
122
116
  - !ruby/object:Gem::Version
123
- version: 0.32.1
117
+ version: 1.25.0
124
118
  type: :development
125
119
  prerelease: false
126
120
  version_requirements: !ruby/object:Gem::Requirement
127
121
  requirements:
128
- - - "~>"
122
+ - - '='
129
123
  - !ruby/object:Gem::Version
130
- version: 0.32.1
124
+ version: 1.25.0
131
125
  description: Enables Vagrant to manage machines with VMWare vSphere.
132
126
  email:
133
127
  - andrew.grauch@nsidc.org
@@ -197,7 +191,7 @@ homepage: ''
197
191
  licenses:
198
192
  - MIT
199
193
  metadata: {}
200
- post_install_message:
194
+ post_install_message:
201
195
  rdoc_options: []
202
196
  require_paths:
203
197
  - lib
@@ -212,8 +206,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
206
  - !ruby/object:Gem::Version
213
207
  version: '0'
214
208
  requirements: []
215
- rubygems_version: 3.0.8
216
- signing_key:
209
+ rubygems_version: 3.2.22
210
+ signing_key:
217
211
  specification_version: 4
218
212
  summary: VMWare vSphere provider
219
213
  test_files: