Sha256: 1cbabd8f9ddfe73c36b3dc9d4641fdff24fc9874ed516400e4cc5d107b615a83

Contents?: true

Size: 959 Bytes

Versions: 1

Compression:

Stored size: 959 Bytes

Contents

module HashiCorp

    module VagrantVMwarefusion

        module Driver

            class Fusion

                def snapshot_take(name)
                    vmrun("snapshot", "#{vmx_path}", name || "vagrant-snap-#{Time.now.to_i}")
                end

                def snapshot_rollback(bootmode, name)
                    vmrun("revertToSnapshot", "#{vmx_path}", name || snapshot_list.last)
                    start(bootmode)
                end

                def snapshot_list
                    snapshots = []
                    vmrun("listSnapshots", "#{vmx_path}").stdout.split("\n").each do |line|
                        if line !~ /Total snapshot/
                            snapshots << line
                        end
                    end
                    snapshots
                end

                def has_snapshot?
                    snapshot_list.length > 0
                end

            end

        end

    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-multiprovider-snap-0.0.12 lib/vagrant-multiprovider-snap/providers/vmware_fusion/driver/base.rb