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

Merge pull request #2241 from TerryHowe/master

Generalize server and floating ip create for openstack
This commit is contained in:
Kyle Rames 2013-10-11 13:55:26 -07:00
commit d2cad4c24b
3 changed files with 6 additions and 10 deletions

View file

@ -10,7 +10,7 @@ module Fog
attribute :port_id
attribute :tenant_id
attribute :fixed_ip_address
attribute :floating_ip_address

View file

@ -47,11 +47,10 @@ module Fog
if options['nics']
data['server']['networks'] =
Array(options['nics']).map do |nic|
{
'uuid' => nic['net_id'],
'fixed_ip' => nic['v4_fixed_ip'],
'port' => nic['port_id']
}
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
end
end

View file

@ -6,10 +6,7 @@ module Fog
def create_floating_ip(floating_network_id, options = {})
data = {
'floatingip' => {
'floating_network_id' => floating_network_id,
'port_id' => options[:port_id],
'tenant_id' => options[:tenant_id],
'fixed_ip_address' => options[:fixed_ip_address],
'floating_network_id' => floating_network_id
}
}