From 30ec42b36bd0e37ec1f470b8eabd33dca1e14de6 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Tue, 12 Mar 2013 14:40:18 -0300 Subject: [PATCH] Fix bug with lxc-start arguments --- lib/vagrant-lxc/container/cli.rb | 4 ++-- spec/unit/container/cli_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant-lxc/container/cli.rb b/lib/vagrant-lxc/container/cli.rb index 01bce47..2939233 100644 --- a/lib/vagrant-lxc/container/cli.rb +++ b/lib/vagrant-lxc/container/cli.rb @@ -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 diff --git a/spec/unit/container/cli_spec.rb b/spec/unit/container/cli_spec.rb index 11152eb..9a797a7 100644 --- a/spec/unit/container/cli_spec.rb +++ b/spec/unit/container/cli_spec.rb @@ -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'