From 9111261f794c18f72eeb2e9dd45caf187193adf6 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Mon, 12 May 2014 23:21:40 -0300 Subject: [PATCH] driver: Do not show a stacktrace to the user if no network.hwaddr is present on container configs This is enough to close GH-266 since Vagrant will take care of showing an error informing the user that it was unable to connect to the machine. --- lib/vagrant-lxc/driver.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-lxc/driver.rb b/lib/vagrant-lxc/driver.rb index 001efd4..6435c24 100644 --- a/lib/vagrant-lxc/driver.rb +++ b/lib/vagrant-lxc/driver.rb @@ -44,7 +44,11 @@ module Vagrant end def mac_address - @mac_address ||= config_string.match(/^lxc\.network\.hwaddr\s*+=\s*+(.+)$/)[1] + return @mac_address if @mac_address + + if config_string =~ /^lxc\.network\.hwaddr\s*+=\s*+(.+)$/ + @mac_address = $1 + end end def config_string