diff --git a/lib/fog/aws/models/compute/address.rb b/lib/fog/aws/models/compute/address.rb index 37e1d812c..db2782819 100644 --- a/lib/fog/aws/models/compute/address.rb +++ b/lib/fog/aws/models/compute/address.rb @@ -30,6 +30,10 @@ module Fog disassociate end end + + def server + connection.servers.get(server_id) + end def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity diff --git a/tests/aws/models/compute/address_tests.rb b/tests/aws/models/compute/address_tests.rb index 84aa08af8..3c0fb4ea4 100644 --- a/tests/aws/models/compute/address_tests.rb +++ b/tests/aws/models/compute/address_tests.rb @@ -9,6 +9,13 @@ Shindo.tests("Fog::Compute[:aws] | address", ['aws']) do @instance.server = @server end + tests('#server') do + test(' == @server') do + @server.reload + @instance.server.public_ip_address == @instance.public_ip + end + end + @server.destroy end