mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
reload is a noop if get returns nil
This commit is contained in:
parent
1f4127fafc
commit
d9b7c29761
5 changed files with 15 additions and 10 deletions
|
@ -34,8 +34,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = addresses.get(@public_ip).attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_address = addresses.get(@public_ip)
|
||||
merge_attributes(new_address.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
|
@ -68,8 +68,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = instances.all(@instance_id).first.attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_instance = instances.get(@instance_id)
|
||||
merge_attributes(new_instance.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
|
@ -18,8 +18,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = key_pairs.all(@name).first.attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_key_pair = key_pairs.get(@name)
|
||||
merge_attributes(new_key_pair.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
|
@ -15,8 +15,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = security_groups.get(@group_name).attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_security_group = security_groups.get(@group_name)
|
||||
merge_attributes(new_security_group.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
|
@ -16,8 +16,9 @@ module Fog
|
|||
end
|
||||
|
||||
def reload
|
||||
new_attributes = snapshots.get(@snapshot_id).attributes
|
||||
merge_attributes(new_attributes)
|
||||
if new_snapshot = snapshots.get(@snapshot_id)
|
||||
merge_attributes(new_snapshot.attributes)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
|
|
Loading…
Reference in a new issue