diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c89c902..8ebe318 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -52,7 +52,7 @@ Metrics/BlockNesting: # Offense count: 3 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 638 + Max: 643 # Offense count: 11 Metrics/CyclomaticComplexity: diff --git a/README.md b/README.md index a6ee8d9..c9b0985 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A vCenter and valid login credentials. ### VM Template -A VM template capable of installing Chef 11.8 or newer. This can be either windows or linux flavored. +A VM template capable of installing Chef 11.8 or newer. This can be either windows or linux flavored. Both IPv4 and IPv6 are supported. ### A provisioning node (can be local) diff --git a/lib/chef/provisioning/vsphere_driver/driver.rb b/lib/chef/provisioning/vsphere_driver/driver.rb index b3ad74b..e3fdfc3 100644 --- a/lib/chef/provisioning/vsphere_driver/driver.rb +++ b/lib/chef/provisioning/vsphere_driver/driver.rb @@ -847,8 +847,13 @@ def create_winrm_transport(host, options) else winrm_options.merge!(options[:winrm_opts]) end - endpoint = "http#{winrm_transport == :ssl ? 's' : ''}://"\ - "#{host}:#{port}/wsman" + scheme = winrm_transport == :ssl ? 'https' : 'http' + endpoint = URI::Generic.build( + scheme: scheme, + host: host, + port: port, + path: '/wsman' + ).to_s Chef::Provisioning::Transport::WinRM.new( endpoint,