diff --git a/plugins/kernel_v2/config/vm_provisioner.rb b/plugins/kernel_v2/config/vm_provisioner.rb index 912106137..63718e475 100644 --- a/plugins/kernel_v2/config/vm_provisioner.rb +++ b/plugins/kernel_v2/config/vm_provisioner.rb @@ -49,6 +49,7 @@ module VagrantPlugins if !@config_class @logger.info( "Provisioner config for '#{@name}' not found. Ignoring config.") + @config_class = Vagrant::Config::V2::DummyConfig end end diff --git a/test/unit/plugins/kernel_v2/config/vm_test.rb b/test/unit/plugins/kernel_v2/config/vm_test.rb index 690e8eb82..a295d512e 100644 --- a/test/unit/plugins/kernel_v2/config/vm_test.rb +++ b/test/unit/plugins/kernel_v2/config/vm_test.rb @@ -3,6 +3,8 @@ require File.expand_path("../../../../base", __FILE__) require Vagrant.source_root.join("plugins/kernel_v2/config/vm") describe VagrantPlugins::Kernel_V2::VMConfig do + include_context "unit" + subject { described_class.new } let(:machine) { double("machine") } @@ -210,6 +212,24 @@ describe VagrantPlugins::Kernel_V2::VMConfig do expect(r[0]).to be_invalid end + it "allows provisioners that don't define any config" do + register_plugin("2") do |p| + p.name "foo" + # This plugin registers a dummy provisioner + # without registering a provisioner config + p.provisioner(:foo) do + Class.new Vagrant::plugin("2", :provisioner) + end + end + + subject.provision("foo") do |c| + c.bar = "baz" + end + + # This should succeed without errors + expect{ subject.finalize! }.to_not raise_error + end + describe "merging" do it "copies the configs" do subject.provision("shell", inline: "foo")