Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect chef provisioners by type instead of by name (multi-machine), fix #101 #103

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/vagrant-proxyconf/action/configure_chef_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ def config
# @return [Array] all Chef provisioners
def chef_provisioners
@machine.config.vm.provisioners.select do |prov|
[:chef_solo, :chef_client].include?(prov.name)
# Since Vagrant > 1.7 the provisioner type is returned by the prov#type method
# (it used to be prov#name in older versions). Vagrant 1.7.0 broke prov#name
# so we rely on prov#type when possible and fallback to prov#name when not.
# See github issues #101 and mitchellh/vagrant#5069.
prov_type_method = [:type, :name].detect { |meth| prov.respond_to?(meth) }
[:chef_solo, :chef_client].include?(prov.public_send(prov_type_method))
end
end

Expand Down