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

Merge pull request #2377 from maestrodev/google-natip

[google|compute] natIP is set to true when it must be an ip
This commit is contained in:
Nat Welch 2013-11-08 13:38:38 -08:00
commit fa4ff950c4

View file

@ -115,18 +115,16 @@ module Fog
end
# ExternalIP is default value for server creation
access_config = {'type' => 'ONE_TO_ONE_NAT', 'name' => 'External NAT'}
# leave natIP undefined to use an IP from a shared ephemeral IP address pool
if options.has_key? 'externalIp'
external_ip = options.delete 'externalIp'
else
external_ip = true
access_config['natIP'] = options.delete 'externalIp'
end
networkInterfaces = []
if ! network.nil?
networkInterface = { 'network' => @api_url + @project + "/global/networks/#{network}" }
if external_ip
networkInterface['accessConfigs'] = [{'type' => 'ONE_TO_ONE_NAT', 'name' => 'External NAT', 'natIP' => external_ip}]
end
networkInterface['accessConfigs'] = [access_config]
networkInterfaces << networkInterface
end