1
0
Fork 0
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:
Wesley Beary 2009-10-22 20:51:57 -07:00
parent 1f4127fafc
commit d9b7c29761
5 changed files with 15 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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