kitchen-vcenter 2.10.2 → 2.11.8

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: 7c1f638e5648056082f4da2ce087031e468d0bb1113c480af1f04b98496fad5a
4
- data.tar.gz: 00d9fd698d02804d4942c1be24802954d5f72ad6cbf97040eecd1d099e959631
3
+ metadata.gz: 50205f05bf2e5fca3977374cccbd79fa2c703dea89fee58336aeb4d4286a9c1b
4
+ data.tar.gz: 5ce2309de70acd22033ea4871903371c1948f4433d85650aebe15bc629a5897d
5
5
  SHA512:
6
- metadata.gz: 66e78bad8190b260de8eebcca12051a76452110ad39136e198d1f1c9823dbadbf6698aab4d7e2fe70873fb001f28268f37c5ddec2b72ecc853f6e1d06c77b17a
7
- data.tar.gz: 1c60d33094d436b989b503268ce68ef7bd729a0216a848cb6de6d00c65f1ecf1af3dd92fb6913f5104a2c7de225ddc6159ddbd02ee7353c6bf1d4aa4a9357ace
6
+ metadata.gz: 4a5103e264c87f170405022b9b2fd0e9873365a7707ab023822276c6d312072ccd7ddb4d3de9ac3fef45f99c0c9c530a94e4627e367c8c5b7dfc2f92929ddcc0
7
+ data.tar.gz: fcf0c459ebd8805fafe813d5d34e9bc085936c2df84e3679a3564ae27e464757564ae23579c01e18358aa394c2fd013330132ee934d59bc41d668a31cfab109b
@@ -20,5 +20,5 @@
20
20
  # The main kitchen-vcenter module
21
21
  module KitchenVcenter
22
22
  # The version of this version of test-kitchen we assume enterprises want.
23
- VERSION = "2.10.2"
23
+ VERSION = "2.11.8"
24
24
  end
@@ -184,6 +184,8 @@ class Support
184
184
 
185
185
  def reconnect_network_device(vm)
186
186
  network_device = network_device(vm)
187
+ return unless network_device
188
+
187
189
  network_device.connectable = RbVmomi::VIM.VirtualDeviceConnectInfo(
188
190
  allowGuestControl: true,
189
191
  startConnected: true,
@@ -393,6 +395,12 @@ class Support
393
395
  end
394
396
  end
395
397
 
398
+ guestinfo = options[:vm_customization].select { |key, _| key =~ /^guestinfo\..*/ }
399
+ unless guestinfo.empty?
400
+ gi = guestinfo.map { |k, v| { key: k, value: v } }
401
+ config[:extraConfig] = gi
402
+ end
403
+
396
404
  config_spec = RbVmomi::VIM.VirtualMachineConfigSpec(config)
397
405
 
398
406
  task = vm.ReconfigVM_Task(spec: config_spec)
@@ -496,13 +504,15 @@ class Support
496
504
  relocate_spec.pool = options[:resource_pool]
497
505
 
498
506
  # Change network, if wanted
499
- unless options[:network_name].nil?
507
+ network_device = network_device(src_vm)
508
+ Kitchen.logger.warn format("Source VM/template does not have any network device (use VMware IPPools and vsphere-gom transport or govc to access)") unless network_device
509
+
510
+ unless network_device.nil? || options[:network_name].nil?
500
511
  networks = dc.network.select { |n| n.name == options[:network_name] }
501
512
  raise Support::CloneError.new(format("Could not find network named %s", options[:network_name])) if networks.empty?
502
513
 
503
514
  Kitchen.logger.warn format("Found %d networks named %s, picking first one", networks.count, options[:network_name]) if networks.count > 1
504
515
  network_obj = networks.first
505
- network_device = network_device(src_vm)
506
516
 
507
517
  if network_obj.is_a? RbVmomi::VIM::DistributedVirtualPortgroup
508
518
  Kitchen.logger.info format("Assigning network %s...", network_obj.pretty_path)
@@ -566,19 +576,20 @@ class Support
566
576
  # MAC at least with 6.7.0 build 9433931
567
577
 
568
578
  # Disconnect network device, so wo don't get IP collisions on start
569
- network_device = network_device(src_vm)
570
- network_device.connectable = RbVmomi::VIM.VirtualDeviceConnectInfo(
571
- allowGuestControl: true,
572
- startConnected: true,
573
- connected: false,
574
- migrateConnect: "disconnect"
575
- )
576
- relocate_spec.deviceChange = [
577
- RbVmomi::VIM.VirtualDeviceConfigSpec(
578
- operation: RbVmomi::VIM::VirtualDeviceConfigSpecOperation("edit"),
579
- device: network_device
580
- ),
581
- ]
579
+ if network_device
580
+ network_device.connectable = RbVmomi::VIM.VirtualDeviceConnectInfo(
581
+ allowGuestControl: true,
582
+ startConnected: true,
583
+ connected: false,
584
+ migrateConnect: "disconnect"
585
+ )
586
+ relocate_spec.deviceChange = [
587
+ RbVmomi::VIM.VirtualDeviceConfigSpec(
588
+ operation: RbVmomi::VIM::VirtualDeviceConfigSpecOperation("edit"),
589
+ device: network_device
590
+ ),
591
+ ]
592
+ end
582
593
 
583
594
  clone_spec = RbVmomi::VIM.VirtualMachineInstantCloneSpec(location: relocate_spec,
584
595
  name: vm_name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vcenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.2
4
+ version: 2.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ping
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: '2.5'
112
+ version: '2.6'
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="