Class: VagrantPlugins::Linode::Actions::Reload
- Inherits:
-
Object
- Object
- VagrantPlugins::Linode::Actions::Reload
- Includes:
- Helpers::Waiter
- Defined in:
- lib/vagrant-linode/actions/reload.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Reload
constructor
A new instance of Reload.
Methods included from Helpers::Waiter
Constructor Details
#initialize(app, env) ⇒ Reload
Returns a new instance of Reload.
10 11 12 13 14 |
# File 'lib/vagrant-linode/actions/reload.rb', line 10 def initialize(app, env) @app = app @machine = env[:machine] @logger = Log4r::Logger.new('vagrant::linode::reload') end |
Instance Method Details
#call(env) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vagrant-linode/actions/reload.rb', line 16 def call(env) @client = env[:linode_api] # submit reboot linode request result = @client.linode.reboot(linodeid: @machine.id) # wait for request to complete env[:ui].info I18n.t('vagrant_linode.info.reloading') wait_for_event(env, result['jobid']) @app.call(env) end |