Merge pull request #10926 from chrisroberts/f-no-local-loading

Fix plugin discovery loading when no data directory is available
This commit is contained in:
Chris Roberts 2019-06-21 12:41:10 -07:00 committed by GitHub
commit d490b0589f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -1021,7 +1021,11 @@ module Vagrant
ui.warn(I18n.t("vagrant.plugins.local.install_rerun_command"))
exit(-1)
end
Vagrant::Plugin::Manager.instance.local_file.installed_plugins
if Vagrant::Plugin::Manager.instance.local_file
Vagrant::Plugin::Manager.instance.local_file.installed_plugins
else
{}
end
end
# This method copies the private key into the home directory if it

View File

@ -1561,10 +1561,18 @@ VF
allow(plugin_manager).to receive(:load_plugins)
end
context "when local data directory does not exist" do
let(:local_file) { nil }
it "should properly return empty result" do
expect(instance.send(:process_configured_plugins)).to be_empty
end
end
context "plugins are disabled" do
before{ allow(Vagrant).to receive(:plugins_enabled?).and_return(false) }
it "should return nil" do
it "should return empty result" do
expect(instance.send(:process_configured_plugins)).to be_nil
end
end