Rebase and cleanup conditional

This commit is contained in:
Seth Vargo 2015-11-18 16:31:44 -08:00
parent 2c6ef938c7
commit 48df85008c
1 changed files with 2 additions and 3 deletions

View File

@ -250,15 +250,14 @@ module VagrantPlugins
mac: nil, mac: nil,
nic_type: nil, nic_type: nil,
type: :static, type: :static,
dhcp_ip: "172.28.128.1" dhcp_ip: "172.28.128.1",
}.merge(options) }.merge(options)
# Make sure the type is a symbol # Make sure the type is a symbol
options[:type] = options[:type].to_sym options[:type] = options[:type].to_sym
# Default IP is in the 20-bit private network block for DHCP based networks # Default IP is in the 20-bit private network block for DHCP based networks
options[:ip] = options[:dhcp_ip] if options[:type] == :dhcp options[:ip] ||= options[:dhcp_ip] if options[:type] == :dhcp
ip = IPAddr.new(options[:ip]) ip = IPAddr.new(options[:ip])
if ip.ipv4? if ip.ipv4?