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
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 9 def self.from_config() parts = [] parts << 'vsphere://' parts << [:host] parts << ':' parts << ([:port] || DEFAULT_PORT) parts << ([:path] || DEFAULT_PATH) parts << '?use_ssl=' parts << ([:use_ssl] == false ? false : true) parts << '&insecure=' parts << ([:insecure] || false) URI parts.join end |
Instance Method Details
#insecure ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 34 def insecure if query insecure_query = query.split('&').each.select do |q| q.start_with?('insecure=') end.first insecure_query == 'insecure=true' else false end end |
#use_ssl ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/chef/provisioning/vsphere_driver/vsphere_url.rb', line 23 def use_ssl if query ssl_query = query.split('&').each.select do |q| q.start_with?('use_ssl=') end.first ssl_query == 'use_ssl=true' else true end end |