Remove dependency on Config object to start containers

This commit is contained in:
Fabio Rehm 2013-04-09 23:33:30 -03:00
parent c53f9456b7
commit 7187556b6a
3 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -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

View file

@ -71,7 +71,7 @@ describe Vagrant::LXC::Driver do
describe 'start' do
let(:name) { 'container-name' }
let(:config) { fire_double('Vagrant::LXC::Config', customizations: [['a', '1'], ['b', '2']]) }
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