From 2ca46ced57a33e8b60d427117e89f9723368514f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 30 Jul 2011 09:58:29 -0700 Subject: [PATCH] Fix message when provision is run on halted machine [closes GH-447] --- CHANGELOG.md | 1 + lib/vagrant/command/provision.rb | 8 ++++++-- templates/locales/en.yml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab776d51d..dd730a9d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Fix SSH `exec!` to inherit proper `$PATH`. [GH-426] - Chef client now accepts an empty (`nil`) run list again. [GH-429] + - Fix incorrect error message when running `provision` on halted VM. [GH-447] ## 0.8.2 (July 22, 2011) diff --git a/lib/vagrant/command/provision.rb b/lib/vagrant/command/provision.rb index 4c797f61a..02ed60191 100644 --- a/lib/vagrant/command/provision.rb +++ b/lib/vagrant/command/provision.rb @@ -5,8 +5,12 @@ module Vagrant def execute target_vms.each do |vm| - if vm.created? && vm.vm.running? - vm.provision + if vm.created? + if vm.vm.running? + vm.provision + else + vm.env.ui.info I18n.t("vagrant.commands.common.vm_not_running") + end else vm.env.ui.info I18n.t("vagrant.commands.common.vm_not_created") end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 5dfb2075b..6ec6432c1 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -182,6 +182,7 @@ en: commands: common: vm_not_created: "VM not created. Moving on..." + vm_not_running: "VM is not currently running. Please bring it up to run this command." box: no_installed_boxes: "There are no installed boxes! Use `vagrant box add` to add some." ssh: