Sha256: 51799751f7e2d878c6c1a43b324b1778c86a4401a466dbb7727aef686f4b805a

Contents?: true

Size: 670 Bytes

Versions: 72

Compression:

Stored size: 670 Bytes

Contents

require 'uri'

module URI
	class VsphereUrl < Generic
		DEFAULT_PORT = 443
		DEFAULT_PATH = '/sdk'

		def self.from_config(options)
			URI("vsphere://#{options[:host]}:#{options[:port]}#{options[:path]}?use_ssl=#{options[:use_ssl]}&insecure=#{options[:insecure]}")
		end

		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

		def insecure
			if query
				insecure_query = query.split('&').each.select{|q| q.start_with?('insecure=')}.first
				insecure_query == 'insecure=true'
			else
				false
			end
		end
	end
	@@schemes['VSPHERE'] = VsphereUrl
end

Version data entries

72 entries across 72 versions & 3 rubygems

Version Path
chef-provisioning-vsphere-0.4.2 lib/chef/provisioning/vsphere_driver/vsphere_url.rb
clc-chef-provisioning-vsphere-0.4.1 lib/chef/provisioning/vsphere_driver/vsphere_url.rb
clc-chef-provisioning-vsphere-0.4.0 lib/chef/provisioning/vsphere_driver/vsphere_url.rb
clc-chef-metal-vsphere-0.3.77 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.67 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.66 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.65 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.64 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.63 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.62 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.61 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.60 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.59 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.58 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.57 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.56 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.55 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.54 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.53 lib/chef_metal_vsphere/vsphere_url.rb
clc-chef-metal-vsphere-0.3.52 lib/chef_metal_vsphere/vsphere_url.rb