4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/sahara/command/commit.rb', line 4
def execute
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Commits changes - moves sandbox initial state to currentstate"
opts.separator ""
opts.separator "Usage: vagrant sandbox commit <vmname>"
end
argv = parse_options(opts)
return if !argv
with_target_vms(argv, :reverse => true) do |machine|
ses = Sahara::Session::Factory.create(machine)
if !ses.is_vm_created? then
puts "[#{machine.name}] VM is not created"
next
end
if ses.is_snapshot_mode_on? then
puts "[#{machine.name}] Committing the virtual machine..."
ses.commit
else
puts "[#{machine.name}] Not sandbox mode now"
end
end
end
|