10c53c54d7
The previously hardcoded lxc path prevented the sudo wrapper from working in environment with alternative `lxcpath`. I had to move `sudo_wrapper` from `provider` to `LXC` because the concept of "provider" is tied to a machine when a command sush as `sudoers` is not. Fixes #413 and #399
22 lines
490 B
Ruby
22 lines
490 B
Ruby
require "vagrant-lxc/version"
|
|
require "vagrant-lxc/plugin"
|
|
require "vagrant-lxc/sudo_wrapper"
|
|
|
|
module Vagrant
|
|
module LXC
|
|
def self.source_root
|
|
@source_root ||= Pathname.new(File.dirname(__FILE__)).join('..').expand_path
|
|
end
|
|
|
|
def self.sudo_wrapper_path
|
|
"/usr/local/bin/vagrant-lxc-wrapper"
|
|
end
|
|
|
|
def self.sudo_wrapper
|
|
wrapper = Pathname.new(sudo_wrapper_path).exist? &&
|
|
sudo_wrapper_path || nil
|
|
SudoWrapper.new(wrapper)
|
|
end
|
|
|
|
end
|
|
end
|