From 7749b8fba4275546281e08b73bebb41dc0c349ca Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 17 Apr 2014 13:59:13 -0700 Subject: [PATCH] providers/hyperv: provision action [GH-3494] --- CHANGELOG.md | 4 ++++ plugins/providers/hyperv/action.rb | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca23c4e51..03648bfc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.5.4 (unreleased) +IMPROVEMENTS: + + - providers/hyperv: Implement the provision command. [GH-3494] + BUG FIXES: - core: Allow overriding of the default SSH port. [GH-3474] diff --git a/plugins/providers/hyperv/action.rb b/plugins/providers/hyperv/action.rb index c68930d57..6562afc4d 100644 --- a/plugins/providers/hyperv/action.rb +++ b/plugins/providers/hyperv/action.rb @@ -63,6 +63,27 @@ module VagrantPlugins end end + def self.action_provision + Vagrant::Action::Builder.new.tap do |b| + b.use ConfigValidate + b.use Call, Created do |env, b2| + if env[:result] + b2.use Message, I18n.t("vagrant_hyperv.message_not_created") + next + end + + b2.use Call, IsState, :running do |env1, b3| + if !env1[:result] + b3.use Message, I18n.t("vagrant_hyperv.message_not_running") + next + end + + b3.use Provision + end + end + end + end + def self.action_resume Vagrant::Action::Builder.new.tap do |b| b.use HandleBox