Class: VagrantPlugins::Skytap::Action::PrepareNFSValidIds

Inherits:
Object
  • Object
show all
Includes:
MixinMachineIndex
Defined in:
lib/vagrant-skytap/action/prepare_nfs_valid_ids.rb

Overview

Creates a list of vm ids from all Skytap VMs in Vagrant’s global machine index. Any Vagrant machine not on this list will have its NFS entry pruned by the SyncedFolderCleanup action. NOTE: Unfortunately, Vagrant providers have no way to know about each other’s machines. github.com/mitchellh/vagrant/issues/6439

Instance Attribute Summary

Attributes included from MixinMachineIndex

#env

Instance Method Summary collapse

Methods included from MixinMachineIndex

#machine_index, #machine_index_entry

Constructor Details

#initialize(app, env) ⇒ PrepareNFSValidIds

Returns a new instance of PrepareNFSValidIds.



15
16
17
18
19
# File 'lib/vagrant-skytap/action/prepare_nfs_valid_ids.rb', line 15

def initialize(app, env)
  @app = app
  @env = env
  @logger = Log4r::Logger.new("vagrant_skytap::action::prepare_nfs_valid_ids")
end

Instance Method Details

#call(env) ⇒ Object



21
22
23
24
# File 'lib/vagrant-skytap/action/prepare_nfs_valid_ids.rb', line 21

def call(env)
  env[:nfs_valid_ids] = machine_index.collect{|entry| entry.extra_data['vm_id']}.compact
  @app.call(env)
end