1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|compute] mock: make address detach others before associating

closes #233
This commit is contained in:
geemus 2011-05-27 12:22:27 -07:00
parent 7c04f4689d
commit ce2c3ca8f6

View file

@ -40,6 +40,10 @@ module Fog
if instance && address
address['instanceId'] = instance_id
instance['originalIpAddress'] = instance['ipAddress']
# detach other address (if any)
if self.data[:addresses][instance['originalIpAddress']]
self.data[:addresses][instance['originalIpAddress']]['instanceId'] = nil
end
instance['ipAddress'] = public_ip
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
response.status = 200