From 9b7491c2e8ff3a0591649f3c14ab64b7bc77bb76 Mon Sep 17 00:00:00 2001 From: Jan Vansteenkiste Date: Tue, 12 Nov 2013 13:36:55 +0100 Subject: [PATCH] Attempt to find the lxc-version command using sudo ... if lxc-version is not found in the efault PATH Fixes #195 --- lib/vagrant-lxc/provider.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/provider.rb b/lib/vagrant-lxc/provider.rb index 03a4463..2ad6dfe 100644 --- a/lib/vagrant-lxc/provider.rb +++ b/lib/vagrant-lxc/provider.rb @@ -26,8 +26,12 @@ module Vagrant end def ensure_lxc_installed! - unless system("which lxc-version > /dev/null") - raise Errors::LxcNotInstalled + unless system("which lxc-version > /dev/null 2>&1") + begin + sudo_wrapper.run("which", "lxc-version") + rescue Vagrant::LXC::Errors::ExecuteError + raise Errors::LxcNotInstalled + end end end