Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy support #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/chef/provisioning/vsphere_driver/vsphere_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rbvmomi'
require 'uri'

module ChefProvisioningVsphere
class VsphereHelper
Expand All @@ -8,6 +9,12 @@ class VsphereHelper
end

def initialize(connect_options, datacenter_name)
if ENV['https_proxy']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do the same with HTTP_PROXY and make https_proxy uppercase which should not matter on windows but will on linux.

proxy_uri = URI.parse(ENV['https_proxy'])
#proxy_user, proxy_pass = uri.userinfo.split(/:/) if uri.userinfo
connect_options[:proxyHost] = proxy_uri.host
connect_options[:proxyPort] = proxy_uri.port
end
@connect_options = connect_options
@datacenter_name = datacenter_name
end
Expand Down