Class: VagrantPlugins::StartCloud::Action::ConfigureProviders

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-startcloud/action/configure_providers.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ConfigureProviders

Returns a new instance of ConfigureProviders.



7
8
9
10
11
12
# File 'lib/vagrant-startcloud/action/configure_providers.rb', line 7

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

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/vagrant-startcloud/action/configure_providers.rb', line 14

def call(env)
  config = @machine.config.startcloud
  settings = config.settings

  if settings && settings['provider_type']
    @machine.ui.info I18n.t('vagrant_startcloud.configuring.provider',
                            provider: settings['provider_type'])

    case settings['provider_type']
    when 'virtualbox'
      configure_virtualbox(settings)
    when 'zones'
      configure_zones(settings, config.zones)
    end
  end

  @app.call(env)
end