1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[vcloud_director] Ensure task :Owner is always present.

This commit is contained in:
Nick Osborn 2013-10-31 15:30:46 +00:00
parent c3fd7d7b96
commit b9874496aa

View file

@ -75,13 +75,22 @@ module Fog
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-Task.html
# @since vCloud API version 0.9
def get_task(id)
request(
response = request(
:expects => 200,
:idempotent => true,
:method => 'GET',
:parser => Fog::ToHashDocument.new,
:path => "task/#{id}"
)
# vCloud Director bug: Owner may be absent for some tasks, fix
# targeted for 5.1.3 (due out at the beginning Q1 2014).
#
# We'd prefer that Owner is always present; if nothing else, this
# let's the tests pass.
response.body[:Owner] ||= {:href => '', :name => nil, :type => nil}
response
end
end