lib/fog/openstack/requests/network/create_subnet.rb in fog-1.31.0 vs lib/fog/openstack/requests/network/create_subnet.rb in fog-1.32.0

- old
+ new

@@ -5,26 +5,26 @@ def create_subnet(network_id, cidr, ip_version, options = {}) data = { 'subnet' => { 'network_id' => network_id, 'cidr' => cidr, - 'ip_version' => ip_version, + 'ip_version' => ip_version } } vanilla_options = [:name, :gateway_ip, :allocation_pools, :dns_nameservers, :host_routes, :enable_dhcp, :tenant_id] - vanilla_options.reject{ |o| options[o].nil? }.each do |key| + vanilla_options.each do |key| data['subnet'][key] = options[key] end request( - :body => Fog::JSON.encode(data), - :expects => [201], - :method => 'POST', - :path => 'subnets' + :body => Fog::JSON.encode(data), + :expects => [201], + :method => 'POST', + :path => 'subnets' ) end end class Mock @@ -40,10 +40,10 @@ 'gateway_ip' => options[:gateway_ip], 'allocation_pools' => options[:allocation_pools], 'dns_nameservers' => options[:dns_nameservers], 'host_routes' => options[:host_routes], 'enable_dhcp' => options[:enable_dhcp], - 'tenant_id' => options[:tenant_id], + 'tenant_id' => options[:tenant_id] } self.data[:subnets][data['id']] = data response.body = { 'subnet' => data } response end