Skip to content

Commit

Permalink
voxpupuligh-393: Implement snapshotting methods for vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjfisher committed Feb 2, 2015
1 parent 52e4ae2 commit 847cbc1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/beaker/hypervisor/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ def cleanup
FileUtils.rm_rf(@vagrant_path)
end

#snapshotting depends on https://github.com/scalefactory/vagrant-multiprovider-snap
def take_snapshot(host,snapshot_name)
@logger.debug "Creating snapshot of #{host}"
vagrant_cmd("snap take #{host} --name=#{snapshot_name}")
end

def restore_snapshot(host,snapshot_name)
@logger.debug "Restoring snapshot of #{host}"
vagrant_cmd("snap rollback #{host} --name=#{snapshot_name}")
end

def vagrant_cmd(args)
Dir.chdir(@vagrant_path) do
exit_status = 1
Expand Down

0 comments on commit 847cbc1

Please sign in to comment.