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

Merge pull request #2649 from tenforward/openstack_nics_symbol

[openstack|compute] Allow to use Symbol when specifying the hash of NICs
This commit is contained in:
Kyle Rames 2014-02-06 11:06:30 -06:00
commit a16a86aa5d

View file

@ -47,9 +47,9 @@ module Fog
if options['nics']
data['server']['networks'] =
Array(options['nics']).map do |nic|
neti = { 'uuid' => nic['net_id'] }
neti['fixed_ip'] = nic['v4_fixed_ip'] unless nic['v4_fixed_ip'].nil?
neti['port'] = nic['port_id'] unless nic['port_id'].nil?
neti = { 'uuid' => (nic['net_id'] || nic[:net_id]) }
neti['fixed_ip'] = (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]) unless (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]).nil?
neti['port'] = (nic['port_id'] || nic[:port_id]) unless (nic['port_id'] || nic[:port_id]).nil?
neti
end
end