From 607bf3ae99c8562a2acb3b53d96815ced2545ade Mon Sep 17 00:00:00 2001 From: Daniel Aragao Date: Thu, 15 May 2014 13:24:36 +1000 Subject: [PATCH 1/2] Content type to upload vAppTemplates is application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml'. --- .../requests/compute/post_upload_vapp_template.rb | 2 +- tests/vcloud/data/api_+_vdc_+_1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb b/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb index f980d10b0..96771ee62 100644 --- a/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb +++ b/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb @@ -34,7 +34,7 @@ module Fog request( :body => body, :expects => 201, - :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.vAppTemplateParams+xml'}, + :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml'}, :method => 'POST', :parser => Fog::ToHashDocument.new, :path => "vdc/#{vdc_id}/action/uploadVAppTemplate" diff --git a/tests/vcloud/data/api_+_vdc_+_1 b/tests/vcloud/data/api_+_vdc_+_1 index cb5bf55ab..b2917f895 100644 --- a/tests/vcloud/data/api_+_vdc_+_1 +++ b/tests/vcloud/data/api_+_vdc_+_1 @@ -7,6 +7,7 @@ RESOURCE_POOL + From 03b5551b3a0b0bc2b241d878a6608b5eb94a4903 Mon Sep 17 00:00:00 2001 From: Daniel Aragao Date: Wed, 28 May 2014 16:18:44 +1000 Subject: [PATCH 2/2] Fixes attributes when generating xml body for post deploy vapps. --- .../vcloud_director/requests/compute/post_deploy_vapp.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb b/lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb index 257bd29b6..49bbde7b4 100644 --- a/lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb +++ b/lib/fog/vcloud_director/requests/compute/post_deploy_vapp.rb @@ -30,9 +30,9 @@ module Fog attrs = { :xmlns => 'http://www.vmware.com/vcloud/v1.5' } - attr[:deploymentLeaseSeconds] = options[:deploymentLeaseSeconds] if options.key?(:deploymentLeaseSeconds) - attr[:forceCustomization] = options[:forceCustomization] if options.key?(:forceCustomization) - attr[:powerOn] = options[:powerOn] if options.key?(:powerOn) + attrs[:deploymentLeaseSeconds] = options[:deploymentLeaseSeconds] if options.key?(:deploymentLeaseSeconds) + attrs[:forceCustomization] = options[:forceCustomization] if options.key?(:forceCustomization) + attrs[:powerOn] = options[:powerOn] if options.key?(:powerOn) DeployVAppParams(attrs) end.to_xml