fog-vsphere 3.7.1 → 3.7.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fde8da8e67f090b3268f7c130b48d8730fb7fc1fcd922579c66f1ee67f50b19
4
- data.tar.gz: 3fc30e334b66725ab517afc440dbdcbe3804c0565d8ad6e90d396529d9249d03
3
+ metadata.gz: 924b9bbb6dc4715d151b6737ab5a7c29ba114e3c8f3e3d05366d29a5f164c52e
4
+ data.tar.gz: bca22014a94f40e12301c2f18664242effbd09c984cff91e134947f5a4e799c1
5
5
  SHA512:
6
- metadata.gz: 8a2c98ab7b82db9587b12cfc7bb06bd23a1346a9048cbf16bfec1d6e20b20ec0b9f39ee2a8912f92f7aec3c1a6e42caef3f37f9af6ddd6527468c572c08b76f0
7
- data.tar.gz: c7569f04cade03956f13d637a6cebe77d5cefd97535c62b604b62c115c53cd423548f1379a94c96a7f1c74636f57b3f2d58fc26548b43d66580c6b757b7d53f0
6
+ metadata.gz: c7d777833b52e0184c94818bf6876ae3ee518425c57f9ae922b1f66b0f92b20c832e16e358d7e280c91ba2fa12f65c6469a231fe97ee55680c253541c09f817f
7
+ data.tar.gz: 5006c14b999ba3ee502a423a953407b1cbd5739f2de946adb67026dfadc08a937d7b770839d1110b5792b1a26e0eac8ba83a8f7f455bc8d51e86ec9390b7e6a9
@@ -290,11 +290,11 @@ module Fog
290
290
  end
291
291
 
292
292
  def scsi_controllers
293
- attributes[:scsi_controllers] ||= service.list_vm_scsi_controllers(id)
293
+ attributes[:scsi_controllers] ||= id.nil? ? [] : service.list_vm_scsi_controllers(id)
294
294
  end
295
295
 
296
296
  def nvme_controllers
297
- attributes[:nvme_controllers] ||= service.list_vm_nvme_controllers(id)
297
+ attributes[:nvme_controllers] ||= id.nil? ? [] : service.list_vm_nvme_controllers(id)
298
298
  end
299
299
 
300
300
  def scsi_controller
@@ -136,7 +136,7 @@ module Fog
136
136
  def device_change(attributes)
137
137
  devices = []
138
138
  if (nics = attributes[:interfaces])
139
- devices << nics.map { |nic| create_interface(nic, nics.index(nic), :add, attributes) }
139
+ devices << nics.each_with_index.map { |nic, index| create_interface(nic, index, :add, attributes) }
140
140
  end
141
141
 
142
142
  if (scsi_controllers = attributes[:scsi_controllers] || attributes['scsi_controller'])
@@ -152,7 +152,7 @@ module Fog
152
152
  end
153
153
 
154
154
  if (cdroms = attributes[:cdroms])
155
- devices << cdroms.map { |cdrom| create_cdrom(cdrom, cdroms.index(cdrom)) }
155
+ devices << cdroms.each_with_index.map { |cdrom, index| create_cdrom(cdrom, index) }
156
156
  end
157
157
 
158
158
  devices << create_virtual_tpm if attributes[:virtual_tpm]
@@ -189,9 +189,9 @@ module Fog
189
189
  if nics = attributes[:interfaces]
190
190
  # key is based on 4000 + the interface index
191
191
  # we allow booting from all network interfaces, the first interface has the highest priority
192
- nics.each do |nic|
192
+ nics.each_with_index do |_nic, index|
193
193
  boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableEthernetDevice.new(
194
- deviceKey: 4000 + nics.index(nic)
194
+ deviceKey: 4000 + index
195
195
  )
196
196
  end
197
197
  end
@@ -3,6 +3,8 @@ module Fog
3
3
  class Compute
4
4
  class Real
5
5
  def get_virtual_machine(id, datacenter_name = nil, folder = nil, recursive = false)
6
+ raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?
7
+
6
8
  # The larger the VM list the longer it will take if not searching based on UUID.
7
9
  convert_vm_mob_ref_to_attr_hash(get_vm_ref(id, datacenter_name, folder, recursive))
8
10
  end
@@ -10,6 +12,8 @@ module Fog
10
12
  protected
11
13
 
12
14
  def get_vm_ref(id, dc = nil, folder = nil, recursive = false)
15
+ raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?
16
+
13
17
  raw_datacenter = find_raw_datacenter(dc) if dc
14
18
  vm = case is_uuid?(id)
15
19
  # UUID based
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '3.7.1'.freeze
3
+ VERSION = '3.7.2'.freeze
4
4
  end
5
5
  end
data/tests/helper.rb CHANGED
@@ -1,6 +1,5 @@
1
- require 'mocha/api'
2
- Shindo::Tests.send(:include, Mocha::API)
3
-
4
1
  require 'minitest/autorun'
2
+ require 'mocha/minitest'
3
+ Shindo::Tests.send(:include, Mocha::API)
5
4
 
6
5
  require File.expand_path('../../lib/fog/vsphere', __FILE__)
data/tests/test_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'minitest'
1
2
  require 'mocha/minitest'
2
3
  require 'vcr'
3
4
  require 'webmock/minitest'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-05-06 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: fog-core
@@ -426,7 +425,6 @@ homepage: https://github.com/fog/fog-vsphere
426
425
  licenses:
427
426
  - MIT
428
427
  metadata: {}
429
- post_install_message:
430
428
  rdoc_options: []
431
429
  require_paths:
432
430
  - lib
@@ -441,8 +439,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
441
439
  - !ruby/object:Gem::Version
442
440
  version: '0'
443
441
  requirements: []
444
- rubygems_version: 3.2.33
445
- signing_key:
442
+ rubygems_version: 3.8.0.dev
446
443
  specification_version: 4
447
444
  summary: Module for the 'fog' gem to support VMware vSphere.
448
445
  test_files: