Class: VagrantPlugins::Parallels::Action::SnapshotDelete
- Inherits:
-
Object
- Object
- VagrantPlugins::Parallels::Action::SnapshotDelete
- Defined in:
- lib/vagrant-parallels/action/snapshot_delete.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ SnapshotDelete
constructor
A new instance of SnapshotDelete.
Constructor Details
#initialize(app, env) ⇒ SnapshotDelete
Returns a new instance of SnapshotDelete.
5 6 7 |
# File 'lib/vagrant-parallels/action/snapshot_delete.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-parallels/action/snapshot_delete.rb', line 9 def call(env) snapshots = env[:machine].provider.driver.list_snapshots(env[:machine].id) snapshot_id = snapshots[env[:snapshot_name]] env[:ui].info I18n.t('vagrant.actions.vm.snapshot.deleting', name: env[:snapshot_name]) env[:machine].provider.driver.delete_snapshot( env[:machine].id, snapshot_id) env[:ui].success I18n.t('vagrant.actions.vm.snapshot.deleted', name: env[:snapshot_name]) @app.call(env) end |