Class: URI::VsphereUrl
- Inherits:
-
Generic
- Object
- Generic
- URI::VsphereUrl
- Defined in:
- lib/chef/provisioning/vsphere_driver/vsphere_url.rb
Constant Summary collapse
- DEFAULT_PORT =
443
- DEFAULT_PATH =
'/sdk'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_config(options) ⇒ Object
8 9 10 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 8 def self.from_config() URI("vsphere://#{[:host]}:#{[:port]}#{[:path]}?use_ssl=#{[:use_ssl]}&insecure=#{[:insecure]}") end |
Instance Method Details
#insecure ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 21 def insecure if query insecure_query = query.split('&').each.select{|q| q.start_with?('insecure=')}.first insecure_query == 'insecure=true' else false end end |
#use_ssl ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 12 def use_ssl if query ssl_query = query.split('&').each.select{|q| q.start_with?('use_ssl=')}.first ssl_query == 'use_ssl=true' else true end end |