Remove dependency on Config object to start containers
This commit is contained in:
parent
c53f9456b7
commit
7187556b6a
3 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue