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:
commit
d2cad4c24b
3 changed files with 6 additions and 10 deletions
|
@ -10,7 +10,7 @@ module Fog
|
|||
attribute :port_id
|
||||
attribute :tenant_id
|
||||
attribute :fixed_ip_address
|
||||
|
||||
attribute :floating_ip_address
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue