From 2ef20586da66ccbf6ba875b856a6c130c97e92d9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Jul 2012 21:57:11 -0700 Subject: [PATCH] Remove the action registry feature. This can be removed since in the future all actions will come from the providers or something. There are still issues with box actions but we'll get back to that later... --- lib/vagrant.rb | 6 ------ lib/vagrant/action/runner.rb | 26 +------------------------- lib/vagrant/environment.rb | 12 +----------- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 5fa92e82b..bd021743d 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -95,12 +95,6 @@ module Vagrant c.register([:"1", :provider]) { Plugin::V1::Provider } c.register([:"1", :provisioner]) { Plugin::V1::Provisioner } - # Returns a `Vagrant::Registry` object that contains all the built-in - # middleware stacks. - def self.actions - @actions ||= Vagrant::Action::Builtin.new - end - # The source root is the path to the root directory of # the Vagrant gem. def self.source_root diff --git a/lib/vagrant/action/runner.rb b/lib/vagrant/action/runner.rb index a28551b44..832a38872 100644 --- a/lib/vagrant/action/runner.rb +++ b/lib/vagrant/action/runner.rb @@ -10,8 +10,7 @@ module Vagrant class Runner @@reported_interrupt = false - def initialize(registry, globals=nil, &block) - @registry = registry + def initialize(globals=nil, &block) @globals = globals || {} @lazy_globals = block @logger = Log4r::Logger.new("vagrant::action::runner") @@ -20,7 +19,6 @@ module Vagrant def run(callable_id, options=nil) callable = callable_id callable = Builder.new.use(callable_id) if callable_id.kind_of?(Class) - callable = registry_sequence(callable_id) if callable_id.kind_of?(Symbol) raise ArgumentError, "Argument to run must be a callable object or registered action." if !callable || !callable.respond_to?(:call) # Create the initial environment with the options given @@ -48,28 +46,6 @@ module Vagrant @logger.info("Running action: #{callable_id}") Util::Busy.busy(int_callback) { callable.call(environment) } end - - protected - - def registry_sequence(id) - # Attempt to get the sequence - seq = @registry.get(id) - return nil if !seq - - # Go through all the registered plugins and get all the hooks - # for this sequence. - Vagrant.plugin("1").registered.each do |plugin| - hooks = plugin.action_hook(Vagrant::Plugin::V1::Plugin::ALL_ACTIONS) - hooks += plugin.action_hook(id) - - hooks.each do |hook| - hook.call(seq) - end - end - - # Return the sequence - seq - end end end end diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 9238dc283..532d1d030 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -205,7 +205,7 @@ module Vagrant # # @return [Action::Runner] def action_runner - @action_runner ||= Action::Runner.new(action_registry) do + @action_runner ||= Action::Runner.new do { :action_runner => action_runner, :box_collection => boxes, @@ -218,16 +218,6 @@ module Vagrant end end - # Action registry for registering new actions with this environment. - # - # @return [Registry] - def action_registry - # For now we return the global built-in actions registry. In the future - # we may want to create an isolated registry that inherits from this - # global one, but for now there isn't a use case that calls for it. - Vagrant.actions - end - # Loads on initial access and reads data from the global data store. # The global data store is global to Vagrant everywhere (in every environment), # so it can be used to store system-wide information. Note that "system-wide"