Allow Vagrantfile to load when using --local

This commit is contained in:
Chris Roberts 2018-07-17 15:00:38 -07:00
parent 78bf131dc8
commit 737ef0eded
2 changed files with 12 additions and 1 deletions

View File

@ -44,7 +44,9 @@ argv.each_index do |i|
# Do not load plugins when performing plugin operations
if arg == "plugin"
opts[:vagrantfile_name] = ""
if argv.none?{|a| a == "--local" }
opts[:vagrantfile_name] = ""
end
ENV['VAGRANT_NO_PLUGINS'] = "1"
# Only initialize plugins when listing installed plugins
if argv[i+1] != "list"

View File

@ -143,5 +143,14 @@ describe "vagrant bin" do
expect(ENV).not_to receive(:[]=).with("VAGRANT_DISABLE_PLUGIN_INIT", "1")
end
end
context "--local" do
let(:argv) { ["plugin", "install", "--local"] }
it "should not unset vagrantfile" do
expect(Vagrant::Environment).to receive(:new).
with(hash_excluding(vagrantfile_name: "")).and_return(env)
end
end
end
end