Class: VagrantPlugins::TiktalikVagrant::Action::PowerOn
- Inherits:
-
Object
- Object
- VagrantPlugins::TiktalikVagrant::Action::PowerOn
- Defined in:
- lib/vagrant-tiktalik/action/power_on.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ PowerOn
constructor
A new instance of PowerOn.
Constructor Details
#initialize(app, env) ⇒ PowerOn
Returns a new instance of PowerOn.
9 10 11 12 13 |
# File 'lib/vagrant-tiktalik/action/power_on.rb', line 9 def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_tiktalik::action::power_on") @config = env[:machine].provider_config end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vagrant-tiktalik/action/power_on.rb', line 15 def call(env) env[:ui].info(I18n.t("vagrant_tiktalik.powering_on")) t = Tiktalik t.api_key = @config.api_key t.api_secret_key = @config.api_secret t.ca_file = @config.ca_file i = Tiktalik::Computing::Instance instance = i.find env[:machine].id instance.start env[:machine].id = instance.uuid @app.call(env) end |