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

[vsphere|compute] Refresh the local volume attributes upon successful save and accurately report save failures.

This commit is contained in:
Kevin Menard 2013-10-28 19:09:09 -04:00
parent 00042f6af2
commit 16b18fc6f3

View file

@ -64,9 +64,20 @@ module Fog
end
end
service.add_vm_volume(self)
data = service.add_vm_volume(self)
true
if data['task_state'] == 'success'
# We have to query vSphere to get the volume attributes since the task handle doesn't include that info.
created = server.volumes.all.find { |volume| volume.unit_number == self.unit_number }
self.id = created.id
self.key = created.key
self.filename = created.filename
true
else
false
end
end
def server