Attempt to find the lxc-version command using sudo

... if lxc-version is not found in the efault PATH

Fixes #195
This commit is contained in:
Jan Vansteenkiste 2013-11-12 13:36:55 +01:00
parent 6779556650
commit 9b7491c2e8

View file

@ -26,10 +26,14 @@ module Vagrant
end end
def ensure_lxc_installed! def ensure_lxc_installed!
unless system("which lxc-version > /dev/null") unless system("which lxc-version > /dev/null 2>&1")
begin
sudo_wrapper.run("which", "lxc-version")
rescue Vagrant::LXC::Errors::ExecuteError
raise Errors::LxcNotInstalled raise Errors::LxcNotInstalled
end end
end end
end
# If the machine ID changed, then we need to rebuild our underlying # If the machine ID changed, then we need to rebuild our underlying
# container. # container.