Created
November 26, 2014 04:40
-
-
Save jedipunkz/4a4f93b348c02a982201 to your computer and use it in GitHub Desktop.
fog create_subnet の --no-gateway 対応
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u ~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb.org ~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb | |
--- /home/thirai/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb.org 2014-11-26 13:38:27.676953155 +0900 | |
+++ /home/thirai/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb 2014-11-26 13:38:47.384952650 +0900 | |
@@ -14,8 +14,16 @@ | |
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| | |
+ # data['subnet'][key] = options[key] | |
+ # end | |
vanilla_options.reject{ |o| options[o].nil? }.each do |key| | |
- data['subnet'][key] = options[key] | |
+ if options[:gateway_ip] == 'None' then | |
+ data['subnet'][key] = options[key] | |
+ data['subnet'][:gateway_ip] = nil | |
+ else | |
+ data['subnet'][key] = options[key] | |
+ end | |
end | |
request( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment