Fix bug with lxc-start arguments

This commit is contained in:
Fabio Rehm 2013-03-12 14:40:18 -03:00
parent 08221913dd
commit 30ec42b36b
2 changed files with 3 additions and 3 deletions

View file

@ -46,8 +46,8 @@ module Vagrant
run :destroy, '--name', @name
end
def start(configs = {})
configs = configs.map { |key, value| ["-s", "#{key}=#{value}"] }.flatten
def start(configs = [])
configs = configs.map { |conf| ["-s", conf] }.flatten
run :start, '-d', '--name', @name, *configs
end

View file

@ -82,7 +82,7 @@ describe Vagrant::LXC::Container::CLI do
end
it 'uses provided hash to configure the container' do
subject.start('lxc.config' => 'value', 'lxc.other' => 'value')
subject.start(['lxc.config=value', 'lxc.other=value'])
subject.should have_received(:run).with(:start, '-d', '--name', name,
'-s', 'lxc.config=value',
'-s', 'lxc.other=value'