Nil not turning into null in request on Fog

68 views Asked by At

Afternoon StackOverflow,

I am trying to build a network on OpenStack using Fog & Ruby but the network I am trying to make is getting made with a gateway, after readying the API Documents here it says to disable the gateway on creation

set the gateway_ip attribute to null in the request body

I tried the following with no luck

@openstack_network.subnets.create(:name => "my-network", :network_id => network.id, :cidr => '240.250.0.0/16', :ip_version => 4, :gateway_ip => nil)

I also tried setting it to 'null' and ''.

I'm a bit stuck on what to try and how I can do this so any help is greatly appreciated!

1

There are 1 answers

0
Matt Darby On BEST ANSWER

I work over at Rackspace and help maintain the Fog gem.

I looked over your issue and found that the code automatically stripped nil values; so OpenStack was never hearing about your full request.

I've opened a Pull Request aimed at solving this issue.

Thank you very much for finding this three year old bug! :)