kitchen-vcenter 2.6.5 → 2.7.0

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
  SHA256:
3
- metadata.gz: 41ac2e9801330f72776a2158cf23a4934378259dc00cfd5b8cfe721d51f218ca
4
- data.tar.gz: 939091edf9800da1ad0ff1762ad5db04dd44f9fb5ba1e8db6d2dcbca9d2b7aa8
3
+ metadata.gz: da86b6422044114b6f2b89cc85b8dc527fa5b743f2ff733e604c4730773e6fae
4
+ data.tar.gz: dab5b088008e3344b2d52fca17d97a4fffaf25a4dbf486b4ac7139d82bedbf00
5
5
  SHA512:
6
- metadata.gz: 260ee45c053dcb818eb71714d3bc5e177aa29f1492c429a5febe8b93a83f126fc42af9bf46f82e1339f59b79e5547ed0c6471ae46c523b9dbed8055c4b96b2d0
7
- data.tar.gz: 92587c0c703d82be2c0749b59e8c34c895d2a0a2ec6869594d7add00e405bc5610a18bdad20aae9d9a95de5a0add32160d2c27adaf963a5d19cc09fda05c24da
6
+ metadata.gz: 7fe27912e489acea7d4d126ca4ff6db750d24dbb56024ff387816db7b2948522da203a1d01cb728a7f16b10b0e44fb0bd27bfefa54a93849328fde67fe939d07
7
+ data.tar.gz: daadea97931ae326c43ab040ccd3cd5ebea0d724f76a8c9e3cc86b5e16c2f47b519fb7e66859f3db106b5366f05fd20d6ee5e373ef29d5098756d58845a9d1ee
@@ -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.6.5"
23
+ VERSION = "2.7.0"
24
24
  end
@@ -18,6 +18,7 @@
18
18
  require "kitchen"
19
19
  require "vsphere-automation-cis"
20
20
  require "vsphere-automation-vcenter"
21
+ require_relative "../../kitchen-vcenter/version"
21
22
  require_relative "../../support/clone_vm"
22
23
  require "securerandom"
23
24
  require "uri"
@@ -57,6 +58,7 @@ module Kitchen
57
58
  default_config :vm_username, "vagrant"
58
59
  default_config :vm_password, "vagrant"
59
60
  default_config :vm_win_network, "Ethernet0"
61
+ default_config :transform_ip, nil
60
62
 
61
63
  default_config :benchmark, false
62
64
  default_config :benchmark_file, "kitchen-vcenter.csv"
@@ -82,6 +84,8 @@ module Kitchen
82
84
  #
83
85
  # @param [Object] state is the state of the vm
84
86
  def create(state)
87
+ debug format("Starting kitchen-vcenter %s", ::KitchenVcenter::VERSION)
88
+
85
89
  save_and_validate_parameters
86
90
  connect
87
91
 
@@ -158,6 +162,7 @@ module Kitchen
158
162
  vm_username: config[:vm_username],
159
163
  vm_password: config[:vm_password],
160
164
  vm_win_network: config[:vm_win_network],
165
+ transform_ip: config[:transform_ip],
161
166
  benchmark: config[:benchmark],
162
167
  benchmark_file: config[:benchmark_file],
163
168
  }
@@ -81,6 +81,17 @@ class Support
81
81
  raise Support::CloneError.new("Timeout waiting for IP address") if ip.nil?
82
82
  raise Support::CloneError.new(format("Error getting accessible IP address, got %s. Check DHCP server and scope exhaustion", ip)) if ip =~ /^169\.254\./
83
83
 
84
+ # Allow IP rewriting (e.g. for 1:1 NAT)
85
+ if options[:transform_ip]
86
+ Kitchen.logger.info format("Received IP: %s", ip)
87
+
88
+ # rubocop:disable Security/Eval
89
+ ip = lambda { eval options[:transform_ip] }.call
90
+ # rubocop:enable Security/Eval
91
+
92
+ Kitchen.logger.info format("Transformed to IP: %s", ip)
93
+ end
94
+
84
95
  @ip = ip
85
96
  end
86
97
 
@@ -251,8 +262,8 @@ class Support
251
262
  # "wmic nicconfig get IPAddress",
252
263
  # "netsh interface ip show ipaddress #{options[:vm_win_network]}"
253
264
  end
254
- else
255
- return options[:active_discovery_command]
265
+ else
266
+ options[:active_discovery_command]
256
267
  end
257
268
  end
258
269
 
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.6.5
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2020-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbvmomi