Class: Vagrant::Commit::Command
- Inherits:
-
Object
- Object
- Vagrant::Commit::Command
- Defined in:
- lib/vagrant-commit/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
9 10 11 |
# File 'lib/vagrant-commit/command.rb', line 9 def self.synopsis "(plugin) qemu-img commit the volumes" end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-commit/command.rb', line 13 def execute opts = OptionParser.new do |o| o. = "Usage: vagrant commit [name|id]" end # Parse the options argv = (opts) with_target_vms(argv) do |machine| machine_name = machine.name.to_s if machine.state.id != :shutoff @env.ui.info("Halting #{machine_name}") end machine.action(:halt) @env.action_runner.run(Vagrant::Commit::Action.action_commit_volumes, { :machine => machine, }) end end |