Class: VagrantPlugins::SyncedFolderNFSGuest::Action::UnmountNFS

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-nfs_guest/action/unmount_nfs.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ UnmountNFS

Returns a new instance of UnmountNFS.



6
7
8
9
# File 'lib/vagrant-nfs_guest/action/unmount_nfs.rb', line 6

def initialize(app,env)
  @app = app
  @logger = Log4r::Logger.new("vagrant-nfs_guest::action::unmount_nfs")
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/vagrant-nfs_guest/action/unmount_nfs.rb', line 11

def call(env)
  @machine = env[:machine]

  if @machine.state.id == :running
    # unmount any host mounted NFS folders
    @machine.ui.info(I18n.t("vagrant_nfs_guest.actions.vm.nfs.unmounting"))
    folders = @machine.config.vm.synced_folders

    @machine.env.host.capability(:nfs_unmount, @machine.ui, folders)
  end

  @app.call(env)

end