lib/vagrant-rimu/actions/create.rb in vagrant-rimu-0.0.2 vs lib/vagrant-rimu/actions/create.rb in vagrant-rimu-0.0.3

- old
+ new

@@ -1,20 +1,24 @@ require 'log4r' require 'vagrant' +require 'vagrant-rimu/actions/abstract_action' + module VagrantPlugins module Rimu module Actions - class Create + class Create < AbstractAction include Vagrant::Util::Retryable + def initialize(app, env) @app = app @machine = env[:machine] @logger = Log4r::Logger.new('vagrant::rimu::create') end - def call(env) + # rubocop:disable Metrics/AbcSize + def execute(env) client = env[:rimu_api] env[:ui].info I18n.t('vagrant_rimu.creating') params = { :billing_oid => @machine.provider_config.billing_id, :dc_location => @machine.provider_config.data_centre, @@ -68,10 +72,11 @@ end end @machine.config.ssh.username = user @app.call(env) end + # rubocop:enable Metrics/AbcSize def recover(env) return if env['vagrant.error'].is_a?(Vagrant::Errors::VagrantError) if @machine.state.id != :not_created terminate(env) @@ -81,10 +86,10 @@ def terminate(env) destroy_env = env.dup destroy_env.delete(:interrupted) destroy_env[:config_validate] = false destroy_env[:force_confirm_destroy] = true - env[:action_runner].run(Actions.destroy, destroy_env) + env[:action_runner].run(Actions.action_destroy, destroy_env) end end end end end