Vagrantfile: Test directly for `lxc-ls`.

This avoids giving the same "no such command" error on Linux machines
that don't have LXC installed as we now avoid on non-Linux.
This commit is contained in:
Greg Price 2018-02-16 11:11:22 -08:00
parent 718b3fcd6a
commit 424c887a27
1 changed files with 2 additions and 2 deletions

2
Vagrantfile vendored
View File

@ -31,8 +31,8 @@ end
# have the box (e.g. on first setup), Vagrant would download it but too # have the box (e.g. on first setup), Vagrant would download it but too
# late for us to patch it like this; so we prompt them to explicitly add it # late for us to patch it like this; so we prompt them to explicitly add it
# first and then rerun. # first and then rerun.
if Vagrant::Util::Platform.linux?
if ['up', 'provision'].include? ARGV[0] if ['up', 'provision'].include? ARGV[0]
if command? "lxc-ls"
LXC_VERSION = `lxc-ls --version`.strip unless defined? LXC_VERSION LXC_VERSION = `lxc-ls --version`.strip unless defined? LXC_VERSION
if LXC_VERSION == "2.1.0" if LXC_VERSION == "2.1.0"
lxc_config_file = ENV['HOME'] + "/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.2.0/lxc/lxc-config" lxc_config_file = ENV['HOME'] + "/.vagrant.d/boxes/fgrehm-VAGRANTSLASH-trusty64-lxc/1.2.0/lxc/lxc-config"