From f26b6098f915af18648753a8baa92b0740c42964 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sat, 11 Mar 2017 22:17:46 +0100 Subject: [PATCH] Make `start` action run provisioners if VM is running That is a port of the upstream Vagrant commit: https://github.com/mitchellh/vagrant/commit/e42f346b1d5891b5bd3651564894b95ed3b8b6cc Previously, there was no one gesture that would start a VM if it was not running and run the appropriate provisioners regardless of its original state. `vagrant up` did nothing if the VM was running, while `vagrant provision` did nothing if the VM was not running. Change the semantics of `vagrant up`, via the start actions of the providers, to go through the provisioning logic even if the VM is already running. The semantics of `run: "once"` vs `run: "always"` are respected. --- lib/vagrant-parallels/action.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-parallels/action.rb b/lib/vagrant-parallels/action.rb index dfb85608..9048dabc 100644 --- a/lib/vagrant-parallels/action.rb +++ b/lib/vagrant-parallels/action.rb @@ -277,9 +277,10 @@ def self.action_start Vagrant::Action::Builder.new.tap do |b| b.use BoxCheckOutdated b.use Call, IsState, :running do |env1, b1| - # If the VM is running, then our work here is done, exit + # If the VM is running, run the necessary provisioners if env1[:result] b1.use Message, I18n.t('vagrant_parallels.commands.common.vm_already_running') + action_provision next end