diff --git a/lib/vagrant-lxc/action/boot.rb b/lib/vagrant-lxc/action/boot.rb index 90d700f..1268e22 100644 --- a/lib/vagrant-lxc/action/boot.rb +++ b/lib/vagrant-lxc/action/boot.rb @@ -12,7 +12,7 @@ module Vagrant config = env[:machine].provider_config env[:ui].info I18n.t("vagrant.actions.vm.boot.booting") - env[:machine].provider.driver.start(config) + env[:machine].provider.driver.start(config.customizations) raise Vagrant::Errors::VMFailedToBoot if !wait_for_boot @app.call env diff --git a/lib/vagrant-lxc/driver.rb b/lib/vagrant-lxc/driver.rb index 75e691f..643b950 100644 --- a/lib/vagrant-lxc/driver.rb +++ b/lib/vagrant-lxc/driver.rb @@ -60,14 +60,14 @@ module Vagrant end end - def start(config) + def start(customizations) @logger.info('Starting container...') if ENV['LXC_START_LOG_FILE'] extra = ['-o', ENV['LXC_START_LOG_FILE'], '-l', 'DEBUG'] end - @cli.transition_to(:running) { |c| c.start(config.customizations, (extra || nil)) } + @cli.transition_to(:running) { |c| c.start(customizations, (extra || nil)) } end def halt diff --git a/spec/unit/driver_spec.rb b/spec/unit/driver_spec.rb index 6f8e984..e91528e 100644 --- a/spec/unit/driver_spec.rb +++ b/spec/unit/driver_spec.rb @@ -70,9 +70,9 @@ describe Vagrant::LXC::Driver do end describe 'start' do - let(:name) { 'container-name' } - let(:config) { fire_double('Vagrant::LXC::Config', customizations: [['a', '1'], ['b', '2']]) } - let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', start: true) } + let(:name) { 'container-name' } + let(:customizations) { [['a', '1'], ['b', '2']] } + let(:cli) { fire_double('Vagrant::LXC::Driver::CLI', start: true) } subject { described_class.new(name, cli) } @@ -81,13 +81,13 @@ describe Vagrant::LXC::Driver do end it 'starts container with configured lxc settings' do - cli.should_receive(:start).with(config.customizations, nil) - subject.start(config) + cli.should_receive(:start).with(customizations, nil) + subject.start(customizations) end it 'expects a transition to running state to take place' do cli.should_receive(:transition_to).with(:running) - subject.start(config) + subject.start(customizations) end end