mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
process_task it accepts the body instead of the response excon object
This commit is contained in:
parent
164bf8b473
commit
0ad1a40588
8 changed files with 13 additions and 17 deletions
|
@ -196,9 +196,8 @@ module Fog
|
|||
raise @e
|
||||
end
|
||||
|
||||
def process_task(request)
|
||||
response = request
|
||||
task = make_task_object(response.body)
|
||||
def process_task(response_body)
|
||||
task = make_task_object(response_body)
|
||||
wait_and_raise_unless_success(task)
|
||||
true
|
||||
end
|
||||
|
|
|
@ -15,11 +15,8 @@ module Fog
|
|||
attribute :vapp_template_id
|
||||
|
||||
def instantiate(vapp_name, options={})
|
||||
puts vapp_template_id
|
||||
response = service.instantiate_vapp_template(vapp_name, vapp_template_id, options = {})
|
||||
task = response.body[:Tasks][:Task]
|
||||
task[:id] = task[:href].split('/').last
|
||||
service.tasks.new(task)
|
||||
service.process_task(response.body[:Tasks][:Task])
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ module Fog
|
|||
num_disk = element_name.scan(/\d+/).first.to_i
|
||||
data.modify_hard_disk_size(num_disk, new_capacity)
|
||||
response = service.put_vm_disks(vm_id, data.disks)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -46,7 +46,7 @@ module Fog
|
|||
data = Fog::Generators::Compute::Vcloudng::Disks.new(all_disks)
|
||||
data.delete_hard_disk(num_disk)
|
||||
response = service.put_vm_disks(vm_id, data.disks)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -35,7 +35,7 @@ module Fog
|
|||
data = Fog::Generators::Compute::Vcloudng::Disks.new(@disks)
|
||||
data.add_hard_disk(size)
|
||||
response = service.put_vm_disks(vm_id, data.disks)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -34,10 +34,10 @@ module Fog
|
|||
if progress.to_i == 0
|
||||
printf '.'
|
||||
else
|
||||
puts progress
|
||||
print " #{progress} %\r"
|
||||
end
|
||||
else
|
||||
puts status
|
||||
puts " #{status}"
|
||||
end
|
||||
status != 'running'
|
||||
end
|
||||
|
|
|
@ -38,7 +38,7 @@ module Fog
|
|||
|
||||
def power_on
|
||||
response = service.post_vm_poweron(id)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
def tags
|
||||
|
@ -71,7 +71,7 @@ module Fog
|
|||
attributes[:memory] = new_memory.to_i
|
||||
if not_first_set && has_changed
|
||||
response = service.put_vm_memory(id, memory)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -81,7 +81,7 @@ module Fog
|
|||
attributes[:cpu] = new_cpu.to_i
|
||||
if not_first_set && has_changed
|
||||
response = service.put_vm_cpu(id, cpu)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ module Fog
|
|||
|
||||
def save
|
||||
response = service.put_vm_customization(id, attributes)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -22,7 +22,7 @@ module Fog
|
|||
|
||||
def save
|
||||
response = service.put_vm_network(id, attributes)
|
||||
service.process_task(response)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue