Permalink
Browse files

Adds 'freezedry' top level command

  • Loading branch information...
1 parent 3ae14b7 commit 574ea7cbc6a52d5bb75fc5c72af96e05587f978f @elight committed Feb 25, 2014
Showing with 32 additions and 1 deletion.
  1. +1 −0 Gemfile
  2. +1 −1 lib/vagrant-rackspace/action.rb
  3. +25 −0 lib/vagrant-rackspace/freezedry.rb
  4. +5 −0 lib/vagrant-rackspace/plugin.rb
View
@@ -10,5 +10,6 @@ group :development do
# gem dependency because we expect to be installed within the
# Vagrant environment itself using `vagrant plugin`.
gem 'coveralls', require: false
+ gem 'pry'
end
@@ -107,7 +107,7 @@ def self.action_up
end
end
- def self.action_suspend
+ def self.action_freezedry
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use Call, IsCreated do |env, b2|
@@ -0,0 +1,25 @@
+require 'vagrant-rackspace/action'
+
+module VagrantPlugins
+ module Rackspace
+ module Command
+ class FreezeDry < Vagrant.plugin("2", :command)
+ def self.synopsis
+ "creates an image using server's name then destroys server"
+ end
+
+ def initialize(argv, env)
+ require 'pry'
+ @machines, _, _ = split_main_and_subcommand(argv)
+ super
+ end
+
+ def execute
+ with_target_vms(@machines, :provider => :rackspace) do |machine|
+ machine.action(:freezedry)
+ end
+ end
+ end
+ end
+ end
+end
@@ -32,6 +32,11 @@ class Plugin < Vagrant.plugin("2")
require_relative "provider"
Provider
end
+
+ command "freezedry" do
+ require_relative "freezedry"
+ Command::FreezeDry
+ end
end
end
end

0 comments on commit 574ea7c

Please sign in to comment.