mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fix volume reload, and set availability zone to match when assigning instance
This commit is contained in:
parent
a5c9db5c21
commit
413cc51964
1 changed files with 6 additions and 2 deletions
|
@ -29,6 +29,9 @@ module Fog
|
|||
def instance=(new_instance)
|
||||
if !@volume_id
|
||||
@instance = new_instance
|
||||
if new_instance
|
||||
@availability_zone = new_instance.availability_zone
|
||||
end
|
||||
elsif new_instance
|
||||
@instance = nil
|
||||
@instance_id = new_instance.instance_id
|
||||
|
@ -37,8 +40,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = volumes.get(@volume_id).attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_volume = volumes.get(@volume_id)
|
||||
merge_attributes(new_volume.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
Loading…
Reference in a new issue