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:
parent
00042f6af2
commit
16b18fc6f3
1 changed files with 13 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue