Class: VagrantPlugins::ProviderVeertu::Action::SnapshotSave

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-veertu/action/snapshot_save.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SnapshotSave

Returns a new instance of SnapshotSave.



5
6
7
# File 'lib/vagrant-veertu/action/snapshot_save.rb', line 5

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

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vagrant-veertu/action/snapshot_save.rb', line 9

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

  env[:ui].success(I18n.t(
    "vagrant.actions.vm.snapshot.saved",
    name: env[:snapshot_name]))

  @app.call(env)
end