From 6855dd8c74a194d0b053482e5be186057f85f471 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 7 Jan 2020 10:29:39 -0800 Subject: [PATCH] Check name config option with respond_to? Prior to this commit, the check used to look for the config option `name` in a provisioner config would accidentally create a "DummyConfig" based on how vagrant handles missing config options. This commit fixes that by instead using the `respond_to?` method to check for the existance of the config option name. --- lib/vagrant/action/builtin/mixin_provisioners.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/builtin/mixin_provisioners.rb b/lib/vagrant/action/builtin/mixin_provisioners.rb index e343a0455..32e7fa7d5 100644 --- a/lib/vagrant/action/builtin/mixin_provisioners.rb +++ b/lib/vagrant/action/builtin/mixin_provisioners.rb @@ -35,7 +35,8 @@ module Vagrant # Note: `name` is set to a symbol, since it is converted to one via #Config::VM.provision provisioner_name = provisioner.name if !provisioner_name - if provisioner.config.name + if provisioner.config.respond_to?(:name) && + provisioner.config.name provisioner_name = provisioner.config.name.to_sym end else