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.
This commit is contained in:
parent
dd5d73e8a9
commit
6855dd8c74
|
@ -35,7 +35,8 @@ module Vagrant
|
||||||
# Note: `name` is set to a symbol, since it is converted to one via #Config::VM.provision
|
# Note: `name` is set to a symbol, since it is converted to one via #Config::VM.provision
|
||||||
provisioner_name = provisioner.name
|
provisioner_name = provisioner.name
|
||||||
if !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
|
provisioner_name = provisioner.config.name.to_sym
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue