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

[openstack] fix broken subnet test

This commit is contained in:
Maurice Schreiber 2015-08-05 15:39:49 +02:00
parent e4ce9804de
commit 788482b1a9
3 changed files with 8 additions and 8 deletions

View file

@ -38,9 +38,9 @@ module Fog
'cidr' => cidr, 'cidr' => cidr,
'ip_version' => ip_version, 'ip_version' => ip_version,
'gateway_ip' => options[:gateway_ip], 'gateway_ip' => options[:gateway_ip],
'allocation_pools' => options[:allocation_pools] || [], 'allocation_pools' => options[:allocation_pools],
'dns_nameservers' => options[:dns_nameservers] || [], 'dns_nameservers' => options[:dns_nameservers],
'host_routes' => options[:host_routes] || [], 'host_routes' => options[:host_routes],
'enable_dhcp' => options[:enable_dhcp], 'enable_dhcp' => options[:enable_dhcp],
'tenant_id' => options[:tenant_id] 'tenant_id' => options[:tenant_id]
} }

View file

@ -26,9 +26,9 @@ module Fog
if subnet = list_subnets.body['subnets'].find { |_| _['id'] == subnet_id } if subnet = list_subnets.body['subnets'].find { |_| _['id'] == subnet_id }
subnet['name'] = options[:name] subnet['name'] = options[:name]
subnet['gateway_ip'] = options[:gateway_ip] subnet['gateway_ip'] = options[:gateway_ip]
subnet['dns_nameservers'] = options[:dns_nameservers] subnet['dns_nameservers'] = options[:dns_nameservers] || []
subnet['host_routes'] = options[:host_routes] subnet['host_routes'] = options[:host_routes] || []
subnet['allocation_pools'] = options[:allocation_pools] subnet['allocation_pools'] = options[:allocation_pools] || []
subnet['enable_dhcp'] = options[:enable_dhcp] subnet['enable_dhcp'] = options[:enable_dhcp]
response.body = { 'subnet' => subnet } response.body = { 'subnet' => subnet }
response.status = 200 response.status = 200

View file

@ -38,8 +38,8 @@ Shindo.tests('Fog::Network[:openstack] | subnet requests', ['openstack']) do
tests('#update_subnet').formats({'subnet' => @subnet_format}) do tests('#update_subnet').formats({'subnet' => @subnet_format}) do
subnet_id = Fog::Network[:openstack].subnets.all.first.id subnet_id = Fog::Network[:openstack].subnets.all.first.id
attributes = {:name => 'subnet_name', :gateway_ip => '10.2.2.1', attributes = {:name => 'subnet_name', :gateway_ip => '10.2.2.1',
:dns_nameservers => [], :host_routes => [], :allocation_pools => [], :dns_nameservers => [],
:enable_dhcp => true} :host_routes => [], :enable_dhcp => true}
Fog::Network[:openstack].update_subnet(subnet_id, attributes).body Fog::Network[:openstack].update_subnet(subnet_id, attributes).body
end end