diff --git a/lib/vagrant/config/vm/provisioner.rb b/lib/vagrant/config/vm/provisioner.rb index 48dce4435..485ec5e66 100644 --- a/lib/vagrant/config/vm/provisioner.rb +++ b/lib/vagrant/config/vm/provisioner.rb @@ -18,12 +18,17 @@ module Vagrant # Configures the provisioner if it can (if it is valid). def configure(options=nil, &block) + # We don't want ancestors to be searched. This is the default in 1.8, + # but not in 1.9, hence this hackery. + const_args = ["Config"] + const_args << false if RUBY_VERSION >= "1.9" + # We assume that every provisioner has a `Config` class beneath # it for configuring. - return if !@provisioner || !@provisioner.const_defined?("Config", false) + return if !@provisioner || !@provisioner.const_defined?(*const_args) # Instantiate the config class and configure it - @config = @provisioner.const_get("Config", false).new + @config = @provisioner.const_get(*const_args).new block.call(@config) if block # TODO: Deal with the options hash