From c0bf4471fb41706cdc90d5a5098d8db76dd0fb88 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 25 Aug 2010 00:00:54 -0700 Subject: [PATCH] `vagrant suspend` --- lib/vagrant/command/suspend.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/vagrant/command/suspend.rb diff --git a/lib/vagrant/command/suspend.rb b/lib/vagrant/command/suspend.rb new file mode 100644 index 000000000..7f46535ce --- /dev/null +++ b/lib/vagrant/command/suspend.rb @@ -0,0 +1,18 @@ +module Vagrant + module Command + class SuspendCommand < NamedBase + desc "Suspend a running Vagrant environment." + register "suspend" + + def execute + target_vms.each do |vm| + if vm.created? + vm.suspend + else + vm.env.ui.info "VM not created. Moving on..." + end + end + end + end + end +end