Class: VagrantPlugins::Openstack::Action::SnapshotList

Inherits:
AbstractAction
  • Object
show all
Defined in:
lib/vagrant-openstack-provider/action/snapshot_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ SnapshotList

Returns a new instance of SnapshotList.



7
8
9
# File 'lib/vagrant-openstack-provider/action/snapshot_list.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-openstack-provider/action/snapshot_list.rb', line 11

def call(env)
  nova = env[:openstack_client].nova
  machine_snapshots = nova.list_snapshots(env, env[:machine].id)

  env[:machine_snapshot_list] = machine_snapshots.map(&:name)

  @app.call env
end