From 1df4891371609d9478f3361f46d0592cdb842388 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 6 Feb 2013 16:14:59 -0800 Subject: [PATCH] Spread out methods in provision so subclass can override --- lib/vagrant/action/builtin/provision.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/action/builtin/provision.rb b/lib/vagrant/action/builtin/provision.rb index c13198e12..42be025d7 100644 --- a/lib/vagrant/action/builtin/provision.rb +++ b/lib/vagrant/action/builtin/provision.rb @@ -50,13 +50,20 @@ module Vagrant next if env[:provision_types] && \ !env[:provision_types].include?(type_map[p]) - env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning", - :provisioner => p.class)) - - p.provision + run_provisioner(p) end end end + + # This is pulled out into a seperate method so that users can + # subclass and implement custom behavior if they'd like around + # this step. + def run_provisioner(p) + env[:ui].info(I18n.t("vagrant.actions.vm.provision.beginning", + :provisioner => p.class)) + + p.provision + end end end end