Sha256: 951fa8a1fc4a9c9ff16a706c805f93e0f91be2ceb272a3e25a4620a2cd73c13c
Contents?: true
Size: 1.34 KB
Versions: 39
Compression:
Stored size: 1.34 KB
Contents
Shindo.tests('Compute::VcloudDirector | ovf requests', ['vclouddirector']) do @service = Fog::Compute::VcloudDirector.new @org = VcloudDirector::Compute::Helper.current_org(@service) tests('Get first vDC') do session = @service.get_current_session.body link = @org[:Link].detect do |l| l[:type] == 'application/vnd.vmware.vcloud.vdc+xml' end @vdc = @service.get_vdc(link[:href].split('/').last).body end # 'Envelope' is the outer type of the parsed XML document. tests('#get_vapp_ovf_descriptor').returns('Envelope') do pending if Fog.mocking? link = @vdc[:ResourceEntities][:ResourceEntity].detect do |l| l[:type] == 'application/vnd.vmware.vcloud.vApp+xml' end pending if link.nil? body = @service.get_vapp_ovf_descriptor(link[:href].split('/').last).body Nokogiri::XML::Document.parse(body).children.first.name end # 'Envelope' is the outer type of the parsed XML document. tests('#get_vapp_template_ovf_descriptor').returns('Envelope') do pending if Fog.mocking? link = @vdc[:ResourceEntities][:ResourceEntity].detect do |l| l[:type] == 'application/vnd.vmware.vcloud.vAppTemplate+xml' end pending if link.nil? body = @service.get_vapp_template_ovf_descriptor(link[:href].split('/').last).body Nokogiri::XML::Document.parse(body).children.first.name end end
Version data entries
39 entries across 39 versions & 2 rubygems