Accept both symbol and string for network type

Previously, following Vagrant documentation to setup private DHCP
network failed with:

  config.vm.network "private_network", type: "dhcp"

Now libvirt provider accepts both "dhcp" and :dhcp
This commit is contained in:
Martin André 2015-09-24 14:40:18 +09:00
parent 91fa94c62b
commit 795124eac9
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ module VagrantPlugins
if @options[:ip]
handle_ip_option(env)
elsif @options[:type] == :dhcp
elsif @options[:type].to_s == 'dhcp'
handle_dhcp_private_network(env)
elsif @options[:network_name]
handle_network_name_option(env)

View File

@ -60,7 +60,7 @@ module VagrantPlugins
forward_mode: 'nat',
}.merge(options)
if options[:type] == :dhcp && options[:ip].nil?
if options[:type].to_s == 'dhcp' && options[:ip].nil?
options[:network_name] = "vagrant-private-dhcp"
end