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:
parent
7c04f4689d
commit
ce2c3ca8f6
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,10 @@ module Fog
|
||||||
if instance && address
|
if instance && address
|
||||||
address['instanceId'] = instance_id
|
address['instanceId'] = instance_id
|
||||||
instance['originalIpAddress'] = instance['ipAddress']
|
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['ipAddress'] = public_ip
|
||||||
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
|
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
|
||||||
response.status = 200
|
response.status = 200
|
||||||
|
|
Loading…
Add table
Reference in a new issue