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:
commit
fa4ff950c4
1 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue