lib/vagrant-multiprovider-snap/providers/virtualbox/driver/base.rb in vagrant-zz-multiprovider-snap-0.0.1 vs lib/vagrant-multiprovider-snap/providers/virtualbox/driver/base.rb in vagrant-zz-multiprovider-snap-0.0.2
- old
+ new
@@ -16,18 +16,21 @@
execute("snapshot", @uuid, "restore", snapshot_list.first)
start(bootmode)
end
def snapshot_list
- # XXX blows up if no snapshots on the VM - how to prevent this?
info = execute("showvminfo", @uuid, "--machinereadable")
snapshots = []
info.split("\n").each do |line|
- if line =~ /^SnapshotName="(.+?)"$/
+ if line =~ /^SnapshotName="(vagrant-snap-.+?)"$/
snapshots << $1.to_s
end
end
snapshots
+ end
+
+ def has_snapshot?
+ snapshot_list.length > 0
end
end
end