Class: VagrantPlugins::KeyManager::Action::GetGuestKeys

Inherits:
Object
  • Object
show all
Includes:
HostsFile
Defined in:
lib/vagrant-keymanager/action/get_guest_keys.rb

Instance Method Summary collapse

Methods included from HostsFile

#get_guest_keys

Constructor Details

#initialize(app, env) ⇒ GetGuestKeys

Returns a new instance of GetGuestKeys.



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

def initialize(app, env)
  @app = app
  @machine = env[:machine]
  @global_env = @machine.env
  @provider = env[:provider]

  # config_global is deprecated from v1.5
  if Gem::Version.new(::Vagrant::VERSION) >= Gem::Version.new('1.5')
    @config = @global_env.vagrantfile.config
  else
    @config = @global_env.config_global
  end
  
  @logger = Log4r::Logger.new('vagrant::keymanager::get_guest_keys')
end

Instance Method Details

#call(env) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/vagrant-keymanager/action/get_guest_keys.rb', line 25

def call(env)
  env[:ui].info I18n.t('vagrant_keymanager.action.get_guest_keys', {
    :name => @machine.name
  })
  get_guest_keys(@machine)

  @app.call(env)
end