Class: VagrantPlugins::ProviderLibvirt::Action::SnapshotRestore

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-libvirt/action/snapshot_restore.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SnapshotRestore

Returns a new instance of SnapshotRestore.



7
8
9
# File 'lib/vagrant-libvirt/action/snapshot_restore.rb', line 7

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/vagrant-libvirt/action/snapshot_restore.rb', line 11

def call(env)
  env[:ui].info(I18n.t(
    "vagrant.actions.vm.snapshot.restoring",
    name: env[:snapshot_name]))
  env[:machine].provider.driver.restore_snapshot(env[:snapshot_name])

  @app.call(env)
end