Make MAC address regex check case insensitive

The regex check for the container MAC address presence in the
dnsmasq leases file is case sensitive. Dnsmasq outputs uppercase
addresses in the leases file.

As MAC addresses are generally considered case insensitive, it
makes sense to relax the regular expression check to allow for this.
This commit is contained in:
Kristof Willaert 2014-05-08 14:30:14 +02:00
parent b210b260b1
commit 6b5c00089d

View file

@ -19,7 +19,7 @@ module Vagrant
dnsmasq_leases = read_dnsmasq_leases
@logger.debug "Attempting to load ip from dnsmasq leases (mac: #{mac_address})"
@logger.debug dnsmasq_leases
if dnsmasq_leases =~ /#{Regexp.escape mac_address}\s+([0-9.]+)\s+/
if dnsmasq_leases =~ /#{Regexp.escape mac_address}\s+([0-9.]+)\s+/i
ip = $1.to_s
break
else